Examples of RdfList


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

  }

  private RdfList getChildren(TripleCollection graph, Resource res) {
    NonLiteral children = (NonLiteral) graph.filter((NonLiteral) res,
        GLOBALMENU.children, null).next().getObject();
    return new RdfList(children, graph);
  }
View Full Code Here

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

    private void doListInitialization(TripleCollection tc) {
      if (value instanceof NonLiteral) {   
        if ((tc.filter((NonLiteral) value, RDF.rest, null).hasNext())
            || (tc.filter(
            (NonLiteral) value, OWL.sameAs, RDF_NIL).hasNext())) {
          list = new RdfList((NonLiteral) value, tc);
        }
      }
    }
View Full Code Here

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

  private void instantiateConceptProviders() {
    conceptProviderList.clear();
    MGraph contentGraph = cgProvider.getContentGraph();

    NonLiteral cplNode = getConceptProviderListNode(contentGraph);
    RdfList cpl = new RdfList(cplNode, contentGraph);
    for (int i = 0; i < cpl.size(); i++) {
      NonLiteral conceptProvider = (NonLiteral) cpl.get(i);
      Iterator<Triple> conceptProviderTypes = contentGraph.filter(
          conceptProvider, RDF.type, null);
      if (conceptProviderTypes.hasNext()) {
        UriRef conceptProviderType = (UriRef) conceptProviderTypes.next().getObject();
        if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
View Full Code Here

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

        CONCEPTS.ConceptProviderList);
    if (triples.hasNext()) {
      return triples.next().getSubject();
    }
    NonLiteral cplNode = new BNode();
    new RdfList(cplNode, contentGraph);
    contentGraph.add(new TripleImpl(cplNode, RDF.type,
        CONCEPTS.ConceptProviderList));
    return cplNode;
  }
View Full Code Here

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

    NonLiteral cplNode = getConceptProviderListNode(contentGraph);
    GraphNode cplGraphNode = new GraphNode(cplNode, contentGraph);
    cplGraphNode.deleteNodeContext();

    cplNode = getConceptProviderListNode(contentGraph);
    RdfList cpl = new RdfList(cplNode, contentGraph);

    int length = types.size();
    for (int i=0; i<length; i++) {
      UriRef conceptProviderType = new UriRef(types.get(i));
      BNode conceptProvider = new BNode();
      contentGraph.add(new TripleImpl(conceptProvider, RDF.type,
          conceptProviderType));
      if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
        contentGraph.add(new TripleImpl(conceptProvider,
            CONCEPTS.selectedScheme,
            new UriRef(conceptSchemes.get(i))));
      } else {
        contentGraph.add(new TripleImpl(conceptProvider,
            CONCEPTS.sparqlEndPoint,
            new UriRef(sparqlEndPoints.get(i))));
        String defaultGraph = defaultGraphs.get(i);
        if (!defaultGraph.trim().isEmpty()) {
          contentGraph.add(new TripleImpl(conceptProvider,
              CONCEPTS.defaultGraph,
              new UriRef(defaultGraph)));
        }
        contentGraph.add(new TripleImpl(conceptProvider,
            CONCEPTS.queryTemplate,
            LiteralFactory.getInstance().createTypedLiteral(
            queryTemplates.get(i))));
      }
      cpl.add(i, conceptProvider);
    }
    instantiateConceptProviders();
    return Response.status(Status.OK).build();
  }
View Full Code Here

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

    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"));
    list.add(new PlainLiteralImpl("third"));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    StringReader reader = new StringReader(
        "${ns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#}" +
        "${loop}${loop}${rdf:value/contains}${/loop}${/loop}");
View Full Code Here

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

  @Test
  public void rdfListAsRoot() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    List<Resource> list = new RdfList(resource, mGraph);
    list.add(new PlainLiteralImpl("first"));
    list.add(new PlainLiteralImpl("second"));
    list.add(new PlainLiteralImpl("third"));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    StringReader reader = new StringReader(
        "${loop}${./contains}${/loop}");
    StringWriter writer = new StringWriter();
View Full Code Here

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

  @Test
  public void rdfListAsRootElementProperties() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    List<Resource> list = new RdfList(resource, mGraph);
    list.add(createLabeledRes("first", mGraph));
    list.add(createLabeledRes("second", mGraph));
    list.add(createLabeledRes("third", mGraph));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    StringReader reader = new StringReader(
        "${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}" +
        "${loop}${loop}${contains/rdfs:label}${/loop}${/loop}");
View Full Code Here

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

  @Test
  public void rdfListAsRootElementPropertiesWithPresenceTest() throws IOException {
    TripleCollection mGraph = new SimpleMGraph();
    NonLiteral resource = new BNode() {
    };
    List<Resource> list = new RdfList(resource, mGraph);
    list.add(createLabeledRes("first", mGraph));
    list.add(createLabeledRes("second", mGraph));
    list.add(createLabeledRes("third", mGraph));
    GraphNode node = new GraphNode(resource, mGraph);
    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    StringReader reader = new StringReader(
        "${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}" +
        "${loop}${if contains/rdfs:label}${contains/rdfs:label}${/if}${/loop}");
View Full Code Here

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

    };

    NonLiteral listNode1 = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDF.value, listNode1));
    List<Resource> list1 = new RdfList(listNode1, mGraph);
    list1.add(new PlainLiteralImpl("first"));
    list1.add(new PlainLiteralImpl("second"));
    list1.add(new PlainLiteralImpl("third"));

    NonLiteral listNode2 = new BNode() {
    };
    mGraph.add(new TripleImpl(resource, RDF.value, listNode2));
    RdfList.createEmptyList(listNode2, mGraph);
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.