Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.URIImpl


  }

  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


  }

  private void compareURIs(String uri)
    throws Exception
  {
    URIImpl uriImpl = new URIImpl(uri);
    MemURI memURI = new MemURI(this, uriImpl.getNamespace(), uriImpl.getLocalName());

    assertEquals("MemURI not equal to URIImpl for: " + uri, uriImpl, memURI);
    assertEquals("MemURI has different hash code than URIImpl for: " + uri, uriImpl.hashCode(),
        memURI.hashCode());
  }
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

    List<NameValuePair> params = new ArrayList<NameValuePair>(5);
    for (String encodedContext : Protocol.encodeContexts(contexts)) {
      params.add(new NameValuePair(Protocol.CONTEXT_PARAM_NAME, encodedContext));
    }
    if (baseURI != null && baseURI.trim().length() != 0) {
      String encodedBaseURI = Protocol.encodeValue(new URIImpl(baseURI));
      params.add(new NameValuePair(Protocol.BASEURI_PARAM_NAME, encodedBaseURI));
    }
    request.sendQueryString(params);

    // Set payload
View Full Code Here

  private TupleResult createQueryResult() {
    List<String> bindingNames = Arrays.asList("a", "b", "c");

    MapBindingSet solution1 = new MapBindingSet(bindingNames.size());
    solution1.addBinding("a", new URIImpl("foo:bar"));
    solution1.addBinding("b", new BNodeImpl("bnode"));
    solution1.addBinding("c", new LiteralImpl("baz"));

    MapBindingSet solution2 = new MapBindingSet(bindingNames.size());
    solution2.addBinding("a", new LiteralImpl("1", XMLSchema.INTEGER));
View Full Code Here

      }
      else if (baseURI.charAt(baseURI.length() - 1) == '/') {
        relativeURI = new java.net.URI(baseURI);
      }
      else {
        String ns = new URIImpl(baseURI).getNamespace();
        if (ns.charAt(ns.length() - 1) == '/') {
          relativeURI = new java.net.URI(ns);
        }
        else {
          relativeURI = null;
View Full Code Here

    return memURI;
  }

  public synchronized 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

   */
  public void testNamedContext_PUT()
    throws Exception
  {
    String location = Protocol.getStatementsLocation(TestServer.REPOSITORY_URL);
    String encContext = Protocol.encodeValue(new URIImpl("urn:x-local:graph1"));
    location = HttpClientUtil.appendParameter(location, Protocol.CONTEXT_PARAM_NAME, encContext);
    putFile(location, "/testcases/named-graph-1.ttl");
  }
View Full Code Here

   */
  public void testNamedContext_DELETE()
    throws Exception
  {
    String location = Protocol.getStatementsLocation(TestServer.REPOSITORY_URL);
    String encContext = Protocol.encodeValue(new URIImpl("urn:x-local:graph1"));
    location = HttpClientUtil.appendParameter(location, Protocol.CONTEXT_PARAM_NAME, encContext);
    delete(location);
  }
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.