Package org.apache.clerezza.rdf.core.impl

Examples of org.apache.clerezza.rdf.core.impl.SimpleMGraph.addAll()


      Resource object = triple.getObject();
      if (object instanceof BNode) {
        BNode bNodeObject = (BNode) object;
        if (!dontExpand.contains(bNodeObject)) {
          dontExpand.add(bNodeObject);
          result.addAll(getContextOf(bNodeObject, dontExpand, graph));
        }
      }
    }
    Iterator<Triple> backwardProperties = graph.filter(null, null, node);
    while (backwardProperties.hasNext()) {
View Full Code Here


      NonLiteral subject = triple.getSubject();
      if (subject instanceof BNode) {
        BNode bNodeSubject = (BNode) subject;
        if (!dontExpand.contains(bNodeSubject)) {
          dontExpand.add(bNodeSubject);
          result.addAll(getContextOf(bNodeSubject, dontExpand, graph));
        }
      }
    }
    return result;
  }
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

      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

        Triple triple = forwardProperties.next();
        result.add(triple);
        Resource object = triple.getObject();
        if (acceptor.expand(object) && !dontExpand.contains(object)) {
          dontExpand.add(object);
          result.addAll(getContextOf(object, dontExpand, acceptor));
        }
      }
    }
    Iterator<Triple> backwardProperties = graph.filter(null, null, node);
    while (backwardProperties.hasNext()) {
View Full Code Here

      Triple triple = backwardProperties.next();
      result.add(triple);
      NonLiteral subject = triple.getSubject();
      if (acceptor.expand(subject) && !dontExpand.contains(subject)) {
        dontExpand.add(subject);
        result.addAll(getContextOf(subject, dontExpand, acceptor));
      }
    }
    return result;
  }
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

    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

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.