jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1355757 - in /jena/Scratch/AFS/Dev/trunk/src-dev/sparql: AlgebraGenerator2.java MainAlg.java
Date Sat, 30 Jun 2012 16:06:50 GMT
Author: andy
Date: Sat Jun 30 16:06:49 2012
New Revision: 1355757

URL: http://svn.apache.org/viewvc?rev=1355757&view=rev
Log: (empty)

Removed:
    jena/Scratch/AFS/Dev/trunk/src-dev/sparql/AlgebraGenerator2.java
Modified:
    jena/Scratch/AFS/Dev/trunk/src-dev/sparql/MainAlg.java

Modified: jena/Scratch/AFS/Dev/trunk/src-dev/sparql/MainAlg.java
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Dev/trunk/src-dev/sparql/MainAlg.java?rev=1355757&r1=1355756&r2=1355757&view=diff
==============================================================================
--- jena/Scratch/AFS/Dev/trunk/src-dev/sparql/MainAlg.java (original)
+++ jena/Scratch/AFS/Dev/trunk/src-dev/sparql/MainAlg.java Sat Jun 30 16:06:49 2012
@@ -18,24 +18,44 @@
 
 package sparql;
 
+import org.openjena.atlas.junit.BaseTest ;
+import org.openjena.atlas.lib.StrUtils ;
+
 import com.hp.hpl.jena.query.Query ;
 import com.hp.hpl.jena.query.QueryFactory ;
+import com.hp.hpl.jena.query.Syntax ;
+import com.hp.hpl.jena.sparql.algebra.AlgebraGenerator ;
 import com.hp.hpl.jena.sparql.algebra.Op ;
 
-public class MainAlg
+public class MainAlg extends BaseTest 
 {
 
     public static void main(String[] args)
     {
-        String qs = "SELECT * { ?s ?p ?o }" ;
-        Query query = QueryFactory.create(qs) ;
-        AlgebraGenerator2 gen = new AlgebraGenerator2() ;
+        dwim("?s ?p ?o OPTIONAL{?s ?p2 ?o2} BIND(5 AS ?o99)") ;
         
-        Op op = gen.compile(query) ;
-        System.out.println(op) ;
         System.out.println("DONE") ;
         System.exit(0) ;
     }
+    
+    static int counter = 0 ;
+    
+    static void dwim(String... x)
+    {
+        String qs = StrUtils.strjoinNL(x) ;
+        //qs = "PREFIX : <http://example/>\nSELECT *{\n"+qs+"\n}" ;
+        qs = "SELECT * {\n"+qs+"\n}" ;
+        
+        Query query = QueryFactory.create(qs, Syntax.syntaxARQ) ;
+        System.out.println(query) ;
+        AlgebraGenerator gen = new AlgebraGenerator() ;
+        
+        Op op = gen.compile(query) ;
+        System.out.print(op) ;
+        System.out.println("-------------------------------") ;
+        
+    }
+    
 
 }
 



Mime
View raw message