jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1496853 - /jena/trunk/jena-sdb/src-dev/java/dev/Main.java
Date Wed, 26 Jun 2013 09:24:00 GMT
Author: andy
Date: Wed Jun 26 09:24:00 2013
New Revision: 1496853

URL: http://svn.apache.org/r1496853
Log:
Remember how to setup an in-memory SDB database.

Modified:
    jena/trunk/jena-sdb/src-dev/java/dev/Main.java

Modified: jena/trunk/jena-sdb/src-dev/java/dev/Main.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-sdb/src-dev/java/dev/Main.java?rev=1496853&r1=1496852&r2=1496853&view=diff
==============================================================================
--- jena/trunk/jena-sdb/src-dev/java/dev/Main.java (original)
+++ jena/trunk/jena-sdb/src-dev/java/dev/Main.java Wed Jun 26 09:24:00 2013
@@ -18,14 +18,33 @@
 
 package dev;
 
-import sdb.sdbquery ;
+import com.hp.hpl.jena.query.Dataset ;
+import com.hp.hpl.jena.sdb.SDBFactory ;
+import com.hp.hpl.jena.sdb.Store ;
+import com.hp.hpl.jena.sparql.core.DatasetGraph ;
+import com.hp.hpl.jena.sparql.core.Quad ;
+import com.hp.hpl.jena.sparql.sse.SSE ;
 
 public class Main
 {
 
     public static void main(String[] args)
     {
-        sdbquery.main("--sdb=sdb.ttl", "--set", "sdb:unionDefaultGraph=true", "SELECT * {
?s ?p ?o }") ;
+        Store store = SDBFactory.connectStore("Store/sdb-hsqldb-mem.ttl") ;
+        store.getTableFormatter().format() ;
+        store.getTableFormatter().addIndexes() ;
+        
+        Dataset ds = SDBFactory.connectDataset(store) ;
+        DatasetGraph dsg = ds.asDatasetGraph() ;
+        Quad quad = SSE.parseQuad("(<g> <s> <p> <o>)") ;
+        dsg.add(quad) ;
+        System.out.println("DONE") ;
+        System.exit(0) ;
+    }
+    
+    public static void main2(String[] args)
+    {
+        sdb.sdbquery.main("--sdb=sdb.ttl", "--set", "sdb:unionDefaultGraph=true", "SELECT
* { ?s ?p ?o }") ;
         //sdbquery.main("--sdb=sdb.ttl", "--set", "http://jena.hpl.hp.com/SDB/symbol#unionDefaultGraph=true",
"SELECT * { ?s ?p ?o }") ;
     }
 



Mime
View raw message