Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.TripleCollection.addAll()


      NonLiteral languageUri = (NonLiteral) languageDescription.getResource().getNode();
      list.add(languageUri);
      if (copyToNode) {
        readLock.lock();
        try {
          graph.addAll(new GraphNode(languageUri, configGraph).getNodeContext());
        } finally {
          readLock.unlock();
        }
      }
    }
View Full Code Here


    TripleCollection mGraph = new SimpleMGraph();
    final Parser parser = Parser.getInstance();

    try {
      Graph deserializedGraph = parser.parse(getClass().getResourceAsStream("libby-foaf.rdf"), "application/rdf+xml");
      mGraph.addAll(deserializedGraph);
      UriRef document = new UriRef("http://swordfish.rdfweb.org/people/libby/rdfweb/webwho.xrdf");

      Assert.assertTrue((mGraph.size() > 0));

      GraphNode node = new GraphNode(document, mGraph);
View Full Code Here

    TripleCollection mGraph = new SimpleMGraph();
    final Parser parser = Parser.getInstance();

    try {
      Graph deserializedGraph = parser.parse(getClass().getResourceAsStream("libby-foaf.rdf"), "application/rdf+xml");
      mGraph.addAll(deserializedGraph);
      UriRef document = new UriRef("http://swordfish.rdfweb.org/people/libby/rdfweb/webwho.xrdf");

      Assert.assertTrue((mGraph.size() > 0));

      GraphNode node = new GraphNode(document, mGraph);
View Full Code Here

    } catch (NoSuchEntityException nsee) {
      tc = tcManager.createMGraph(graphName);
      InputStream fin = null;
      fin = getClass().getResourceAsStream("data.turtle");
      Parser parser = Parser.getInstance();
      tc.addAll(parser.parse(fin, "text/turtle"));
    }
  }
}
View Full Code Here

      if (additionalExpansionRes.size() == 0) {
        return result;
      }
      for (Resource resource : additionalExpansionRes) {
        final GraphNode additionalNode = new GraphNode(resource, node.getGraph());
        result.addAll(additionalNode.getNodeContext());
        expandedResources.add(resource);
      }
    }
  }
View Full Code Here

    Parser parser = Parser.getInstance();
    Graph deserializedGraphOld = parser.parse(
        getClass().getResourceAsStream(inputFileName), format);

    TripleCollection tc = new SimpleMGraph();
    tc.addAll(deserializedGraphOld);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ssp.serialize(baos, tc, "text/rdf+nt");

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here

    Parser parser = Parser.getInstance();
    Graph deserializedGraphOld = parser.parse(
        getClass().getResourceAsStream(inputFileName), format);

    TripleCollection tc = new SimpleMGraph();
    tc.addAll(deserializedGraphOld);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    nts.serialize(baos, tc);

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here

    Parser parser = Parser.getInstance();
    Graph tc1 = parser.parse(
        getClass().getResourceAsStream("documentation-example.nt"), SupportedFormat.N_TRIPLE);
    final Set<String> lines1 = serializeToLines(tc1);
    TripleCollection tc2 = new SimpleMGraph();
    tc2.addAll(tc1);
    //add <bundle:///intro> <http://clerezza.org/2009/08/documentation#after> <bundle://org.apache.clerezza.platform.documentation/intro> .
    tc2.add(new TripleImpl(new UriRef("bundle:///intro"),
        new UriRef("http://clerezza.org/2009/08/documentation#after"),
        new UriRef("bundle://org.apache.clerezza.platform.documentation/intro")));
    final Set<String> lines2 = serializeToLines(tc2);
View Full Code Here

  }

  private List<MSG> decomposeGraphToMSGs(TripleCollection tc) {

    TripleCollection tmp = new SimpleMGraph();
    tmp.addAll(tc);

    List<MSG> msgSet = new LinkedList<MSG>();

    while (tmp.size() > 0) {
      Triple triple = tmp.iterator().next();
View Full Code Here

            if (additionalExpansionRes.size() == 0) {
                return result;
            }
            for (Resource resource : additionalExpansionRes) {
                final GraphNode additionalNode = new GraphNode(resource, node.getGraph());
                result.addAll(additionalNode.getNodeContext());
                expandedResources.add(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.