|
From: <mrp...@us...> - 2014-06-01 21:23:44
|
Revision: 8430
http://sourceforge.net/p/bigdata/code/8430
Author: mrpersonick
Date: 2014-06-01 21:23:37 +0000 (Sun, 01 Jun 2014)
Log Message:
-----------
initial commit of Sesame 2.7.12 upgrade - first clean compile
Modified Paths:
--------------
branches/SESAME_2_7/.classpath
branches/SESAME_2_7/bigdata/src/test/com/bigdata/btree/AbstractBTreeTestCase.java
branches/SESAME_2_7/bigdata-gom/src/test/com/bigdata/gom/TestNumericBNodes.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/ntriples/BigdataNTriplesParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestAll_RIO.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/nquads/TestNQuadsParser.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/nquads/TestNQuadsParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/service/TestRemoteSparql10QueryBuilder.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/service/TestRemoteSparql11QueryBuilder.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/service/TestRemoteSparqlBuilderFactory.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTEmptyGroupOptimizer.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/store/TestStatementIdentifiers.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStore.java
branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java
branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepositoryConnection.java
branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConnegUtil.java
branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/BackgroundTupleResult.java
branches/SESAME_2_7/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/sparql/Bigdata2ASTSPARQL11SyntaxTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/sparql/Bigdata2ASTSPARQLSyntaxTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/sparql/TestBigdataExprBuilder.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/sparql/TestSubqueryPatterns.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/sparql/TestVirtualGraphs.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataComplexSparqlQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataConnectionTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataEmbeddedFederationSparqlTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataFederationSparqlTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSPARQLUpdateConformanceTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSPARQLUpdateTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlFullRWTxTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataStoreTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractSimpleInsertTest.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/ProxySuiteHelper.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestBigdataSailRemoteRepository.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestHelper.java
branches/SESAME_2_7/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestSparqlUpdate.java
Added Paths:
-----------
branches/SESAME_2_7/.settings/org.eclipse.core.resources.prefs
branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar
branches/SESAME_2_7/bigdata/lib/junit-4.11.jar
branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar
branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar
branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/SPARQLJSONParserBase.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/SPARQLJSONWriterBase.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/jsonrdf/
branches/SESAME_2_7/bigdata-sails/lib/sesame-sparql-testsuite-2.7.11.jar
branches/SESAME_2_7/bigdata-sails/lib/sesame-store-testsuite-2.7.11.jar
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/ComplexSPARQLQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/manifest/
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/manifest/SPARQLQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/sail/RDFStoreTest.java
Removed Paths:
-------------
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/nquads/NQuadsParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/nquads/NQuadsParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/Att.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/Atts.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/BigdataRDFXMLParser.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/BigdataRDFXMLParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/BigdataRDFXMLWriter.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/BigdataRDFXMLWriterFactory.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/SAXFilter.java
branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/rdfxml/package.html
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestRDFXMLInterchangeWithStatementIdentifiers.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/RDFWriterTest.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/RDFXMLParserTest.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/RDFXMLParserTestCase.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/RDFXMLWriterTest.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/RDFXMLWriterTestCase.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestAll.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestRDFXMLParserFactory.java
branches/SESAME_2_7/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestRDFXMLWriterFactory.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/ComplexSPARQLQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/EarlReport.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQL11SyntaxTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLASTQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLQueryTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLUpdateTest.java
branches/SESAME_2_7/bigdata-sails/src/test/org/openrdf/sail/RDFStoreTest.java
Modified: branches/SESAME_2_7/.classpath
===================================================================
--- branches/SESAME_2_7/.classpath 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/.classpath 2014-06-01 21:23:37 UTC (rev 8430)
@@ -40,7 +40,6 @@
<classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-4.8.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-charset-4.8.jar"/>
- <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-3.8.1.jar" sourcepath="/root/.m2/repository/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/browser.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/classserver.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/fiddler.jar"/>
@@ -76,10 +75,6 @@
<classpathentry exported="true" kind="lib" path="bigdata-sails/lib/httpcomponents/commons-fileupload-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata-sails/lib/httpcomponents/commons-io-2.1.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.17.jar"/>
- <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.6.10-onejar.jar" sourcepath="/Users/bryan/Documents/workspace/org.openrdf.sesame-2.6.10"/>
- <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/sesame-rio-testsuite-2.6.10.jar"/>
- <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.6.10.jar"/>
- <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.6.10.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/nxparser-1.2.3.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-client-9.1.4.v20140401.jar"/>
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-continuation-9.1.4.v20140401.jar"/>
@@ -99,5 +94,11 @@
<classpathentry kind="lib" path="bigdata-blueprints/lib/blueprints-test-2.5.0.jar"/>
<classpathentry kind="lib" path="bigdata-blueprints/lib/rexster-core-2.5.0.jar"/>
<classpathentry kind="lib" path="bigdata-blueprints/lib/commons-configuration-1.10.jar"/>
+ <classpathentry kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar"/>
+ <classpathentry kind="lib" path="bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar"/>
+ <classpathentry kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.7.11.jar" sourcepath="/Users/mikepersonick/.m2/repository/org/openrdf/sesame/sesame-sparql-testsuite/2.7.11/sesame-sparql-testsuite-2.7.11-sources.jar"/>
+ <classpathentry kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.7.11.jar" sourcepath="/Users/mikepersonick/.m2/repository/org/openrdf/sesame/sesame-store-testsuite/2.7.11/sesame-store-testsuite-2.7.11-sources.jar"/>
+ <classpathentry kind="lib" path="bigdata/lib/junit-4.11.jar" sourcepath="/Users/mikepersonick/.m2/repository/junit/junit/4.11/junit-4.11-sources.jar"/>
+ <classpathentry kind="lib" path="bigdata/lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: branches/SESAME_2_7/.settings/org.eclipse.core.resources.prefs
===================================================================
--- branches/SESAME_2_7/.settings/org.eclipse.core.resources.prefs (rev 0)
+++ branches/SESAME_2_7/.settings/org.eclipse.core.resources.prefs 2014-06-01 21:23:37 UTC (rev 8430)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//bigdata-sails/src/test/org/openrdf/repository/RepositoryConnectionTest.java=UTF-8
Property changes on: branches/SESAME_2_7/.settings/org.eclipse.core.resources.prefs
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar
===================================================================
(Binary files differ)
Index: branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar
===================================================================
--- branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar 2014-06-01 21:23:37 UTC (rev 8430)
Property changes on: branches/SESAME_2_7/bigdata/lib/hamcrest-core-1.3.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: branches/SESAME_2_7/bigdata/lib/junit-4.11.jar
===================================================================
(Binary files differ)
Index: branches/SESAME_2_7/bigdata/lib/junit-4.11.jar
===================================================================
--- branches/SESAME_2_7/bigdata/lib/junit-4.11.jar 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata/lib/junit-4.11.jar 2014-06-01 21:23:37 UTC (rev 8430)
Property changes on: branches/SESAME_2_7/bigdata/lib/junit-4.11.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar
===================================================================
(Binary files differ)
Index: branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar
===================================================================
--- branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar 2014-06-01 21:23:37 UTC (rev 8430)
Property changes on: branches/SESAME_2_7/bigdata/lib/mockito-core-1.9.5.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: branches/SESAME_2_7/bigdata/src/test/com/bigdata/btree/AbstractBTreeTestCase.java
===================================================================
--- branches/SESAME_2_7/bigdata/src/test/com/bigdata/btree/AbstractBTreeTestCase.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata/src/test/com/bigdata/btree/AbstractBTreeTestCase.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -1804,16 +1804,16 @@
System.err.println("]");
throw ex;
}
- catch( AssertionFailedError ex ) {
- System.err.println("m="+m);
- System.err.print("keys=[");
- for(int i=0; i<keys.length; i++ ) {
- if( i>0 ) System.err.print(", ");
- System.err.print(keys[order[i]]);
- }
- System.err.println("]");
- throw ex;
- }
+// catch( AssertionFailedError ex ) {
+// System.err.println("m="+m);
+// System.err.print("keys=[");
+// for(int i=0; i<keys.length; i++ ) {
+// if( i>0 ) System.err.print(", ");
+// System.err.print(keys[order[i]]);
+// }
+// System.err.println("]");
+// throw ex;
+// }
if(log.isInfoEnabled())
log.info(btree.getBtreeCounters().toString());
Modified: branches/SESAME_2_7/bigdata-gom/src/test/com/bigdata/gom/TestNumericBNodes.java
===================================================================
--- branches/SESAME_2_7/bigdata-gom/src/test/com/bigdata/gom/TestNumericBNodes.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-gom/src/test/com/bigdata/gom/TestNumericBNodes.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -6,7 +6,6 @@
import org.openrdf.rio.RDFParserRegistry;
import com.bigdata.rdf.axioms.NoAxioms;
-import com.bigdata.rdf.rio.nquads.NQuadsParser;
import com.bigdata.rdf.rio.turtle.BigdataTurtleParser;
import com.bigdata.rdf.store.AbstractTripleStore;
@@ -32,7 +31,7 @@
* Mike,
*
* If you load the attached file into the NSS and then execute
- * bigdata-gom/samples/\xC9/Example1 (or Example2) it will throw an exception
+ * bigdata-gom/samples//Example1 (or Example2) it will throw an exception
* having to do with bnode Ids. This is the issue that David Booth posted
* here [1].
*
Added: branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar
===================================================================
(Binary files differ)
Index: branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar 2014-06-01 21:23:37 UTC (rev 8430)
Property changes on: branches/SESAME_2_7/bigdata-rdf/lib/openrdf-sesame-2.7.11-onejar.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar
===================================================================
(Binary files differ)
Index: branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar 2014-06-01 21:23:37 UTC (rev 8430)
Property changes on: branches/SESAME_2_7/bigdata-rdf/lib/sesame-rio-testsuite-2.7.11.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -32,6 +32,7 @@
import java.util.ServiceLoader;
import org.openrdf.query.QueryLanguage;
+import org.openrdf.query.resultio.TupleQueryResultParserRegistry;
import org.openrdf.query.resultio.TupleQueryResultWriterRegistry;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFParserRegistry;
@@ -39,10 +40,8 @@
import com.bigdata.rdf.model.StatementEnum;
import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONParserFactory;
-import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForConstruct;
-import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForSelect;
+import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory;
import com.bigdata.rdf.rio.ntriples.BigdataNTriplesParserFactory;
-import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory;
import com.bigdata.rdf.rio.turtle.BigdataTurtleParserFactory;
import com.bigdata.rdf.rio.turtle.BigdataTurtleWriterFactory;
@@ -126,7 +125,7 @@
* Allows parsing of JSON SPARQL Results with an {s,p,o,[c]} header.
* RDR-enabled.
*/
- r.add(new BigdataSPARQLResultsJSONParserFactory());
+// r.add(new BigdataSPARQLResultsJSONParserFactory());
}
@@ -134,12 +133,20 @@
final TupleQueryResultWriterRegistry r = TupleQueryResultWriterRegistry.getInstance();
- // add our custom RDR-enabled JSON writer (RDR-enabled)
- r.add(new BigdataSPARQLResultsJSONWriterFactoryForSelect());
+ // add our custom RDR-enabled JSON writer
+ r.add(new BigdataSPARQLResultsJSONWriterFactory());
}
+ {
+
+ final TupleQueryResultParserRegistry r = TupleQueryResultParserRegistry.getInstance();
+ // add our custom RDR-enabled JSON parser
+ r.add(new BigdataSPARQLResultsJSONParserFactory());
+
+ }
+
// Ditto, but for the writer.
{
final RDFWriterRegistry r = RDFWriterRegistry.getInstance();
@@ -150,7 +157,7 @@
r.add(new BigdataTurtleWriterFactory());
// RDR-enabled
- r.add(new BigdataSPARQLResultsJSONWriterFactoryForConstruct());
+// r.add(new BigdataSPARQLResultsJSONWriterFactory());
}
Modified: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -1,5 +1,6 @@
package com.bigdata.rdf.model;
+import java.util.Date;
import java.util.UUID;
import javax.xml.datatype.XMLGregorianCalendar;
@@ -153,6 +154,10 @@
return valueFactory.createLiteral(arg0);
}
+ public BigdataLiteral createLiteral(Date arg0) {
+ return valueFactory.createLiteral(arg0);
+ }
+
public BigdataStatement createStatement(Resource s, URI p, Value o) {
return valueFactory.createStatement(s, p, o);
}
Modified: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -27,6 +27,8 @@
package com.bigdata.rdf.model;
+import java.util.Date;
+
import javax.xml.datatype.XMLGregorianCalendar;
import org.openrdf.model.BNode;
@@ -114,6 +116,8 @@
BigdataLiteral createLiteral(XMLGregorianCalendar arg0);
+ BigdataLiteral createLiteral(Date arg0);
+
BigdataLiteral createLiteral(String label, String language);
BigdataLiteral createLiteral(String label, URI datatype);
Modified: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -27,16 +27,19 @@
package com.bigdata.rdf.model;
+import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.openrdf.model.BNode;
import org.openrdf.model.Literal;
import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.datatypes.XMLDatatypeUtil;
@@ -396,6 +399,18 @@
return new BigdataLiteralImpl(this, "" + arg0, null, xsd_double);
}
+
+ public BigdataLiteralImpl createLiteral(final Date date) {
+ GregorianCalendar c = new GregorianCalendar();
+ c.setTime(date);
+ try {
+ XMLGregorianCalendar xmlGregCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
+ return createLiteral(xmlGregCalendar);
+ }
+ catch (DatatypeConfigurationException e) {
+ throw new RuntimeException("Could not instantiate javax.xml.datatype.DatatypeFactory", e);
+ }
+ }
public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) {
Deleted: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -1,574 +0,0 @@
-/**
-Copyright (C) SYSTAP, LLC 2006-2014. All rights reserved.
-
-Contact:
- SYSTAP, LLC
- 4501 Tower Road
- Greensboro, NC 27410
- lic...@bi...
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-package com.bigdata.rdf.rio.json;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.io.Reader;
-
-import org.apache.log4j.Logger;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.helpers.RDFParserBase;
-
-import com.bigdata.rdf.model.BigdataStatement;
-import com.bigdata.rdf.model.BigdataValueFactory;
-import com.bigdata.rdf.model.BigdataValueFactoryImpl;
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-
-/**
- * RDF parser for JSON SPARQL Results files that have the variables (s, p, o,
- * and optionally c) in the header.
- */
-public class BigdataSPARQLResultsJSONParser extends RDFParserBase {
-
- protected static final transient Logger log =
- Logger.getLogger(BigdataSPARQLResultsJSONParser.class);
-
-
- private LineNumberReader lineReader;
-
- private BigdataValueFactory vf;
-
- /**
- * Default ctor uses a BigdataValueFactory with a namespace of "". Used
- * for testing.
- */
- public BigdataSPARQLResultsJSONParser() {
- this(BigdataValueFactoryImpl.getInstance(""));
- }
-
- /**
- * Construct a parser with the supplied BigdataValueFactory.
- */
- public BigdataSPARQLResultsJSONParser(final BigdataValueFactory vf) {
- super(vf);
-
- this.vf = vf;
- }
-
- /**
- * Set the value factory. Must be a BigdataValueFactory because of the
- * RDR syntax support.
- */
- public void setValueFactory(final ValueFactory vf) {
- if (vf instanceof BigdataValueFactory) {
- this.vf = (BigdataValueFactory) vf;
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * Returns {@link BigdataSPARQLResultsJSONParserFactory#JSON}.
- */
- @Override
- public RDFFormat getRDFFormat() {
-
- return BigdataSPARQLResultsJSONParserFactory.JSON;
-
- }
-
- /**
- * Parse the supplied input stream into RDF.
- */
- @Override
- public void parse(final InputStream is, final String baseURI) throws IOException,
- RDFParseException, RDFHandlerException {
-
- parse(new InputStreamReader(is), baseURI);
-
- }
-
- /**
- * Parse the supplied reader into RDF.
- */
- @Override
- public void parse(final Reader r, final String baseURI) throws IOException,
- RDFParseException, RDFHandlerException {
-
- lineReader = new LineNumberReader(r);
- // Start counting lines at 1:
- lineReader.setLineNumber(1);
-
- // read graph from JSON in request
-
- final JsonFactory factory = new JsonFactory();
-
- final JsonParser parser = factory.createJsonParser(lineReader);
-
-// final JsonParser parser = Json.createParser(lineReader);
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.START_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("head"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.START_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("vars"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.START_ARRAY) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING && !(parser.getCurrentName().equals("s"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING && !(parser.getCurrentName().equals("p"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING && !(parser.getCurrentName().equals("o"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event == JsonToken.VALUE_STRING) {
-
- if (!(parser.getCurrentName().equals("c"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- }
-
- if (event != JsonToken.END_ARRAY) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.END_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("results"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.START_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("bindings"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.START_ARRAY) {
- reportFatalError("unexpected parse event: " + event);
- }
-
-
-// boolean startingBindings = false;
-// boolean breakLoop = false;
-//
-// while (parser.hasNext()) {
-// JsonToken event = parser.nextToken();
-// switch (event) {
-// case START_ARRAY:
-// if (startingBindings)
-// breakLoop = true;
-// case END_ARRAY:
-// case START_OBJECT:
-// case END_OBJECT:
-// case VALUE_FALSE:
-// case VALUE_NULL:
-// case VALUE_TRUE:
-// System.err.println(event.toString());
-// break;
-// case KEY_NAME:
-// if (parser.getString().equals("bindings"))
-// startingBindings = true;
-// System.err.println(event.toString() + " "
-// + parser.getString());
-// break;
-// case VALUE_STRING:
-// case VALUE_NUMBER:
-// System.err.println(event.toString() + " "
-// + parser.getString());
-// break;
-// }
-// if (breakLoop)
-// break;
-// }
-
- rdfHandler.startRDF();
-
- Statement stmt;
- while ((stmt = parseStatement(parser)) != null) {
-
- if (log.isDebugEnabled())
- log.debug(stmt);
-
- rdfHandler.handleStatement(stmt);
-
- }
-
- rdfHandler.endRDF();
-
- }
-
- /**
- * Parse a statement from the JSON stream.
- */
- private final BigdataStatement parseStatement(
- final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event == null || event == JsonToken.END_ARRAY) {
-
- return null;
-
- }
-
- if (event != JsonToken.START_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("s"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final Resource s = (Resource) parseValue(parser);
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("p"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final URI p = (URI) parseValue(parser);
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !(parser.getCurrentName().equals("o"))) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final Value o = parseValue(parser);
-
- event = parser.nextToken();
-
- switch (event) {
- case END_OBJECT:
- return vf.createStatement(s, p, o);
- case FIELD_NAME:
- if (!(parser.getCurrentName().equals("c"))) {
- reportFatalError("unexpected parse event: " + event);
- }
- final Resource c = (Resource) parseValue(parser);
- event = parser.nextToken();
- if (event != JsonToken.END_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
- return vf.createStatement(s, p, o, c);
- default:
- reportFatalError("unexpected parse event: " + event);
- }
-
- // unreachable code
- return null;
-
- }
-
- /**
- * Parse a value from the JSON stream.
- */
- protected Value parseValue(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.START_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("type")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final String type = parser.getText();
-
- Value val = null;
-
- if ("sid".equals(type)) {
-
- val = parseSid(parser);
-
- } else if ("uri".equals(type)) {
-
- val = parseURI(parser);
-
- } else if ("bnode".equals(type)) {
-
- val = parseBNode(parser);
-
- } else if ("literal".equals(type)) {
-
- val = parseLiteral(parser);
-
- } else if ("typed-literal".equals(type)) {
-
- val = parseTypedLiteral(parser);
-
- } else {
-
- reportFatalError("unexpected parse event: " + event);
-
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.END_OBJECT) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return val;
-
- }
-
- /**
- * Parse a sid from the JSON stream.
- */
- protected Value parseSid(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("value")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final BigdataStatement stmt = parseStatement(parser);
-
- return vf.createBNode(stmt);
-
- }
-
- /**
- * Parse a URI from the JSON stream.
- */
- protected Value parseURI(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("value")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return vf.createURI(parser.getText());
-
- }
-
- /**
- * Parse a bnode from the JSON stream.
- */
- protected Value parseBNode(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("value")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return vf.createBNode(parser.getText());
-
- }
-
- /**
- * Parse a plain literal or language-tagged literal from the JSON stream.
- */
- protected Value parseLiteral(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME)
- reportFatalError("unexpected parse event: " + event);
-
- if (parser.getCurrentName().equals("xml:lang")) {
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final String lang = parser.getText();
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("value")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return vf.createLiteral(parser.getText(), lang);
-
- } else if (parser.getCurrentName().equals("value")) {
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return vf.createLiteral(parser.getText());
-
- } else {
-
- reportFatalError("unexpected parse event: " + event);
-
- // unreachable code
- return null;
-
- }
-
- }
-
- /**
- * Parse a typed literal from the JSON stream.
- */
- protected Value parseTypedLiteral(final JsonParser parser)
- throws RDFParseException, JsonParseException, IOException {
-
- JsonToken event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("datatype")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- final URI datatype = vf.createURI(parser.getText());
-
- event = parser.nextToken();
-
- if (event != JsonToken.FIELD_NAME && !parser.getCurrentName().equals("value")) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- event = parser.nextToken();
-
- if (event != JsonToken.VALUE_STRING) {
- reportFatalError("unexpected parse event: " + event);
- }
-
- return vf.createLiteral(parser.getText(), datatype);
-
- }
-
- /**
- * Overrides {@link RDFParserBase#reportFatalError(String)}, adding line
- * number information to the error.
- */
- @Override
- protected void reportFatalError(String msg) throws RDFParseException {
-
- reportFatalError(msg, lineReader.getLineNumber(), -1);
-
- }
-
-
-}
Added: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java (rev 0)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -0,0 +1,198 @@
+/*
+ * Licensed to Aduna under one or more contributor license agreements.
+ * See the NOTICE.txt file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Aduna licenses this file to you under the terms of the Aduna BSD
+ * License (the "License"); you may not use this file except in compliance
+ * with the License. See the LICENSE.txt file distributed with this work
+ * for the full License.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package com.bigdata.rdf.rio.json;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.openrdf.model.Resource;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.QueryResultHandlerException;
+import org.openrdf.query.TupleQueryResultHandler;
+import org.openrdf.query.TupleQueryResultHandlerException;
+import org.openrdf.query.resultio.QueryResultFormat;
+import org.openrdf.query.resultio.QueryResultParseException;
+import org.openrdf.query.resultio.TupleQueryResultFormat;
+import org.openrdf.query.resultio.TupleQueryResultParser;
+
+import com.bigdata.rdf.model.BigdataStatement;
+import com.bigdata.rdf.model.BigdataValueFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+
+/**
+ * Parser for SPARQL-1.1 JSON Results Format documents
+ *
+ * @see <a href="http://www.w3.org/TR/sparql11-results-json/">SPARQL 1.1 Query
+ * Results JSON Format</a>
+ * @author Peter Ansell
+ */
+public class BigdataSPARQLResultsJSONParser extends SPARQLJSONParserBase implements TupleQueryResultParser {
+
+ public static final String STATEMENT = "statement";
+
+ public static final String SUBJECT = "subject";
+
+ public static final String PREDICATE = "predicate";
+
+ public static final String OBJECT = "object";
+
+ public static final String CONTEXT = "context";
+
+ /**
+ * Default constructor.
+ */
+ public BigdataSPARQLResultsJSONParser() {
+ super();
+ }
+
+ /**
+ * Construct a parser with a specific {@link ValueFactory}.
+ *
+ * @param valueFactory
+ * The factory to use to create values.
+ */
+ public BigdataSPARQLResultsJSONParser(ValueFactory valueFactory) {
+ super(valueFactory);
+ }
+
+ @Override
+ public QueryResultFormat getQueryResultFormat() {
+ return getTupleQueryResultFormat();
+ }
+
+ @Override
+ public TupleQueryResultFormat getTupleQueryResultFormat() {
+ return TupleQueryResultFormat.JSON;
+ }
+
+ @Override
+ @Deprecated
+ public void setTupleQueryResultHandler(TupleQueryResultHandler handler) {
+ setQueryResultHandler(handler);
+ }
+
+ @Override
+ @Deprecated
+ public void parse(InputStream in)
+ throws IOException, QueryResultParseException, TupleQueryResultHandlerException
+ {
+ try {
+ parseQueryResultInternal(in, false, true);
+ }
+ catch (TupleQueryResultHandlerException e) {
+ throw e;
+ }
+ catch (QueryResultHandlerException e) {
+ throw new TupleQueryResultHandlerException(e);
+ }
+ }
+
+ protected Value parseValue(final String bindingStr, final JsonParser jp)
+ throws QueryResultParseException, JsonParseException, IOException {
+
+ String lang = null;
+ String type = null;
+ String datatype = null;
+ String value = null;
+
+ // added for Sids support
+ final Map<String, Value> sid = new LinkedHashMap<String, Value>();
+
+ while (jp.nextToken() != JsonToken.END_OBJECT) {
+
+ if (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
+ throw new QueryResultParseException("Did not find value attribute under "
+ + bindingStr + " field", jp.getCurrentLocation().getLineNr(),
+ jp.getCurrentLocation().getColumnNr());
+ }
+ String fieldName = jp.getCurrentName();
+
+ // move to the value token
+ jp.nextToken();
+
+ // set the appropriate state variable
+ if (TYPE.equals(fieldName)) {
+ type = jp.getText();
+ }
+ else if (XMLLANG.equals(fieldName)) {
+ lang = jp.getText();
+ }
+ else if (DATATYPE.equals(fieldName)) {
+ datatype = jp.getText();
+ }
+ else if (VALUE.equals(fieldName)) {
+ value = jp.getText();
+ }
+ // added for Sids support
+ else if (jp.getCurrentToken() == JsonToken.START_OBJECT) {
+ sid.put(fieldName, parseValue(bindingStr, jp));
+ }
+ else {
+ throw new QueryResultParseException("Unexpected field name: " + fieldName,
+ jp.getCurrentLocation().getLineNr(),
+ jp.getCurrentLocation().getColumnNr());
+
+ }
+ }
+
+ // added for Sids support
+ if (type.equals(STATEMENT)) {
+
+ final Resource s = (Resource) sid.get(SUBJECT);
+ final URI p = (URI) sid.get(PREDICATE);
+ final Value o = (Value) sid.get(OBJECT);
+ final Resource c = (Resource) sid.get(CONTEXT);
+
+ if (s == null) {
+ throw new QueryResultParseException("Missing subject for statement: " + bindingStr,
+ jp.getCurrentLocation().getLineNr(),
+ jp.getCurrentLocation().getColumnNr());
+ }
+
+ if (p == null) {
+ throw new QueryResultParseException("Missing predicate for statement: " + bindingStr,
+ jp.getCurrentLocation().getLineNr(),
+ jp.getCurrentLocation().getColumnNr());
+ }
+
+ if (o == null) {
+ throw new QueryResultParseException("Missing object for statement: " + bindingStr,
+ jp.getCurrentLocation().getLineNr(),
+ jp.getCurrentLocation().getColumnNr());
+ }
+
+ final BigdataValueFactory valueFactory =
+ (BigdataValueFactory) super.valueFactory;
+
+ final BigdataStatement stmt = valueFactory.createStatement(s, p, o, c);
+
+ return valueFactory.createBNode(stmt);
+
+ }
+
+ return parseValue(type, value, lang, datatype);
+
+ }
+
+
+}
Property changes on: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParser.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -1,68 +0,0 @@
-/**
-Copyright (C) SYSTAP, LLC 2006-2014. All rights reserved.
-
-Contact:
- SYSTAP, LLC
- 4501 Tower Road
- Greensboro, NC 27410
- lic...@bi...
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-package com.bigdata.rdf.rio.json;
-
-import java.nio.charset.Charset;
-
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.RDFParserFactory;
-import org.openrdf.rio.turtle.TurtleParser;
-
-/**
- * An {@link RDFParserFactory} for Turtle parsers.
- *
- * @author Arjohn Kampman
- * @openrdf
- */
-public class BigdataSPARQLResultsJSONParserFactory implements RDFParserFactory {
-
- public static final RDFFormat JSON = new RDFFormat(
- "JSON", // name
- "application/sparql-results+json", // mime-type
- Charset.forName("UTF-8"), // charset
- "json", // file extension
- false, // supports namespaces
- true // supports contexts
- );
-
- static {
-
- RDFFormat.register(JSON);
-
- }
-
- /**
- * Returns {@link RDFFormat#TURTLE}.
- */
- public RDFFormat getRDFFormat() {
- return JSON;
- }
-
- /**
- * Returns a new instance of {@link TurtleParser}.
- */
- public RDFParser getParser() {
- return new BigdataSPARQLResultsJSONParser();
- }
-}
Added: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java (rev 0)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -0,0 +1,44 @@
+/*
+ * Licensed to Aduna under one or more contributor license agreements.
+ * See the NOTICE.txt file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Aduna licenses this file to you under the terms of the Aduna BSD
+ * License (the "License"); you may not use this file except in compliance
+ * with the License. See the LICENSE.txt file distributed with this work
+ * for the full License.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package com.bigdata.rdf.rio.json;
+
+import org.openrdf.query.resultio.TupleQueryResultFormat;
+import org.openrdf.query.resultio.TupleQueryResultParser;
+import org.openrdf.query.resultio.TupleQueryResultParserFactory;
+
+/**
+ * A {@link TupleQueryResultParserFactory} for parsers of SPARQL-1.1 JSON Tuple
+ * Query Results.
+ *
+ * @author Peter Ansell
+ */
+public class BigdataSPARQLResultsJSONParserFactory implements TupleQueryResultParserFactory {
+
+ /**
+ * Returns {@link TupleQueryResultFormat#JSON}.
+ */
+ public TupleQueryResultFormat getTupleQueryResultFormat() {
+ return TupleQueryResultFormat.JSON;
+ }
+
+ /**
+ * Returns a new instance of {@link SPARQLResultsJSONParser}.
+ */
+ public TupleQueryResultParser getParser() {
+ return new BigdataSPARQLResultsJSONParser();
+ }
+}
Property changes on: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONParserFactory.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java
===================================================================
--- branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-05-30 21:19:57 UTC (rev 8429)
+++ branches/SESAME_2_7/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-06-01 21:23:37 UTC (rev 8430)
@@ -1,475 +0,0 @@
-/*
- * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
- *
- * Licensed under the Aduna BSD-style license.
- */
-package com.bigdata.rdf.rio.json;
-
-import info.aduna.io.IndentingWriter;
-import info.aduna.text.StringUtil;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.resultio.TupleQueryResultFormat;
-import org.openrdf.query.resultio.TupleQueryResultWriter;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFWriter;
-
-import com.bigdata.rdf.model.BigdataBNode;
-import com.bigdata.rdf.model.BigdataStatement;
-
-/**
- * A TupleQueryResultWriter that writes query results in the <a
- * href="http://www.w3.org/TR/rdf-sparql-json-res/">SPARQL Query Results JSON
- * Format</a>.
- */
-public class BigdataSPARQLResultsJSONWriter implements TupleQueryResultWriter, RDFWriter {
-
- /*-----------*
- * Variables *
- *-----------*/
-
- private IndentingWriter writer;
-
- private boolean firstTupleWritten;
-
- /*--------------*
- * Constructors *
- *--------------*/
-
- public BigdataSPARQLResultsJSONWriter(OutputStream out) {
- this(new OutputStreamWriter(out, Charset.forName("UTF-8")));
- }
-
- public BigdataSPARQLResultsJSONWriter(Writer w) {
- w = new BufferedWriter(w, 1024);
- writer = new IndentingWriter(w);
- }
-
- /*---------*
- * Methods *
- *---------*/
-
- /**
- * This is the only method that is different from the OpenRDF version.
- * I could not subclass their implementation because the IndentingWriter
- * is private.
- */
- private void writeValue(Value value)
- throws IOException, TupleQueryResultHandlerException
- {
- writer.write("{ ");
-
- if (value instanceof URI) {
- writeKeyValue("type", "uri");
- writer.write(", ");
- writeKeyValue("value", ((URI)value).toString());
- }
- else if (value instanceof BigdataBNode &&
- ((BigdataBNode) value).isStatementIdentifier()) {
-
-// "bindings": [
-// {
-// "book": { "type": "uri" , "value": "http://example.org/book/book6" } ,
-// "title": { "type": "literal" , "value": "Harry Potter and the Half-Blood Prince" }
-// } ,
-// {
-// "book": { "type": "sid" , "value":
-// {
-// "s": { "type": "uri" , "value": "<s>" } ,
-// "p": { "type": "uri" , "value": "<p>" } ,
-// "o": { "type": "uri" , "value": "<o>" }
-// }
-// }
-// "title": { "type": "literal" , "value": "Harry Potter and the Deathly Hallows" }
-// } ,
-
- final BigdataBNode bnode = (BigdataBNode) value;
- final BigdataStatement stmt = bnode.getStatement();
- writeKeyValue("type", "sid");
- writer.write(", ");
- writeKey("value");
- openBraces();
- writeKeyValue("s", stmt.getSubject());
- writeComma();
- writeKeyValue("p", stmt.getPredicate());
- writeComma();
- writeKeyValue("o", stmt.getObject());
-
- if (stmt.getContext() != null) {
- writeComma();
- writeKeyValue("c", stmt.getContext());
- }
- closeBraces();
-
- }
- else if (value instanceof BNode) {
- writeKeyValue("type", "bnode");
- writer.write(", ");
- writeKeyValue("value", ((BNode)value).getID());
- }
- else if (value instanceof Literal) {
- Literal lit = (Literal)value;
-
- if (lit.getDatatype() != null) {
- writeKeyValue("type", "typed-literal");
- writer.write(", ");
- writeKeyValue("datatype", lit.getDatatype().toString());
- }
- else {
- writeKeyValue("type", "literal");
- if (lit.getLanguage() != null) {
- writer.write(", ");
- writeKeyValue("xml:lang", lit.getLanguage());
- }
- }
-
- writer.write(", ");
- writeKeyValue("value", lit.getLabel());
- }
- else {
- throw new TupleQueryResultHandlerException("Unknown Value object type: " + value.getClass());
- }
-
- writer.write(" }");
- }
-
-
- public final TupleQueryResultFormat getTupleQueryResultFormat() {
- return TupleQueryResultFormat.JSON;
- }
-
- public void startQueryResult(List<String> columnHeaders)
- throws TupleQueryResultHandlerException
- {
- try {
- openBraces();
-
- // Write header
- writeKey("head");
- openBraces();
- writeKeyValue("vars", columnHeaders);
- closeBraces();
-
- writeComma();
-
- // Write results
- writeKey("results");
- openBraces();
-
- writeKey("bindings");
- openArray();
-
- firstTupleWritten = false;
- }
- catch (IOException e) {
- throw new TupleQueryResultHandlerException(e);
- }
- }
-
- public void endQueryResult()
- throws TupleQueryResultHandlerException
- {
- try {
- closeArray(); // bindings array
- closeBraces(); // results braces
- closeBraces(); // root braces
- writer.flush();
- }
- catch (IOException e) {
- throw new TupleQueryResultHandlerException(e);
- }
- }
-
- public void handleStatement(final Statement stmt) throws RDFHandlerException
- {
- try {
- if (firstTupleWritten) {
- writeComma();
- }
- else {
- firstTupleWritten = true;
- }
-
- openBraces(); // start of new solution
-
- writeKeyValue("s", stmt.getSubject());
- writeComma();
- writeKeyValue("p", stmt.getPredicate());
- writeComma();
- writeKeyValue("o", stmt.getObject());
- if (stmt.getContext() != null) {
- writeComma();
- writeKeyValue("c", stmt.getContext());
- }
-
-// Iterator<Binding> bindingIter = bindingSet.iterator();
-// while (bindingIter.hasNext()) {
-// Binding binding = bindingIter.next();
-//
-// writeKeyValue(binding.getName(), binding.getValue());
-//
-// if (bindingIter.hasNext()) {
-// writeComma();
-// }
-// }
-
- closeBraces(); // end solution
-
- writer.flush();
- }
- catch (TupleQueryResultHandlerException e) {
- throw new RDFHandlerException(e);
- }
- catch (IOException e) {
- throw new RDFHandlerException(e);
- }
- }
-
- public void handleSolution(BindingSet bindingSet)
- throws TupleQueryResultHandlerException
...
[truncated message content] |