Package org.apache.clerezza.rdf.core

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


  public void checkMenu() throws Exception {
    Assert.assertTrue(webServerExist);
    UserContextProvider contextProvider = (UserContextProvider)
        waitFor(UserContextProvider.class, 300000);
    Assert.assertTrue(contextProvider != null);
    GraphNode node = new GraphNode(new BNode(), new SimpleMGraph());
    contextProvider.addUserContext(node);
    Iterator<Resource> iter = node.getObjects(GLOBALMENU.globalMenu);
    Assert.assertTrue(iter.hasNext());
    TripleCollection graph = node.getGraph();
    RdfList list = new RdfList((NonLiteral)iter.next(), graph);
View Full Code Here


    List<ConceptProvider> conceptProviderList = conceptProviderManager
        .getConceptProviders();

    MGraph resultMGraph = new SimpleMGraph();
    GraphNode resultNode = new GraphNode(new BNode(), resultMGraph);
    boolean first = true;
    for (ConceptProvider cp : conceptProviderList) {
      if (!freeConceptProviderFound) {
        if (cp instanceof LocalConceptProvider) {
          if (((LocalConceptProvider) cp).getSelectedScheme().equals(
View Full Code Here

    }
    switch (uriRefs.size()) {
      case 1:
        return uriRefs.iterator().next();
      case 0:
        return new BNode();
    }
    final Iterator<UriRef> uriRefIter = uriRefs.iterator();
    //instead of an arbitrary one we might either decide lexicographically
    //or look at their frequency in mGraph
    final UriRef first = uriRefIter.next();
View Full Code Here

  }

  @GET
  public GraphNode overviewPage() {
    MGraph resultGraph = new SimpleMGraph();
    GraphNode result = new GraphNode(new BNode(), resultGraph);
    result.addProperty(RDF.type, BACKUP.BackupAdminPage);
    result.addProperty(RDF.type, PLATFORM.HeadedPage);
    return result;
  }
View Full Code Here

public class TestGraphNode {

  @Test
  public void nodeContext() {
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    UriRef property2 = new UriRef("http://example.org/property2");
    g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
    g.add(new TripleImpl(bNode1, property2, property1));
    g.add(new TripleImpl(bNode2, property2, bNode1));
View Full Code Here

  }

  @Test
  public void addNode() {
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    GraphNode n = new GraphNode(bNode1, g);
    n.addProperty(property1, bNode2);
    Assert.assertEquals(1, g.size());
  }
View Full Code Here

  }

  @Test
  public void getAvailableProperties(){
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    UriRef property2 = new UriRef("http://example.org/property2");
    UriRef property3 = new UriRef("http://example.org/property3");
    UriRef property4 = new UriRef("http://example.org/property4");
    ArrayList<UriRef> props = new ArrayList<UriRef>();
View Full Code Here

  }

  @Test
  public void deleteAll() {
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    UriRef property2 = new UriRef("http://example.org/property2");
    //the two properties two be deleted
    g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
    g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("bla bla")));
View Full Code Here

  }

  @Test
  public void deleteSingleProperty() {
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    UriRef property2 = new UriRef("http://example.org/property2");
    //the properties two be deleted
    g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
    //this 4 properties should stay
View Full Code Here

  }

  @Test
  public void replaceWith() {
    MGraph initialGraph = new SimpleMGraph();
    BNode bNode1 = new BNode();
    BNode bNode2 = new BNode();
    BNode newBnode = new BNode();
    UriRef property1 = new UriRef("http://example.org/property1");
    UriRef property2 = new UriRef("http://example.org/property2");
    UriRef newUriRef = new UriRef("http://example.org/newName");
    Literal literal1 = new PlainLiteralImpl("literal");
    Literal literal2 = new PlainLiteralImpl("bla bla");
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.