本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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 ;
}
示例7: freshQuad
import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
static Quad freshQuad() {
return SSE.parseQuad("(_ :s :p '"+DateTimeUtils.nowAsXSDDateTimeString()+"'^^xsd:dateTimeStamp)");
}
示例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);
}
}
示例9: quad
import org.apache.jena.sparql.sse.SSE; //导入方法依赖的package包/类
private static Quad quad() { return SSE.parseQuad("(_ :s :p "+(counter++)+")"); }