You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/08/15 22:28:08 UTC

svn commit: r1373616 - in /jena/Scratch/AFS/Jena-Dev/trunk: U.ru dwim

Author: andy
Date: Wed Aug 15 20:28:07 2012
New Revision: 1373616

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

Modified:
    jena/Scratch/AFS/Jena-Dev/trunk/U.ru
    jena/Scratch/AFS/Jena-Dev/trunk/dwim

Modified: jena/Scratch/AFS/Jena-Dev/trunk/U.ru
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/U.ru?rev=1373616&r1=1373615&r2=1373616&view=diff
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/U.ru (original)
+++ jena/Scratch/AFS/Jena-Dev/trunk/U.ru Wed Aug 15 20:28:07 2012
@@ -1,14 +1,18 @@
 BASE <http://example/> 
 
+CLEAR ALL 
+;
 INSERT DATA { <s> <p> <o> GRAPH <g1> { <s1> <p1> <o1> }  GRAPH <g2> { <s2> <p2> <o2> } }
 ;
 
+## DELETE { ?s ?p ?o } 
 ## INSERT { ?s ?p ?o }
 ## #USING NAMED <g1>
 ## USING <g2>
-## WHERE { GRAPH ?g {?s ?p ?o } }
+## WHERE { ?s ?p ?o }
+## ;
 
-DELETE { ?s ?p ?o }
+INSERT { ?s ?p ?o }
 USING NAMED <g1>
 # USING <g2>
-WHERE { ?s ?p ?o }
+WHERE { GRAPH ?g { ?s ?p ?o } }

Modified: jena/Scratch/AFS/Jena-Dev/trunk/dwim
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/dwim?rev=1373616&r1=1373615&r2=1373616&view=diff
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/dwim (original)
+++ jena/Scratch/AFS/Jena-Dev/trunk/dwim Wed Aug 15 20:28:07 2012
@@ -4,47 +4,64 @@
 
 update()
 {
-  R="$1"
-  curl -s -d "$R" 'http://localhost:3030/ds/update'
+    R="$1"
+    curl -s -d "$R" 'http://localhost:3030/ds/update'
 }
 
 query()
 {
-   Q="$1"
-   curl -s -d "query=$Q&output=text" http://localhost:3030/ds/query
+    Q="$1"
+    curl -s -d "query=$Q&output=text" http://localhost:3030/ds/query
 }
 
+dump()
+{
+    query 'SELECT * {?s ?p ?o}'
+}
+
+dumpAll()
+{
+    query 'SELECT * { {?s ?p ?o} UNION { GRAPH ?g { ?s ?p ?o } } }'
+}
 
 # Setup
 update 'request=CLEAR ALL' 'http://localhost:3030/ds/update' > /dev/null
 
-update 'request=INSERT DATA { GRAPH <g1> { <s1> <p1> <o1> }  GRAPH <g2> { <s2> <p2> <o2> } }' \
-   'http://localhost:3030/ds/update' \
-   > /dev/null
+update 'request=INSERT DATA { <s> <p> <o> GRAPH <g1> { <s1> <p1> <o1> }  GRAPH <g2> { <s2> <p2> <o2> } }' \
+   'http://localhost:3030/ds/update' > /dev/null
 
 # Query
 echo "==== setup"
-query 'SELECT * {?s ?p ?o}'
+dumpAll
 echo
 
 ## # INSERT using-graph-uri
-## echo "Insert dft->dft using-graph-uri=g"
-## curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { ?s ?p ?o }' 'http://localhost:3030/ds/update?using-graph-uri=http://example/base/g'  > /dev/null
+echo "Insert dft->dft using-graph-uri=g"
+curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { ?s ?p ?o }' 'http://localhost:3030/ds/update?using-graph-uri=http://example/base/g'  > /dev/null
+dump
+echo
+
 
 # no action
+echo "==== using-named g2, GRAPH g1"
 curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { GRAPH <g1> { ?s ?p ?o }}' 'http://localhost:3030/ds/update?using-named-graph-uri=http://example/base/g2'  > /dev/null
+dump
+echo
 
 # no action
+echo "==== using g2, GRAPH g1"
 curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { GRAPH <g1> { ?s ?p ?o }}' 'http://localhost:3030/ds/update?using-graph-uri=http://example/base/g2'  > /dev/null
-
-
-# Query
-curl -s -d 'query=SELECT * {?s ?p ?o}&output=text' http://localhost:3030/ds/query
+dump
+echo
 
 # Only g1.
+echo "==== using-named g1, GRAPH ?g"
 curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { GRAPH ?g { ?s ?p ?o }}' 'http://localhost:3030/ds/update?using-named-graph-uri=http://example/base/g1'  > /dev/null
+dump
+echo
 
-
-
-# Query
-curl -s -d 'query=SELECT * {?s ?p ?o}&output=text' http://localhost:3030/ds/query
+# Only g2.
+echo "==== using g2 {}"
+curl -s -d 'request=INSERT { ?s ?p ?o } WHERE { ?s ?p ?o }' 'http://localhost:3030/ds/update?using-graph-uri=http://example/base/g2'  > /dev/null
+dump
+echo