本文整理汇总了Java中org.apache.jena.riot.system.StreamRDF.triple方法的典型用法代码示例。如果您正苦于以下问题:Java StreamRDF.triple方法的具体用法?Java StreamRDF.triple怎么用?Java StreamRDF.triple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.riot.system.StreamRDF
的用法示例。
在下文中一共展示了StreamRDF.triple方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enrich
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
@Override
public void enrich(StreamRDF stream, Node match) {
if (match.isURI()) {
Resource r = rdf.getResource( match.getURI() );
if (enrichDescribe) {
Model description = Closure.closure(r, false);
ExtendedIterator<Triple> it = description.getGraph().find(null, null, null);
while (it.hasNext()) {
stream.triple(it.next());
}
} else {
for (Property p : enrich) {
for (StmtIterator si = r.listProperties(p); si.hasNext(); ) {
stream.triple( si.next().asTriple() );
}
}
}
}
}
示例2: fetch
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
public Value fetch(String...strings) {
ConverterProcess proc = ConverterProcess.get();
String uri = asURI();
Model model = proc.fetchModel(uri);
if (model != null) {
StreamRDF out = proc.getOutputStream();
for (String puri : strings) {
puri = proc.getDataContext().getPrefixes().expandPrefix(puri);
Node p = NodeFactory.createURI(puri);
Node s = NodeFactory.createURI(uri );
ExtendedIterator<Triple> it = model.getGraph().find(s, p, null);
while (it.hasNext()) {
out.triple(it.next());
}
}
}
return this;
}
示例3: InferenceProcessorStreamRDF
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
public InferenceProcessorStreamRDF(final StreamRDF output, InferenceSetupRDFS rdfsSetup) {
super(output) ;
this.rdfsSetup = rdfsSetup ;
this.rdfs = new InferenceEngineRDFS(rdfsSetup, null) {
@Override
public void derive(Node s, Node p, Node o) {
if ( isTriple )
output.triple(Triple.create(s, p, o)) ;
else
output.quad(Quad.create(g, s, p, o)) ;
}
} ;
}
示例4: injectRefTimeTriples
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
protected void injectRefTimeTriples() {
StreamRDF out = ConverterProcess.get().getOutputStream();
ExtendedIterator<Triple> it = getRefTime().getModel().getGraph().find(null, null, null);
while (it.hasNext()) {
out.triple(it.next());
}
}
示例5: shouldPassThroughTriples
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
@Test public void shouldPassThroughTriples() {
StreamRDF dedup = new StreamRDFDedup(new MockStreamRDF());
dedup.start();
dedup.triple(triple("<a> <a> <a>"));
dedup.triple(triple("<b> <b> <b>"));
dedup.triple(triple("<c> <c> <c>"));
dedup.finish();
assertEquals(triples("<a> <a> <a>", "<b> <b> <b>", "<c> <c> <c>"), received);
}
示例6: shouldRemoveDuplicateInWindow
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
@Test public void shouldRemoveDuplicateInWindow() {
StreamRDF dedup = new StreamRDFDedup(new MockStreamRDF());
dedup.start();
dedup.triple(triple("<a> <a> <a>"));
dedup.triple(triple("<a> <a> <a>"));
dedup.finish();
assertEquals(triples("<a> <a> <a>"), received);
}
示例7: shouldNotRemoveDuplicateOutsideWindow
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
@Test public void shouldNotRemoveDuplicateOutsideWindow() {
StreamRDF dedup = new StreamRDFDedup(new MockStreamRDF(), 2);
dedup.start();
dedup.triple(triple("<a> <a> <a>"));
dedup.triple(triple("<b> <b> <b>"));
dedup.triple(triple("<a> <a> <a>"));
dedup.triple(triple("<c> <c> <c>"));
dedup.triple(triple("<a> <a> <a>"));
dedup.finish();
assertEquals(triples("<a> <a> <a>", "<b> <b> <b>", "<c> <c> <c>", "<a> <a> <a>"), received);
}
示例8: emitAll
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
private void emitAll(StreamRDF stream, StmtIterator si) {
while (si.hasNext()) {
stream.triple( si.nextStatement().asTriple() );
}
}
示例9: read
import org.apache.jena.riot.system.StreamRDF; //导入方法依赖的package包/类
private void read(Item item, String baseURI, ContentType ct, StreamRDF output, Context context) {
Graph graph = BuilderGraph.buildGraph(item) ;
Iterator<Triple> iter = graph.find(null, null, null) ;
for ( ; iter.hasNext() ; )
output.triple(iter.next()) ;
}