Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.BNode


  }

  @Test
  public void simpleWithUppercase() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
View Full Code Here


  }

  @Test
  public void simpleWithLiteralUppercase() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
View Full Code Here

  }

  @Test
  public void simpleWithCombinedFunctions() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
View Full Code Here

  }

  @Test
  public void multiple() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("another resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
View Full Code Here

   * @param index is > 0
   * @param element
   */
  private void addInRdfList(int index, Resource element) {
    expandTill(index+1);
    NonLiteral newList = new BNode() {
    };
    tc.add(new TripleImpl(newList, RDF.first, element));
    if (index < listList.size()) {
      tc.add(new TripleImpl(newList, RDF.rest, listList.get(index)));
      tc.remove(new TripleImpl(listList.get(index - 1), RDF.rest, listList.get(index)));
View Full Code Here

  }

  @Test
  public void fieldTest() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
View Full Code Here

  }

  @Test
  public void fieldTest2() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDFS.comment, new PlainLiteralImpl("a resource")));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    /* without the final access to field it does not work,
View Full Code Here

  }

  @Test
  public void rdfListAsPropertyValue() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    NonLiteral listNode = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDF.value, listNode));
    List<Resource> list = new RdfList(listNode, mGraph);
    list.add(new PlainLiteralImpl("first"));
    list.add(new PlainLiteralImpl("second"));
View Full Code Here

  public void removeSubGraph() throws NoSuchSubGraphException {
    MGraph baseGraph = createBaseGraph();

    MGraph subGraph = new SimpleMGraph();
    {
      BNode bNode1 = new BNode();
      BNode bNode2 = new BNode();
      subGraph.add(new TripleImpl(u1, u2, bNode2));
      subGraph.add(new TripleImpl(bNode2, u2, bNode2));
      subGraph.add(new TripleImpl(bNode2, u2, bNode1));
    }
    MGraphUtils.removeSubGraph(baseGraph, subGraph);
View Full Code Here

  }

  private MGraph createBaseGraph() {
    MGraph baseGraph = new SimpleMGraph();
    {
      BNode bNode1 = new BNode();
      BNode bNode2 = new BNode();
      baseGraph.add(new TripleImpl(u1, u2, bNode2));
      baseGraph.add(new TripleImpl(bNode2, u2, bNode2));
      baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
      baseGraph.add(new TripleImpl(u3, u2, u1));
    }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.BNode

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.