Examples of BNodeImpl


Examples of org.openrdf.model.impl.BNodeImpl

  }

  public void testValueRoundTrip2()
    throws Exception
  {
    BNode subj = new BNodeImpl("foo");
    URI pred = new URIImpl(EXAMPLE_NS + PAINTS);
    URI obj = new URIImpl(EXAMPLE_NS + GUERNICA);

    testValueRoundTrip(subj, pred, obj);
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

  private TupleQueryResult 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

  }

  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

    return memURI;
  }

  public 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

   *
   * @param b A <code>BNode</code>
   * @return A copy of the original <code>BNode</code>
   */
  public static BNode dupBNode(BNode b) {
    return new BNodeImpl(b.getID());
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    if (resource instanceof URI) {
      URI uri = (URI)resource;
      return new URIImpl(uri.getURI());
    } else if (resource instanceof BNode) {
      BNode bNode = (BNode)resource;
      return new BNodeImpl(bNode.getID());
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

    protected Resource getValueInternal(String value) {
        switch (type) {
            case uri:
                return new URIImpl(value);
            case bnode:
                return new BNodeImpl(value);
            default:
                throw new IllegalStateException();
        }
    }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

                            String.format("Expected a valid URI for object template, found '%s'", value),
                            iae
                    );
                }
            case bnode:
                return new BNodeImpl(value);
            case literal:
                return new LiteralImpl(value);
            default:
                throw new IllegalStateException();
        }
View Full Code Here

Examples of org.openrdf.model.impl.BNodeImpl

        String label = DataIO.readString(in);
        switch (type) {
            case TYPE_URI:
                return new URIImpl(label);
            case TYPE_BNODE:
                return new BNodeImpl(label);
            case TYPE_LITERAL:
                String lang  = DataIO.readString(in);
                String dtype  = DataIO.readString(in);

                if(lang != null) {
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.