Examples of RdfList


Examples of org.apache.clerezza.rdf.utils.RdfList

  @Before
  public void before() {
    typePrioritizer = new TypePrioritizer();
    MGraph mGraph = new SimpleMGraph();
    RdfList rdfList = new RdfList(TypePrioritizer.typePriorityListUri, mGraph);
    rdfList.add(FOAF.Person);
    rdfList.add(FOAF.Group);
    rdfList.add(FOAF.Agent);
    final LockableMGraph systemGraph = new LockableMGraphWrapperForTesting(mGraph);
    typePrioritizer.bindSystemGraph(systemGraph);
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.utils.RdfList

  }

  private List<Resource> getPropertyList(GraphNode r) {
    Iterator<GraphNode> propertyLists = r.getObjectNodes(CRIS.propertyList);
    if (propertyLists.hasNext()) {
      List<Resource> rdfList = new RdfList(propertyLists.next());
      return rdfList;
    }
    throw new RuntimeException("There is no propertyList on this definition.");
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.utils.RdfList

      BNode virtualProperty = new BNode();
      definitionGraph.add(new TripleImpl(virtualProperty, RDF.type, CRIS.JoinVirtualProperty));
      BNode listBNode = new BNode();
      definitionGraph.add(new TripleImpl(virtualProperty, CRIS.propertyList, listBNode));
      List rdfList = new RdfList(listBNode, definitionGraph);
      for (VirtualProperty uri : joinVirtualProperty.properties) {
        rdfList.add(asResource(uri));
      }
      return virtualProperty;
    } else if (vp instanceof PathVirtualProperty) {
      PathVirtualProperty pathVirtualProperty = (PathVirtualProperty) vp;
      if (pathVirtualProperty.properties.isEmpty()) {
        throw new RuntimeException("vp " + vp + " conatins an empty list");
      }
      BNode virtualProperty = new BNode();
      definitionGraph.add(new TripleImpl(virtualProperty, RDF.type, CRIS.PathVirtualProperty));
      BNode listBNode = new BNode();
      definitionGraph.add(new TripleImpl(virtualProperty, CRIS.propertyList, listBNode));
      List rdfList = new RdfList(listBNode, definitionGraph);
      for (UriRef uri : pathVirtualProperty.properties) {
        rdfList.add(uri);
      }
      return virtualProperty;
    }

    throw new RuntimeException("Could not create resource.");
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.