Examples of BNodeImpl


Examples of org.openrdf.model.impl.BNodeImpl

  }

  public void testBNode()
    throws Exception
  {
    assertEquals(3161856189434237699l, ids.hashOf(new BNodeImpl("node13459o40ix3")));
    assertEquals(2859030200227941027l, ids.hashOf(new BNodeImpl("node13459o4d6x1")));
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

  }

  public void testBNode()
    throws Exception
  {
    assertEquals(3161856189434237699l, ids.hashOf(new BNodeImpl("node13459o40ix3")));
    assertEquals(2859030200227941027l, ids.hashOf(new BNodeImpl("node13459o4d6x1")));
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

  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));
    solution2.addBinding("c", new LiteralImpl("Hello World!", "en"));
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    return memBNode;
  }

  @Override
  public synchronized BNode createBNode(String nodeID) {
    BNode tempBNode = new BNodeImpl(nodeID);
    MemBNode memBNode = getMemBNode(tempBNode);

    if (memBNode == null) {
      memBNode = createMemBNode(tempBNode);
    }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

  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));
    solution2.addBinding("c", new LiteralImpl("Hello World!", "en"));
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    if (subj instanceof BNode) {
      BNode node = (BNode)subj;
      String nodeID = node.getID();
      if (nodeID.endsWith(suffix)) {
        nodeID = nodeID.substring(0, nodeID.length() - suffix.length());
        return new BNodeImpl(nodeID);
      }
      if (external.isInternalBNode(node)) {
        BNode b = in.get(node);
        return b == null ? node : b;
      }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    if (value == null) {
      return null;
    }
    Value v = out.get(value);
    if (v == null && value instanceof BNode) {
      return new BNodeImpl(((BNode)value).getID() + suffix);
    }
    if (v == null) {
      return value;
    }
    return v;
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

      Object underlyingBlankNode = ((AbstractBlankNodeImpl)node).getUnderlyingBlankNode();
     
      if(underlyingBlankNode instanceof BNode) {
        result = (BNode)underlyingBlankNode;
      } else {
        result = new BNodeImpl(String.valueOf(underlyingBlankNode));
      }
    }
   
    return result;
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jsonWriter = new JSONWriter(baos);
        final URI documentURI = new URIImpl("http://fake/uri");
        jsonWriter.startDocument(documentURI);
        jsonWriter.receiveTriple(
                new BNodeImpl("bn1"),
                new URIImpl("http://pred/1"),
                new URIImpl("http://value/1"),
                new URIImpl("http://graph/1"),
                null
        );
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    }

    private Vertex createVertex(String resource) {
        Literal literal;
        if (SailHelper.isBNode(resource)) {
            return new SailVertex(new BNodeImpl(resource.substring(2)), this);
        } else if ((literal = SailHelper.makeLiteral(resource, this)) != null) {
            return new SailVertex(literal, this);
        } else if (resource.contains(SailTokens.NAMESPACE_SEPARATOR) || resource.contains(SailTokens.FORWARD_SLASH) || resource.contains(SailTokens.POUND)) {
            resource = this.expandPrefix(resource);
            return new SailVertex(new URIImpl(resource), this);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.