当前位置: 首页>>代码示例>>Java>>正文


Java StreamRDF.triple方法代码示例

本文整理汇总了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() ); 
                }
            }
        }
    } 
}
 
开发者ID:epimorphics,项目名称:dclib,代码行数:20,代码来源:RDFMapSource.java

示例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;
}
 
开发者ID:epimorphics,项目名称:dclib,代码行数:19,代码来源:ValueBase.java

示例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)) ;
        }
    } ;
}
 
开发者ID:afs,项目名称:jena-inf-engine,代码行数:14,代码来源:InferenceProcessorStreamRDF.java

示例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());
    }
}
 
开发者ID:epimorphics,项目名称:dclib,代码行数:8,代码来源:ValueDate.java

示例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);
}
 
开发者ID:tarql,项目名称:tarql,代码行数:10,代码来源:StreamRDFDedupTest.java

示例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);
}
 
开发者ID:tarql,项目名称:tarql,代码行数:9,代码来源:StreamRDFDedupTest.java

示例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);
}
 
开发者ID:tarql,项目名称:tarql,代码行数:12,代码来源:StreamRDFDedupTest.java

示例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() );
    }
}
 
开发者ID:UKGovLD,项目名称:registry-core,代码行数:6,代码来源:StoreBaseImpl.java

示例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()) ;
}
 
开发者ID:xcurator,项目名称:xcurator,代码行数:7,代码来源:ExRIOT_5.java


注:本文中的org.apache.jena.riot.system.StreamRDF.triple方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。