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 2011/11/13 20:04:03 UTC
svn commit: r1201476 - in /incubator/jena/Jena2/SDB/trunk: Q.rq
bin/make_classpath_mvn bin/sdb_path
src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java
Author: andy
Date: Sun Nov 13 19:04:03 2011
New Revision: 1201476
URL: http://svn.apache.org/viewvc?rev=1201476&view=rev
Log:
Check for a dataset description (not supported currently).
Align to ARQ tidying up.
Added:
incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn (with props)
Modified:
incubator/jena/Jena2/SDB/trunk/Q.rq
incubator/jena/Jena2/SDB/trunk/bin/sdb_path
incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java
Modified: incubator/jena/Jena2/SDB/trunk/Q.rq
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/Q.rq?rev=1201476&r1=1201475&r2=1201476&view=diff
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/Q.rq (original)
+++ incubator/jena/Jena2/SDB/trunk/Q.rq Sun Nov 13 19:04:03 2011
@@ -1,26 +1,8 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX acm: <http://example/acm>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-# DESCRIBE ?s WHERE {
-SELECT ?s WHERE
+SELECT ?s
+FROM <http://example/>
+WHERE
{
-GRAPH ?g {
-?s rdf:type <http://m3t4.com/ont/ACM#Account>.
-?s acm:lastActivityDate '2010-09-01T05:00:00Z'^^xsd:dateTime.
-?s acm:sicCode ?v2. ?s acm:closeDate '2010-09-07T05:00:00Z'^^xsd:dateTime.
-?s acm:merchantNumber '234567123'^^xsd:string.
-?s acm:taxOrGovtId ?v5.
-?s acm:openDate '2010-09-07T05:00:00Z'^^xsd:dateTime.
-?s acm:doingBusinessAsName ?v7.
-?s acm:accountNumber ?v8.
-FILTER (?v1 < '2010-09-01T05:00:00Z'^^xsd:dateTime)
-FILTER regex(?v2, "4000", "i" )
-FILTER (?v3 < '2010-09-07T05:00:00Z'^^xsd:dateTime)
-FILTER regex(?v5, "500", "i" )
-FILTER (?v6 < '2010-09-07T05:00:00Z'^^xsd:dateTime)
-FILTER regex(?v7, "Doing_Business_01", "i" )
-FILTER regex(?v8, "23432245756", "i" )
-}
}
Added: incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn?rev=1201476&view=auto
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn (added)
+++ incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn Sun Nov 13 19:04:03 2011
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+DIRROOT="$1"
+
+if [ "$DIRROOT" = "" ]
+then
+ echo "No directory given" 1>&2
+ exit 1
+ fi
+
+M2_REPO="${M2_REPO:-$HOME/.m2/repository}" ;
+X=$(perl -ne 'next unless /\spath="M2_REPO([^"]*)"/s ; print "$1","\n"' $DIRROOT/.classpath)
+
+CP=
+for x in $X
+do
+ CP="$CP:$M2_REPO$x"
+done
+
+[ -e "classes" ] && CP="$DIRROOT/classes$CP"
+[ -e "target/classes" ] && CP="$DIRROOT/target/classes$CP"
+
+echo "$CP"
+
Propchange: incubator/jena/Jena2/SDB/trunk/bin/make_classpath_mvn
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/jena/Jena2/SDB/trunk/bin/sdb_path
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/bin/sdb_path?rev=1201476&r1=1201475&r2=1201476&view=diff
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/bin/sdb_path (original)
+++ incubator/jena/Jena2/SDB/trunk/bin/sdb_path Sun Nov 13 19:04:03 2011
@@ -1,5 +1,7 @@
#!/bin/bash
+
+
if [ "$SDBROOT" = "" ]
then
echo "SDBROOT not set" 1>&2
@@ -7,4 +9,12 @@ then
fi
export CP="$SDB_CP"
-exec "$SDBROOT/bin/make_classpath" "$SDBROOT"
+
+if [ ! -e "$SDBROOT/lib/jena-sdb*" ]
+then
+ CP="$($SDBROOT/bin/make_classpath_mvn "$SDBROOT")"
+else
+ CP="$($SDBROOT/bin/make_classpath "$SDBROOT")"
+fi
+
+echo $CP
Modified: incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java?rev=1201476&r1=1201475&r2=1201476&view=diff
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java (original)
+++ incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/engine/QueryEngineSDB.java Sun Nov 13 19:04:03 2011
@@ -24,11 +24,13 @@ import org.slf4j.LoggerFactory;
import com.hp.hpl.jena.query.ARQ;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.sdb.SDB ;
+import com.hp.hpl.jena.sdb.SDBException ;
import com.hp.hpl.jena.sdb.Store;
import com.hp.hpl.jena.sdb.compiler.SDBCompile;
import com.hp.hpl.jena.sdb.compiler.OpSQL;
import com.hp.hpl.jena.sdb.core.SDBRequest;
import com.hp.hpl.jena.sdb.store.DatasetStoreGraph;
+import com.hp.hpl.jena.sparql.ARQConstants ;
import com.hp.hpl.jena.sparql.algebra.Algebra;
import com.hp.hpl.jena.sparql.algebra.Op;
import com.hp.hpl.jena.sparql.algebra.Transformer;
@@ -83,7 +85,16 @@ public class QueryEngineSDB extends Quer
private void init(DatasetStoreGraph dsg, Query query, Binding initialBinding, Context context)
{
if ( context == null )
- context = ARQ.getContext() ;
+ context = ARQ.getContext().copy() ;
+ // See "DynamicDatasets" -- this could be enabled.
+ if ( query != null )
+ {
+ if ( query.hasDatasetDescription() )
+ throw new SDBException("Queries with dataset descriptions (FROM/FROM NAMED) not supported" ) ;
+ }
+ if ( context.isDefined(ARQConstants.sysDatasetDescription) )
+ throw new SDBException("Queries with dataset descriptions set in the context not supported" ) ;
+
this.store = dsg.getStore() ;
this.request = new SDBRequest(store, query, context) ;
this.originalOp = getOp() ;