Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.URIImpl


      return null;

    String redirectURL = cacheController.getCachedRedirect(lookupURL);
   
    try {
      lookupURLContext = new URIImpl(redirectURL != null ? redirectURL : lookupURL);
    }
    catch (IllegalArgumentException e) {
      e.printStackTrace();
      return null;
    }
   
    RepositoryResult<Statement> statements;
    try {
      statements = conn.getStatements(null, new URIImpl(Constants.nsSindiceVocab + "link"), null, true, lookupURLContext);
      statementsList = Iterations.addAll(statements, new ArrayList<Statement>());
      statements.close();
    } catch (RepositoryException e1) {
      e1.printStackTrace();
      return null;
View Full Code Here


          String value = cacheController.getCachedHeaderDataValue(metaDataConn, uri, field);
        addTextNode(doc, sourceElement, field, value);
      }
     
      /* Parse resultCode */
      String reponseCodeString = cacheController.getCachedHeaderDataValue(metaDataConn, new URIImpl(uri), "responseCode");
      int responseCode = (reponseCodeString == null ? 0 : Integer.parseInt(reponseCodeString));
      addTextNode(doc, sourceElement, "status", HttpStatusCodes.toString(responseCode));
    }
    else
      addTextNode(doc, sourceElement, "status", Constants.isBaseUrl(uri) ? "pre-loaded" : "pending");
View Full Code Here

        loadURL(redirectUrl, step, redirectCount + 1, forceReload);
      }
      else {
        /* Data is already loaded; try to find new links within it */
        try {
          org.openrdf.model.URI sesameUri = new URIImpl(url.toString());
          processLinks(step + 1, sesameUri);
        }
        catch (IllegalArgumentException e) {
          e.printStackTrace();
        }
View Full Code Here

      notify();
    }
   
    /* find new links */
    if (result.isSuccess())
      processLinks(task.getStep() + 1, new URIImpl(result.getURI()));
  }
View Full Code Here

  }

  public void testEncode()
    throws Exception
  {
    assertEquals(ValueType.URI, ids.valueOf(ids.nextId(new URIImpl("urn:root"))));
    assertEquals(ValueType.URI, ids.valueOf(ids.nextId(new URIImpl(
        "urn:The quick brown fox jumps over the lazy dog"))));
  }
View Full Code Here

  }

  public void testEncode()
    throws Exception
  {
    assertEquals(ValueType.URI, ids.valueOf(ids.hashOf(new URIImpl("urn:root"))));
    assertEquals(ValueType.URI, ids.valueOf(ids.hashOf(new URIImpl(
        "urn:The quick brown fox jumps over the lazy dog"))));
  }
View Full Code Here

    return memLiteral;
  }

  public URI createURI(String uri) {
    URI tempURI = new URIImpl(uri);
    MemURI memURI = getMemURI(tempURI);

    if (memURI == null) {
      memURI = createMemURI(tempURI);
    }
View Full Code Here

      }

      tempURI = new MemURI(this, namespace, localName);
    }
    else {
      tempURI = new URIImpl(namespace + localName);
    }

    MemURI memURI = uriRegistry.get(tempURI);

    if (memURI == null) {
View Full Code Here

    // Add unnamed gaph
    dataCon.add(new URL(dataFile), null, RDFFormat.forFileName(dataFile));

    // add named graphs
    for (String graphName : graphNames) {
      dataCon.add(new URL(graphName), null, RDFFormat.forFileName(graphName), new URIImpl(graphName));
    }

    // Evaluate the query on the query data
    GraphQueryResult result = dataCon.prepareGraphQuery(QueryLanguage.SERQL, query).evaluate();
    Collection<Statement> actualStatements = Iterations.addAll(result, new ArrayList<Statement>(1));
View Full Code Here

       
        Purpose purpose = null;
       
        /* Look up the requested lens purpose */
        if (request.getParameter("purpose") != null && (!request.getParameter("purpose").equals("defaultPurpose")))
          purpose = new Purpose(new URIImpl(Constants.nsFresnelExt + request.getParameter("purpose")));
        else
          purpose = new Purpose(new URIImpl("http://www.w3.org/2004/09/fresnel#defaultLens")); /* this must be provided, or a random lens is chosen */

        try {
          /* Perform Fresnel selection using the requested display purpose and language */
          selected = conf.select(dataRepository, focalResource, purpose, langPref);
   
          /* Perform Fresnel formatting */
          selected = conf.format(dataRepository, selected);
        }
        catch (NoResultsException e) {
         
              /*
               * If no results are found, redirect the user to the resource
               * if it is not an RDF document.
               * This code is not reached when there already is some data about the resource.
               */
              RepositoryConnection metaDataConn = null;
            try {
              metaDataConn = metaDataRepository.getConnection();
             
            /* Manual support for one level of redirects */
              String resourceRedirect = cacheController.getCachedHeaderDataValue(metaDataConn, focalResource, "location");
              Resource resourceURI = (resourceRedirect == null ? focalResource : new URIImpl(resourceRedirect));
 
              /* Get target content type */
              String contentType = cacheController.getCachedHeaderDataValue(metaDataConn, resourceURI, "content-type");
            if (contentType != null && !ContentTypes.isRDF(contentType)) {
              redirectLocation = focalResource.toString();
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.URIImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.