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


Java Quad.create方法代码示例

本文整理汇总了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) ;
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:10,代码来源:DatasetGraphBuffering.java

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

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

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

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

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


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