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


Java SSE.parseQuad方法代码示例

本文整理汇总了Java中org.apache.jena.sparql.sse.SSE.parseQuad方法的典型用法代码示例。如果您正苦于以下问题:Java SSE.parseQuad方法的具体用法?Java SSE.parseQuad怎么用?Java SSE.parseQuad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jena.sparql.sse.SSE的用法示例。


在下文中一共展示了SSE.parseQuad方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: changeSuppressEmptyCommit_4

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test public void changeSuppressEmptyCommit_4() {
    Quad q = SSE.parseQuad("(_ :s :p 'object')");
    Triple t = SSE.parseTriple("(:t :p 'object')");
    
    Txn.executeRead(dsg,   ()->{});
    testCounters(counter.summary(), 0, 0);
    
    Txn.executeWrite(dsg,  ()->{dsg.add(q);});
    testCounters(counter.summary(), 1, 0);

    Txn.executeWrite(dsg,  ()->{dsg.getDefaultGraph().add(t);});
    testCounters(counter.summary(), 2, 0);
    
    Txn.executeWrite(dsg,  ()->{dsg.getDefaultGraph().getPrefixMapping().setNsPrefix("", "http://example/");});
    testCounters(counter.summary(), 2, 1);
    
    Txn.executeWrite(dsg,  ()->{});
    testCounters(counter.summary(), 2, 1);
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:20,代码来源:TestRDFChangesCancel.java

示例2: update_3

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test
public void update_3() {
    // Create on the Delta link then setup DeltaClient
    DeltaLink dLink = getLink();
    String DS_NAME = "12345";
    
    Id dsRef = dLink.newDataSource(DS_NAME, "http://example/datasource_update_3");
    DeltaClient dClient = createDeltaClient();
    dClient.register(dsRef, LocalStorageType.MEM, TxnSyncPolicy.NONE);
    DeltaConnection dConn = dClient.get(DS_NAME);
    Quad quad = SSE.parseQuad("(_ :s :p :o)");
    DatasetGraph dsg = dConn.getDatasetGraph();

    long x0 = Txn.calculateRead(dsg, ()->Iter.count(dsg.find()) );
    assertEquals(0, x0);
    
    dsg.begin(ReadWrite.WRITE);
    dsg.add(quad);
    dsg.abort();
    
    long x1 = Txn.calculateRead(dsg, ()->Iter.count(dsg.find()) );
    assertEquals(0, x1);
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:24,代码来源:AbstractTestDeltaClient.java

示例3: update_1

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test
public void update_1() {
    // Create on the Delta link then setup DeltaClient
    DeltaLink dLink = getLink();
    String DS_NAME = "123";
    
    Id dsRef = dLink.newDataSource(DS_NAME, "http://example/datasource_update_1");
    DeltaClient dClient = createDeltaClient();
    dClient.register(dsRef, LocalStorageType.MEM, TxnSyncPolicy.NONE);
    DeltaConnection dConn = dClient.get(DS_NAME);
    assertNotNull(dConn);
    assertEquals(0, dConn.getLocalVersion());
    assertEquals(0, dConn.getRemoteVersionLatest());
    
    Quad quad = SSE.parseQuad("(_ :s :p :o)");
    DatasetGraph dsg = dConn.getDatasetGraph();
    long x0 = Iter.count(dsg.find());
    assertEquals(0, x0);
    dsg.add(quad);
    
    long x1 = Iter.count(dsg.find());
    assertEquals(1, x1);
    
    long x2 = Iter.count(dConn.getStorage().find());
    assertEquals(1, x1);

}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:28,代码来源:AbstractTestDeltaClient.java

示例4: update_2

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test
public void update_2() {
    // Create on the Delta link then setup DeltaClient
    DeltaLink dLink = getLink();
    String DS_NAME = "1234";
    
    Id dsRef = dLink.newDataSource(DS_NAME, "http://example/datasource_update_2");
    DeltaClient dClient = createDeltaClient();
    dClient.register(dsRef, LocalStorageType.MEM, TxnSyncPolicy.NONE);
    DeltaConnection dConn = dClient.get(DS_NAME);
    assertNotNull(dConn);
    assertEquals(0, dConn.getLocalVersion());
    assertEquals(0, dConn.getRemoteVersionLatest());
    
    Quad quad = SSE.parseQuad("(_ :s :p :o)");
    DatasetGraph dsg = dConn.getDatasetGraph();

    long x0 = Txn.calculateRead(dsg, ()->Iter.count(dsg.find()) );
    assertEquals(0, x0);
    
    Txn.executeWrite(dsg, ()->dsg.add(quad));
    long x1 = Txn.calculateRead(dsg, ()->Iter.count(dsg.find()) );
    assertEquals(1, x1);
    
    long x2 = Iter.count(dConn.getStorage().find());
    assertEquals(1, x1);
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:28,代码来源:AbstractTestDeltaClient.java

示例5: zone_03

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test public void zone_03() {
    assertTrue(zone.localConnections().isEmpty());
    DatasetGraph dsgBase = DatasetGraphFactory.createTxnMem();
    String NAME = "ABC"; 
    Id dsRef = createExternal(NAME, dsgBase);
    assertFalse(zone.localConnections().isEmpty());
    Quad quad = SSE.parseQuad("(_ :s :p :o)");
    try(DeltaConnection dConn = deltaClient.get(dsRef)) {
        DatasetGraph dsg  = dConn.getDatasetGraph();
        Txn.executeWrite(dsg, ()->dsg.add(quad)); 
    }
    // read log.
    PatchLogInfo info = deltaLink.getPatchLogInfo(dsRef);
    assertEquals(1, info.getMaxVersion());
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:16,代码来源:TestZone.java

示例6: setup

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
/** Example setup - in-memory dataset with two graphs, one triple in each */
private static Dataset setup()
{
    Dataset ds = TDBFactory.createDataset() ;
    DatasetGraph dsg = ds.asDatasetGraph() ;
    Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)") ;
    Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)") ;
    dsg.add(q1) ;
    dsg.add(q2) ;
    return ds ;
}
 
开发者ID:xcurator,项目名称:xcurator,代码行数:12,代码来源:ExQuadFilter.java

示例7: freshQuad

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
static Quad freshQuad() {
    return SSE.parseQuad("(_ :s :p '"+DateTimeUtils.nowAsXSDDateTimeString()+"'^^xsd:dateTimeStamp)");
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:4,代码来源:DeltaTestLib.java

示例8: change_empty_commit_1

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
@Test
public void change_empty_commit_1() {
    Quad q = SSE.parseQuad("(:g :s :p :o)") ;
    String NAME = "change_empty_commit_1";
    DeltaClient dClient = createRegister(NAME);
    try(DeltaConnection dConn = dClient.get(NAME)) {
        
        Id patchId0 = dConn.getRemoteIdLatest();
        assertNull(patchId0);
        long ver0 = dConn.getRemoteVersionLatest();
        
        // The "no empty commits" dsg
        DatasetGraph dsg = dConn.getDatasetGraphNoEmpty();
        
        Txn.executeWrite(dsg, ()->{});
        Id patchId1 = dConn.getLatestPatchId();
        long ver1 = dConn.getRemoteVersionLatest();
        // No change at start of log.
        assertEquals(patchId0, patchId1);
        assertEquals(ver0, ver1);
        
        Txn.executeWrite(dsg, ()->dsg.add(q));
        Id patchId2 = dConn.getLatestPatchId();
        long ver2 = dConn.getRemoteVersionLatest();
        assertNotEquals(patchId0, patchId2);
        assertNotEquals(ver0, ver2);
        
        DatasetGraph dsgx = dConn.getDatasetGraph();
        Txn.executeWrite(dsgx, ()->{});
        Id patchId3 = dConn.getLatestPatchId();
        long ver3 = dConn.getRemoteVersionLatest();
        assertNotEquals(patchId2, patchId3);
        assertNotEquals(ver2, ver3);
        
        // No change mid log.
        Txn.executeWrite(dsg, ()->Iter.count(dsg.find()));
        Id patchId4 = dConn.getLatestPatchId();
        long ver4 = dConn.getRemoteVersionLatest();
        assertEquals(patchId3, patchId4);
        assertEquals(ver3, ver4);
        
    }
}
 
开发者ID:afs,项目名称:rdf-delta,代码行数:44,代码来源:AbstractTestDeltaConnection.java

示例9: quad

import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
private static Quad quad() { return SSE.parseQuad("(_ :s :p "+(counter++)+")"); } 
开发者ID:afs,项目名称:rdf-delta,代码行数:2,代码来源:TestRestart.java


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