String dir = "testing/Assembler/" ;
Model assem = FileManager.get().loadModel(dir+"graph-assembler.ttl") ;
Resource xDft = assem.getResource("http://example/test#graphDft") ;
Resource xNamed = assem.getResource("http://example/test#graphNamed") ;
Store store = create(assem) ;
Model model1 = (Model)Assembler.general.open(xDft) ;
Model model2 = (Model)Assembler.general.open(xNamed) ;
Resource s = model1.createResource() ;
Property p = model1.createProperty("http://example/p") ;
Literal o = model1.createLiteral("foo") ;
model1.add(s,p,o) ;
System.out.println(model1.contains(s, p, o)) ;
System.out.println("----") ;
model1.write(System.out, "TTL") ;
System.out.println("----") ;
model2.write(System.out, "TTL") ;
System.out.println("----") ;
model1.size() ;
System.out.println("Size 1 : "+model1.size()) ;
System.out.println("Size 2 : "+model2.size()) ;
// System.out.println("model1:") ;
// StmtIterator sIter1 = model1.listStatements() ;
// for ( ; sIter1.hasNext() ; )
// System.out.println(sIter1.next()) ;
//
// System.out.println("model2:") ;
// StmtIterator sIter2 = model1.listStatements() ;
// for ( ; sIter2.hasNext() ; )
// System.out.println(sIter2.next()) ;
System.out.println((model1.isIsomorphicWith(model2))) ;
System.exit(0) ;
}
{
//sdb.sdbconfig.main("--sdb=sdb.ttl", "--create") ;
//sdb.sdbprint.main("--sdb=sdb.ttl", "select * where { GRAPH<G> { ?s ?p ?o}} limit 5") ;
sdb.sdbprint.main("--sdb=sdb.ttl", "--file=Q.rq") ;
System.exit(0) ;
}
{
// Make sure the database is created but empty first.
String modelName = "http://example/g1" ;
Store store = SDBFactory.connectStore("sdb.ttl") ;
// Update.
Dataset dataset = SDBFactory.connectDataset(store);
Model model = SDBFactory.connectNamedModel(store, modelName);
FileManager.get().readModel(model, "D.ttl") ;
Iterator<String> modelNameIterator = dataset.listNames();
for ( ; modelNameIterator.hasNext() ; )
{
System.out.println("Model: "+modelNameIterator.next()) ;
}
System.out.println("1 -----") ;
model.write(System.out, "N-TRIPLES") ;
System.out.println("-----") ;
model.removeAll() ;
System.out.println("2 -----") ;
model.write(System.out, "N-TRIPLES") ;
System.out.println("-----") ;
store.close() ;
store = SDBFactory.connectStore("sdb.ttl") ;
dataset = SDBFactory.connectDataset(store);
modelNameIterator = dataset.listNames();
for ( ; modelNameIterator.hasNext() ; )
{
System.out.println("Model: "+modelNameIterator.next()) ;
}
model = SDBFactory.connectNamedModel(store, modelName);
System.out.println("3 -----") ;
model.write(System.out, "N-TRIPLES") ;
System.out.println("-----") ;
System.exit(0) ;
}
// sdb.sdbtest.main("--sdb=sdb.ttl", "testing/manifest-sdb.ttl") ;
// System.exit(0) ;
//TestStores2Connections1.main(argv) ;
runPrint("Q.rq") ; System.exit(0) ;
{
// SPARQL/Update
Store store = SDBTestUtils.createInMemoryStore() ;
GraphStore gs = SDBFactory.connectGraphStore(store) ;
UpdateAction.readExecute("update.ru", gs) ;
Iter<Node> iter = Iter.iter(gs.listGraphNodes()) ;