本文整理汇总了Java中org.apache.jena.sparql.core.Quad.create方法的典型用法代码示例。如果您正苦于以下问题:Java Quad.create方法的具体用法?Java Quad.create怎么用?Java Quad.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.sparql.core.Quad
的用法示例。
在下文中一共展示了Quad.create方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionAdd
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Override
protected void actionAdd(Node g, Node s, Node p, Node o) {
// add/delete (Quad) creates churn.
if ( checking && get().contains(g,s,p,o) )
return ;
Quad quad = Quad.create(g, s, p, o) ;
if ( addQuads.add(quad) )
deleteQuads.remove(quad) ;
}
示例2: actionDelete
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Override
protected void actionDelete(Node g, Node s, Node p, Node o) {
if ( checking && ! get().contains(g,s,p,o) )
return ;
Quad quad = Quad.create(g, s, p, o) ;
if ( deleteQuads.add(quad) )
addQuads.remove(quad) ;
}
示例3: asGeneralizedQuad
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Test
public void asGeneralizedQuad() throws Exception {
final Node s = NodeFactory.createLiteral("Hello");
final Node p = NodeFactory.createBlankNode();
final Node o = NodeFactory.createURI("http://example.com/ex");
final Node g = Quad.defaultGraphIRI;
final Quad jq = Quad.create(g, s, p, o);
final JenaQuadLike<RDFTerm> q = jena.asGeneralizedQuad(jq);
assertEquals(jena.createLiteral("Hello"), q.getSubject());
assertEquals(jena.asRDFTerm(p), q.getPredicate());
assertEquals(jena.createIRI("http://example.com/ex"), q.getObject());
assertFalse(q.getGraphName().isPresent());
}
示例4: defaultGraphIRI
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Test
public void defaultGraphIRI() throws Exception {
final Quad jenaQuad = Quad.create(Quad.defaultGraphIRI, exampleJena, exampleJena, exampleJena);
final JenaQuad q = rdf.asQuad(jenaQuad);
assertFalse(q.getGraphName().isPresent());
assertTrue(q.asJenaQuad().isDefaultGraph());
}
示例5: defaultGraphNodeGenerated
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Test
public void defaultGraphNodeGenerated() throws Exception {
// <urn:x-arq:DefaultGraphNode> might appear in parser output
final Quad jenaQuad = Quad.create(Quad.defaultGraphNodeGenerated, exampleJena, exampleJena, exampleJena);
final JenaQuad q = rdf.asQuad(jenaQuad);
assertFalse(q.getGraphName().isPresent());
assertTrue(q.asJenaQuad().isDefaultGraph());
// Preserves <urn:x-arq:DefaultGraphNode>
assertEquals(Quad.defaultGraphNodeGenerated, q.asJenaQuad().getGraph());
}
示例6: unionGraph
import org.apache.jena.sparql.core.Quad; //导入方法依赖的package包/类
@Test
public void unionGraph() throws Exception {
// unionGraph shouldn't really appear as a quad except
// in a pattern
final Quad jenaQuad = Quad.create(Quad.unionGraph, exampleJena, exampleJena, exampleJena);
final JenaQuad q = rdf.asQuad(jenaQuad);
// But at least we can agree it is NOT (necessarily) in the
// default graph
assertFalse(q.asJenaQuad().isDefaultGraph());
assertTrue(q.getGraphName().isPresent());
}