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/07 14:55:24 UTC
svn commit: r1198737 [1/2] - in
/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src: dev/ fm2/ fm2/atlas/
fm2/jenautil/ opexec/ reports/ reports/archive/
Author: andy
Date: Mon Nov 7 13:55:23 2011
New Revision: 1198737
URL: http://svn.apache.org/viewvc?rev=1198737&view=rev
Log:
Clean up.
Modified:
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/AllTestsARQ.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DSG_Notify.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevARQ.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevTDB.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/IsomorphoricResultSets.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ModelReadCloseTest.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena102_TDBstats.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena142_VarScopeBind.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena143_TDBConcurrency.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena149_Duration.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena154_GraphVarScope.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Run.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunARQ.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunBase.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunHTTP.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/TransformPropertyPathFlatten.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/TestFileManager.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocationMapper.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/Locator.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocatorClassLoader.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocatorFile.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocatorURL.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocatorZip.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/StreamManager.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/TS_IO2.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/TestLocationMapper.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/TestLocators.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/TestStreamManager.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/jenautil/FileManager2.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/jenautil/JenaIOEnvironment.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/opexec/OpExecutorExample.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/ReportParsingDurations.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/ReportPerformanceIN.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportAnyURI.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportAssignSubstitute.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportDBPedia2.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportDuplicateBNodes.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportGraphBind.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportPathCycles.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportReifierRemove.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportRemoteService.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportRemoteVirtuoso.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportServiceVarRename.java
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/ReportSlowDatatype.java
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/AllTestsARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/AllTestsARQ.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/AllTestsARQ.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/AllTestsARQ.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -16,8 +16,8 @@
* limitations under the License.
*/
-package dev;
-
+package dev;
+
import junit.framework.TestSuite ;
import com.hp.hpl.jena.query.ARQ ;
@@ -27,48 +27,48 @@ import com.hp.hpl.jena.sparql.engine.ref
import com.hp.hpl.jena.sparql.expr.E_Function ;
import com.hp.hpl.jena.sparql.expr.NodeValue ;
import com.hp.hpl.jena.sparql.junit.ScriptTestSuiteFactory ;
-
-/** All tests - the main test suite and also the examples tests */
-public class AllTestsARQ extends TestSuite
-{
- /*====================
- * Eclipse: Some ARQ tests are also DAWG tests (and so have same name)
- * This confused JUnit/Eclipse but it seems to be safe and they are all run.
- *====================
- */
-
- static public TestSuite suite()
- {
- // Fiddle around with the config if necessary
- if ( false )
- {
- QueryEngineMain.unregister() ;
- QueryEngineRef.register() ;
- }
-
- TestSuite ts = new AllTestsARQ() ;
-
- // Main test suite
- // This is the test suite run by maven.
- ts.addTest(ARQTestSuite.suite()) ;
-
- /*
- * The test count here and maven differ
- * Example are not part of the mvn testing process
- */
-
- // Scripted tests for ARQ examples.
- ts.addTest(ScriptTestSuiteFactory.make(ARQTestSuite.testDirARQ+"/Examples/manifest.ttl")) ;
- return ts ;
- }
-
- private AllTestsARQ()
- {
- super("ARQ");
- ARQ.init() ;
- // Tests should be silent.
- NodeValue.VerboseWarnings = false ;
- E_Function.WarnOnUnknownFunction = false ;
- }
-
+
+/** All tests - the main test suite and also the examples tests */
+public class AllTestsARQ extends TestSuite
+{
+ /*====================
+ * Eclipse: Some ARQ tests are also DAWG tests (and so have same name)
+ * This confused JUnit/Eclipse but it seems to be safe and they are all run.
+ *====================
+ */
+
+ static public TestSuite suite()
+ {
+ // Fiddle around with the config if necessary
+ if ( false )
+ {
+ QueryEngineMain.unregister() ;
+ QueryEngineRef.register() ;
+ }
+
+ TestSuite ts = new AllTestsARQ() ;
+
+ // Main test suite
+ // This is the test suite run by maven.
+ ts.addTest(ARQTestSuite.suite()) ;
+
+ /*
+ * The test count here and maven differ
+ * Example are not part of the mvn testing process
+ */
+
+ // Scripted tests for ARQ examples.
+ ts.addTest(ScriptTestSuiteFactory.make(ARQTestSuite.testDirARQ+"/Examples/manifest.ttl")) ;
+ return ts ;
+ }
+
+ private AllTestsARQ()
+ {
+ super("ARQ");
+ ARQ.init() ;
+ // Tests should be silent.
+ NodeValue.VerboseWarnings = false ;
+ E_Function.WarnOnUnknownFunction = false ;
+ }
+
}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DSG_Notify.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DSG_Notify.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DSG_Notify.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DSG_Notify.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevARQ.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevARQ.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevARQ.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -16,300 +16,300 @@
* limitations under the License.
*/
-package dev ;
-
-
-public class DevARQ
+package dev ;
+
+
+public class DevARQ
{
- // RIOT : Add combining charcaters to prefix name acceptance after first character.
- // BIO: Table = vars list and the bindings.
-
- // Assembly configuration: <appendAssemblyId>false</appendAssemblyId>
-
- // FILTER(?x=?y) optimization - at least FILTER(sameTerm(?x,?y))
- // FILTER(?x=<x> && ...) does not push down on the ?x=<x>
- // Do FILTER placement before filter equality -- but dnager of breaking up BGPs.
-
- // riot.out.SinkTripleOutput and BufferingWriter : respect encoder
- // Escaping characters by policy.
- // EscapePolicy(Writer, String)
- // See also OutputLangUtils -- extract code and deletes
- // Make an object so it can have per-instance flags
- // ASCII vs UTF-8
- // Abbreviate numbers or not.
- // Avoids creating intermediate strings.
- // == Class with two subclasses. Turtle policy and N-triples policy.
-
- // Automatically create graphs for in-memorry update.
- // DatasetFactory.create() ; returns an auto-add dataset.
- // and UpdateAction.execute (request, model) has a fixed datset of one graph.
+ // RIOT : Add combining charcaters to prefix name acceptance after first character.
+ // BIO: Table = vars list and the bindings.
+
+ // Assembly configuration: <appendAssemblyId>false</appendAssemblyId>
+
+ // FILTER(?x=?y) optimization - at least FILTER(sameTerm(?x,?y))
+ // FILTER(?x=<x> && ...) does not push down on the ?x=<x>
+ // Do FILTER placement before filter equality -- but dnager of breaking up BGPs.
+
+ // riot.out.SinkTripleOutput and BufferingWriter : respect encoder
+ // Escaping characters by policy.
+ // EscapePolicy(Writer, String)
+ // See also OutputLangUtils -- extract code and deletes
+ // Make an object so it can have per-instance flags
+ // ASCII vs UTF-8
+ // Abbreviate numbers or not.
+ // Avoids creating intermediate strings.
+ // == Class with two subclasses. Turtle policy and N-triples policy.
+
+ // Automatically create graphs for in-memorry update.
+ // DatasetFactory.create() ; returns an auto-add dataset.
+ // and UpdateAction.execute (request, model) has a fixed datset of one graph.
// Cache scoping calculations in Ops
// Track sort order
// Systematic use of variable allocators (content? global?)
-
- // QueryEngineHTTP - content negotiation, Apache httpClient.
-
- // Langbase - calls EventManager.send... but Turtle prefixes done after (read is not finished)
- // JenaReaderRIOT to do the event?
- // One token call to Tokenizer.parse -- Replace SSE.parseNode stuff.
-
- // Split pom into:
- // downloadmaker
- // Everything else.
-
- // Rework documentation - extensions are now SPARQL 1.1-isms
- // Update library function page
-
- // Config assembler.
- // [ arq:queryTimeout "123" ]
- // vs:
- // [ ja:feature arq:queryTimeout ; ja:value "123" ]
- // [ ja:feature "arq:queryTimeout" ; ja:value "123" ]
- // Allows non-URIs more easily.
- // ja:feature "arq:queryTimeout=123"
-
- // In-memory query to use reordering.
-
- // Timeout: content info -
- // set in QueryExecutionBase constructor
- // (or QueryExecutionFactory.make(Query query, Dataset dataset, Context context))
- // 1/ copy in dataset context earlier, not in QueryEngineMain.setupContext
- // 2/ Move to QueryExecutionBase constructor.
-
- // 18.
-
- // OpExecutor example.
- // Datasetfactory.create() -> autocreate graphs?
-
- // Optimization: remember (some!) query executions because index-join causes a lot of repeats.
-
- // ---- Projects
- // * FileManager2
- // Tests - need testing/Atlas/... or tmp/
- // Work out what to keep from FileUtils.
- // FileUtils2.
- // ?? WebContent to work on ContentTypes, not strings. (what about default charsets?)
-
- // * Generalized union query
- // DatasetGraph to understand union graph name
- // * Generalized dynamic datasets
- // Union graph (OpExecutor.specialcase)
- // Named defaut graph (OpExecutor.specialcase)
- // Pull up from TDB - DynamicDatasets (quads and BGPs and paths)
-
- // * RIOT Output
- // * RIOT I/O architecture
- // Hard wired N-Triples/N-Quads parser. LangNTriples2 - Tokenize for N-triples tokens only.
- // NT-Perf next:
- // TokenizerText seems to be nearly as fast a LangNTriples4 so where is the time going in RIOT?
- // Particularly Node literals.
- // ** Node creation 125KTPS with, 200KTPS without.
- // ** LangNTriples4 265K
-
- // DynamicDS
- // Reverted to dataset rewrite. See [[DynDS]] in QueryEngineTDB and QueryUnionRead
- // Migrate to ARQ.
- // Pass a graph up to be the active graph of the QueryExecution -> change to QueryEngineMain.
- // Does not work for: FROM <urn:x-arq:DefaultGraph> FROM <urn:x-arq:UnionGraph>
- // Have a magic dataset implementation that can hold hidden graphs (i.e. not is listNodes but show in getGraph)
- // Propagate <urn:x-arq:DefaultGraph> FROM <urn:x-arq:UnionGraph>
- // OpExecutor in ARQ need "specialcase" fixing.??
-
- // Dataset which allows graph to be added around an undelying dataset.
-
- // symUnionDefaultGraph and DESCRIBE
- // Example with query timeout.
-
- // Configuration generally.
- // Via assemblers ==?
- // Via a global file.
-
- /*
- JSON CONSTRUCT {
- { ?name: [ ?lat, ?long ] }
- }
- WHERE {
- ?x rdfs:label ?name ;
- geo:lat ?lat ;
- geo:long ?long ;
- }
- */
- // MIME type negotiation for QueryEngineHTTP.execSelect.
-
- // ---- RIOT
- // Parallel parser
- // Extract public API (RiotReader etc) - document
- // Closing InputStream
- // Errors after file name! Print file name once if error.
- // Recovery parsing - scan to DOT?
-
- // riot --inputLabels -> use input labels
- // input choices: normal(generate), preserve labels, decoded safe to internal.
- // output choices: normal(short label _:b0), preserve (if input = perserve => same else safe internal), safe internal, raw (illegal)
- // Safe needs to be smarter?
- // Tests
-
- // riot --canonicalize --normalize
- // riot --bnodeIRIs=on|off
- // riot --rdfs
-
- // Canonicalize
- // IRIs - corect, best %-encoding
- // Numbers to decimals, not integers (not default!)
-
- // ----
- // Listners for dadaset changes -> drive LARQ.
-
- // SPARQL parser; reuse charstream objects? using Reinit()
- // JavaCharStream allocates a 4k char buffer on every call.
- // Pool of parsers.
-
- // OpTopN - OpExecutor.execute(OpTop).
- // BSBM Explore/Update
- // Remote SPARQL Update
-
- // Mem dataset with union graph
- // Union graph for all in query execution sequence.
- // ** Documentation - assemblers for datasets
- // qExec.getContext().set(TDB.symUnionDefaultGraph, true) ;
-
- // HTTP result set iterator to know when it's closed.
-
- // OpExecute example.
-
- // More test in DatasetGraphTests
- // Rename Quad.defaultGraphIRI?
- // Parsers use: Quad.defaultGraphNodeGenerated
- // Should find/4 do the same? Via:
- // DatasetGraphBase.triples2quadsDftGraph
-
- // SSE - move to RIOT based tokenizer.
- // TokenizeText:
- // Just STRING, no CNTL=>KEYWORD = Symbol, catchall Keyword/Symbol
-
- // Apache codec.
-
- // .filemanager
- // FileUtils, TypedStream conversion.
- // Check use of FileUtils.
-
- // >>>> Tasks
-
- // Algebra.asUnionQuery .. to access the functionality
-
- // Path evaluation as per spec.
- // tdbloader2; filenames.
-
- // ?? bNode label checks (UPDATE: can't use same bNode label in template and pattern for DELETE/INSERT.)
-
- // Pull up TransformDynamicDataset, TransformGraphRename from TDB.
- // ---- Union Transform
- // Tests for unionTransformation
- // TestUnionTransformTriples
- // TestUnionTransformQuads
- // TestUnionGraph
- // ** Enable in TS_Algebra.
-
- // Better access to union query???
- // By transform, query context.
- // Version for tru=iples evaluation (TransformUnionQuery) and quads evaluation (A2 from TDB)
- // Document - move from TDB
-
- // <<<< Tasks
-
- // QueryParseException for updates is confusing.
- // All QueryException -> SparqlException or LanguageParseException
-
- // Prologure from RIOT
- // PrefixMap from RIOT
-
- // Migrations/enable:
- // TransformUnionQuery
- // TransformDynamicDataset
- // TransformGraphRename
- // TransformPropertyPathFlatten
-
- // ---- Documentation
- // Downplay: PathLib.install.
- // Legacy StageGenerator (http://openjena.org/ARQ/arq-query-eval.html)
- // src-examples of OpExecutor+QueryEngine
- // http://www.openjena.org/wiki/ARQ/Concurrency
- // add qparse,uparse to wiki/ARQ/
- // Documentation for CSV etc.
- // Supported types
-
- // DatasetGraph : connections
-
- // Event type -> list of parts vs regex filtering (?)
- // Base 64 :: Apache commons codec.
-
- // ---- SPARQL 1.1
- // Update: can't use same bNode label in template and pattern for DELETE/INSERT.
- // BINDINGS execution
- // Aggregates to return iterators.
-
- // Property path rewrites as per spec (i.e. earlier than evaluation)
-
- // ---- Pipeline:
- // Architecture:
- // Canonicalization: Fix URIs. () [] SPC
- // Canonicaize IRIs (see IRI RFC). http://tools.ietf.org/html/rfc3986#page-38 (IRI missing in lib!)
- // De-% unreserved characters.
- // Number canonicalization.
- // Always to decimal?
- // Canonicalized lang tags?
- // owl:equivalentClass, owl:equivalentProperty,
- // owl:inverseOf, owl:SymmetricProperty, owl:TransitiveProperty
- // rdfs:subClassOf (aux table).
- // rdfs:subPropertyOf (aux table).
-
- // ---- Events.
- // Hierarchy.
-
- // ---- "ARQ 3"
- // Minor changes that break compatible in some way
- // -- Custom functions
- // E_Function intercepts at evalSpecial to maintain compatibility.
- // Should really change Function.eval to strict functions (eval'ed arguments and no binding).
-
- // XSDDuration
-
- // ---- Commands
- // --data to accept TriG and N-Quads
-
- // Result set isomorphism - need backtracking
-
- // Syntax for lists: LIST(?list, ?index, ?member)
-
- // ---- Core
- // Memory DatasetGraph to support Quad.unionGraph, defaultGraph and
-
- // ---- Expr
- // Scalar and column expressions
-
- // ---- Union transformation
- // Transform rewrites BGP to (graph ?_ bgp)
- // Transform rewrites QuadBlock to (graph ?_ bgp)
- // Implicit default graph and named union.
- // Next:
- // ** (graph <unionGraph> BGP) rewrites the BGP but leaves the (graph
- // <union> ...) wrapper.
- // ==> (graph <unionGraph> (distinct (graph ?_ bgp)))
- // More runtime processing and less transformation?
- // Or just strip (graph <union> ...) on the way past.
-
- // ---- Build
- // Build: use maven resources for the etching of version.
-
- // ---- Optimization
- // 1/ Enable sameTermString optimization
- // 2/ If an equality is repeated do once only.
- // 3/ Amalgamation: BGPs, Quads, Sequences.
- // 4/ Assign squashing : assign as rename. (assign ((?x ?y)))
- // 5/ Optimise FILTER(?x=?y) assuming ?x and ?y must be bound.
-
- // ---- MicroAPI.
- // QueryBuilder.
- // results = query().select(vars).pattern().filter().groupBy().agg()
+
+ // QueryEngineHTTP - content negotiation, Apache httpClient.
+
+ // Langbase - calls EventManager.send... but Turtle prefixes done after (read is not finished)
+ // JenaReaderRIOT to do the event?
+ // One token call to Tokenizer.parse -- Replace SSE.parseNode stuff.
+
+ // Split pom into:
+ // downloadmaker
+ // Everything else.
+
+ // Rework documentation - extensions are now SPARQL 1.1-isms
+ // Update library function page
+
+ // Config assembler.
+ // [ arq:queryTimeout "123" ]
+ // vs:
+ // [ ja:feature arq:queryTimeout ; ja:value "123" ]
+ // [ ja:feature "arq:queryTimeout" ; ja:value "123" ]
+ // Allows non-URIs more easily.
+ // ja:feature "arq:queryTimeout=123"
+
+ // In-memory query to use reordering.
+
+ // Timeout: content info -
+ // set in QueryExecutionBase constructor
+ // (or QueryExecutionFactory.make(Query query, Dataset dataset, Context context))
+ // 1/ copy in dataset context earlier, not in QueryEngineMain.setupContext
+ // 2/ Move to QueryExecutionBase constructor.
+
+ // 18.
+
+ // OpExecutor example.
+ // Datasetfactory.create() -> autocreate graphs?
+
+ // Optimization: remember (some!) query executions because index-join causes a lot of repeats.
+
+ // ---- Projects
+ // * FileManager2
+ // Tests - need testing/Atlas/... or tmp/
+ // Work out what to keep from FileUtils.
+ // FileUtils2.
+ // ?? WebContent to work on ContentTypes, not strings. (what about default charsets?)
+
+ // * Generalized union query
+ // DatasetGraph to understand union graph name
+ // * Generalized dynamic datasets
+ // Union graph (OpExecutor.specialcase)
+ // Named defaut graph (OpExecutor.specialcase)
+ // Pull up from TDB - DynamicDatasets (quads and BGPs and paths)
+
+ // * RIOT Output
+ // * RIOT I/O architecture
+ // Hard wired N-Triples/N-Quads parser. LangNTriples2 - Tokenize for N-triples tokens only.
+ // NT-Perf next:
+ // TokenizerText seems to be nearly as fast a LangNTriples4 so where is the time going in RIOT?
+ // Particularly Node literals.
+ // ** Node creation 125KTPS with, 200KTPS without.
+ // ** LangNTriples4 265K
+
+ // DynamicDS
+ // Reverted to dataset rewrite. See [[DynDS]] in QueryEngineTDB and QueryUnionRead
+ // Migrate to ARQ.
+ // Pass a graph up to be the active graph of the QueryExecution -> change to QueryEngineMain.
+ // Does not work for: FROM <urn:x-arq:DefaultGraph> FROM <urn:x-arq:UnionGraph>
+ // Have a magic dataset implementation that can hold hidden graphs (i.e. not is listNodes but show in getGraph)
+ // Propagate <urn:x-arq:DefaultGraph> FROM <urn:x-arq:UnionGraph>
+ // OpExecutor in ARQ need "specialcase" fixing.??
+
+ // Dataset which allows graph to be added around an undelying dataset.
+
+ // symUnionDefaultGraph and DESCRIBE
+ // Example with query timeout.
+
+ // Configuration generally.
+ // Via assemblers ==?
+ // Via a global file.
+
+ /*
+ JSON CONSTRUCT {
+ { ?name: [ ?lat, ?long ] }
+ }
+ WHERE {
+ ?x rdfs:label ?name ;
+ geo:lat ?lat ;
+ geo:long ?long ;
+ }
+ */
+ // MIME type negotiation for QueryEngineHTTP.execSelect.
+
+ // ---- RIOT
+ // Parallel parser
+ // Extract public API (RiotReader etc) - document
+ // Closing InputStream
+ // Errors after file name! Print file name once if error.
+ // Recovery parsing - scan to DOT?
+
+ // riot --inputLabels -> use input labels
+ // input choices: normal(generate), preserve labels, decoded safe to internal.
+ // output choices: normal(short label _:b0), preserve (if input = perserve => same else safe internal), safe internal, raw (illegal)
+ // Safe needs to be smarter?
+ // Tests
+
+ // riot --canonicalize --normalize
+ // riot --bnodeIRIs=on|off
+ // riot --rdfs
+
+ // Canonicalize
+ // IRIs - corect, best %-encoding
+ // Numbers to decimals, not integers (not default!)
+
+ // ----
+ // Listners for dadaset changes -> drive LARQ.
+
+ // SPARQL parser; reuse charstream objects? using Reinit()
+ // JavaCharStream allocates a 4k char buffer on every call.
+ // Pool of parsers.
+
+ // OpTopN - OpExecutor.execute(OpTop).
+ // BSBM Explore/Update
+ // Remote SPARQL Update
+
+ // Mem dataset with union graph
+ // Union graph for all in query execution sequence.
+ // ** Documentation - assemblers for datasets
+ // qExec.getContext().set(TDB.symUnionDefaultGraph, true) ;
+
+ // HTTP result set iterator to know when it's closed.
+
+ // OpExecute example.
+
+ // More test in DatasetGraphTests
+ // Rename Quad.defaultGraphIRI?
+ // Parsers use: Quad.defaultGraphNodeGenerated
+ // Should find/4 do the same? Via:
+ // DatasetGraphBase.triples2quadsDftGraph
+
+ // SSE - move to RIOT based tokenizer.
+ // TokenizeText:
+ // Just STRING, no CNTL=>KEYWORD = Symbol, catchall Keyword/Symbol
+
+ // Apache codec.
+
+ // .filemanager
+ // FileUtils, TypedStream conversion.
+ // Check use of FileUtils.
+
+ // >>>> Tasks
+
+ // Algebra.asUnionQuery .. to access the functionality
+
+ // Path evaluation as per spec.
+ // tdbloader2; filenames.
+
+ // ?? bNode label checks (UPDATE: can't use same bNode label in template and pattern for DELETE/INSERT.)
+
+ // Pull up TransformDynamicDataset, TransformGraphRename from TDB.
+ // ---- Union Transform
+ // Tests for unionTransformation
+ // TestUnionTransformTriples
+ // TestUnionTransformQuads
+ // TestUnionGraph
+ // ** Enable in TS_Algebra.
+
+ // Better access to union query???
+ // By transform, query context.
+ // Version for tru=iples evaluation (TransformUnionQuery) and quads evaluation (A2 from TDB)
+ // Document - move from TDB
+
+ // <<<< Tasks
+
+ // QueryParseException for updates is confusing.
+ // All QueryException -> SparqlException or LanguageParseException
+
+ // Prologure from RIOT
+ // PrefixMap from RIOT
+
+ // Migrations/enable:
+ // TransformUnionQuery
+ // TransformDynamicDataset
+ // TransformGraphRename
+ // TransformPropertyPathFlatten
+
+ // ---- Documentation
+ // Downplay: PathLib.install.
+ // Legacy StageGenerator (http://openjena.org/ARQ/arq-query-eval.html)
+ // src-examples of OpExecutor+QueryEngine
+ // http://www.openjena.org/wiki/ARQ/Concurrency
+ // add qparse,uparse to wiki/ARQ/
+ // Documentation for CSV etc.
+ // Supported types
+
+ // DatasetGraph : connections
+
+ // Event type -> list of parts vs regex filtering (?)
+ // Base 64 :: Apache commons codec.
+
+ // ---- SPARQL 1.1
+ // Update: can't use same bNode label in template and pattern for DELETE/INSERT.
+ // BINDINGS execution
+ // Aggregates to return iterators.
+
+ // Property path rewrites as per spec (i.e. earlier than evaluation)
+
+ // ---- Pipeline:
+ // Architecture:
+ // Canonicalization: Fix URIs. () [] SPC
+ // Canonicaize IRIs (see IRI RFC). http://tools.ietf.org/html/rfc3986#page-38 (IRI missing in lib!)
+ // De-% unreserved characters.
+ // Number canonicalization.
+ // Always to decimal?
+ // Canonicalized lang tags?
+ // owl:equivalentClass, owl:equivalentProperty,
+ // owl:inverseOf, owl:SymmetricProperty, owl:TransitiveProperty
+ // rdfs:subClassOf (aux table).
+ // rdfs:subPropertyOf (aux table).
+
+ // ---- Events.
+ // Hierarchy.
+
+ // ---- "ARQ 3"
+ // Minor changes that break compatible in some way
+ // -- Custom functions
+ // E_Function intercepts at evalSpecial to maintain compatibility.
+ // Should really change Function.eval to strict functions (eval'ed arguments and no binding).
+
+ // XSDDuration
+
+ // ---- Commands
+ // --data to accept TriG and N-Quads
+
+ // Result set isomorphism - need backtracking
+
+ // Syntax for lists: LIST(?list, ?index, ?member)
+
+ // ---- Core
+ // Memory DatasetGraph to support Quad.unionGraph, defaultGraph and
+
+ // ---- Expr
+ // Scalar and column expressions
+
+ // ---- Union transformation
+ // Transform rewrites BGP to (graph ?_ bgp)
+ // Transform rewrites QuadBlock to (graph ?_ bgp)
+ // Implicit default graph and named union.
+ // Next:
+ // ** (graph <unionGraph> BGP) rewrites the BGP but leaves the (graph
+ // <union> ...) wrapper.
+ // ==> (graph <unionGraph> (distinct (graph ?_ bgp)))
+ // More runtime processing and less transformation?
+ // Or just strip (graph <union> ...) on the way past.
+
+ // ---- Build
+ // Build: use maven resources for the etching of version.
+
+ // ---- Optimization
+ // 1/ Enable sameTermString optimization
+ // 2/ If an equality is repeated do once only.
+ // 3/ Amalgamation: BGPs, Quads, Sequences.
+ // 4/ Assign squashing : assign as rename. (assign ((?x ?y)))
+ // 5/ Optimise FILTER(?x=?y) assuming ?x and ?y must be bound.
+
+ // ---- MicroAPI.
+ // QueryBuilder.
+ // results = query().select(vars).pattern().filter().groupBy().agg()
}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevTDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevTDB.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevTDB.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/DevTDB.java Mon Nov 7 13:55:23 2011
@@ -1,105 +1,105 @@
-package dev ;
-
-
-public class DevTDB
-{
- // BindingNodeId - reduce footprint by:
- // making extensible across a whole BGP.
- // don't use maps / make fixed max length.
-
- // DatasetGraphTDB - wrapper to ignore close in cache.
-
- // New builder - does it work for memory? Non-std block sizes?
- // DatasetAssemblerTDB has an undocumented feature for LARQ (not even in ChangeLog)
-
- // Optimizer - named graph and union graph
- // Add ((TERM ANY ANY) 1), ((ANY ANY TERM) 1) to all stats files.?
- // What is the fixed builtin?
-
- // symUnionDefaultGraph and DESCRIBE
-
- // http://sna-projects.com/krati/
-
- // Finish, integrate, switch to new Dataset builder.
- // Todo init().
- // SolverLib - convert Nodes to NodeIds once, as BGP compiled.
- // check for circularities?
-
- // Loader -> warning on bad literals?
- // Check? Test cases.
-
- // TDBLoader.load(dsg, input, lang, base, showProgress)
-
- // ** Reorganise documentation.
- // Page on union dataset.
- // Tutorial.
- // Combine with ARQ? Fuseki? One Trail.
-
- // New setup
- // See IndexFactory for bulkloader2
- // Factory for common basic object (lots of args).
- // Versions with built-in defaults.
- // NodeTableFactory and makers in the test area.
-
- // listSubjects can be done fast for TDB
-
- // ---- BulkLoader2
- // Tune sort --buffer-size=50%
- // Prefixes to be set during bulk loading 1 & 2
- // RIOT parser issue?
- // On reading, suppress duplicates (adjacent).
-
- // BPT
- // .truncate : release all blocks and create a new (empty) tree.
- // When spliting (esp records block) don't split symmetrically as incremental adding "common"
-
- // Abort long running query.
- // PrefixMapping = PrefixMap
- // Version of PrefixMap that impls (wrapper) PrefixMapping.
-
- // ---- Documentation
- // Assembler.
- // http://openjena.org/wiki/TDB/Assembler#RDFS
- // http://openjena.org/wiki/TDB/JavaAPI#Concurrency
- // http://openjena.org/wiki/TDB/Concurrency
- // and ref to ARQ.
- // http://openjena.org/wiki/TDB/Assembler to document unionDefaultGraph
-
- // --explain.
- // http://openjena.org/wiki/TDB/Configuration
- // http://openjena.org/wiki/TDB/Optimizer
- // Update: http://openjena.org/wiki/TDB/Optimizer#Investigating_what_is_going_on
-
- // == Misc
- // Tidy up wiki (esp "Use from java" - use datasets, show loader use)
-
- // ** Partial ranges : S P ?o , ?o start, ?o finish
-
- // ** Advanced block work - free chain management.
-
- // =====
- // Enable FILTER assignment for strings (and numbers?) via dataset context setting?
- // -- Tuples
- // Interface, TupleFactory, TupleImpl
- // TupleMask (or TupleImpl itself has a length field?? TupleMask(T[] or Tuple<T>))
- // Sort : with colmap?
- // TupleSlice
-
- // ---- Pipeline
- // Weak inferencing (in query rewriting):
- // rdfs:subClassOf (aux table).
- // rdfs:subPropertyOf (aux table).
-
- // ---- Optimizer
- // Early truncation of patterns
- // ?s <p> <foo> . ?s <q> ?v . ?s <r> ?x
- // Favour connected next triple pattern (but grounding makes this less relevant)
- // If <r> has no solutions fall back to triple pattern 1
- // Just need to keep var -> first def mapping but all mentions may be useful.
- // (Idea from Alisdair)
-
- // ---- NodeId:
- // Bit 0: 0 - 63 bits of id (hash!) or block allocation for cluster.
- // Bit 0: 1 - inline
- // Schema compatibility needs to handle this carefully.
-}
+package dev ;
+
+
+public class DevTDB
+{
+ // BindingNodeId - reduce footprint by:
+ // making extensible across a whole BGP.
+ // don't use maps / make fixed max length.
+
+ // DatasetGraphTDB - wrapper to ignore close in cache.
+
+ // New builder - does it work for memory? Non-std block sizes?
+ // DatasetAssemblerTDB has an undocumented feature for LARQ (not even in ChangeLog)
+
+ // Optimizer - named graph and union graph
+ // Add ((TERM ANY ANY) 1), ((ANY ANY TERM) 1) to all stats files.?
+ // What is the fixed builtin?
+
+ // symUnionDefaultGraph and DESCRIBE
+
+ // http://sna-projects.com/krati/
+
+ // Finish, integrate, switch to new Dataset builder.
+ // Todo init().
+ // SolverLib - convert Nodes to NodeIds once, as BGP compiled.
+ // check for circularities?
+
+ // Loader -> warning on bad literals?
+ // Check? Test cases.
+
+ // TDBLoader.load(dsg, input, lang, base, showProgress)
+
+ // ** Reorganise documentation.
+ // Page on union dataset.
+ // Tutorial.
+ // Combine with ARQ? Fuseki? One Trail.
+
+ // New setup
+ // See IndexFactory for bulkloader2
+ // Factory for common basic object (lots of args).
+ // Versions with built-in defaults.
+ // NodeTableFactory and makers in the test area.
+
+ // listSubjects can be done fast for TDB
+
+ // ---- BulkLoader2
+ // Tune sort --buffer-size=50%
+ // Prefixes to be set during bulk loading 1 & 2
+ // RIOT parser issue?
+ // On reading, suppress duplicates (adjacent).
+
+ // BPT
+ // .truncate : release all blocks and create a new (empty) tree.
+ // When spliting (esp records block) don't split symmetrically as incremental adding "common"
+
+ // Abort long running query.
+ // PrefixMapping = PrefixMap
+ // Version of PrefixMap that impls (wrapper) PrefixMapping.
+
+ // ---- Documentation
+ // Assembler.
+ // http://openjena.org/wiki/TDB/Assembler#RDFS
+ // http://openjena.org/wiki/TDB/JavaAPI#Concurrency
+ // http://openjena.org/wiki/TDB/Concurrency
+ // and ref to ARQ.
+ // http://openjena.org/wiki/TDB/Assembler to document unionDefaultGraph
+
+ // --explain.
+ // http://openjena.org/wiki/TDB/Configuration
+ // http://openjena.org/wiki/TDB/Optimizer
+ // Update: http://openjena.org/wiki/TDB/Optimizer#Investigating_what_is_going_on
+
+ // == Misc
+ // Tidy up wiki (esp "Use from java" - use datasets, show loader use)
+
+ // ** Partial ranges : S P ?o , ?o start, ?o finish
+
+ // ** Advanced block work - free chain management.
+
+ // =====
+ // Enable FILTER assignment for strings (and numbers?) via dataset context setting?
+ // -- Tuples
+ // Interface, TupleFactory, TupleImpl
+ // TupleMask (or TupleImpl itself has a length field?? TupleMask(T[] or Tuple<T>))
+ // Sort : with colmap?
+ // TupleSlice
+
+ // ---- Pipeline
+ // Weak inferencing (in query rewriting):
+ // rdfs:subClassOf (aux table).
+ // rdfs:subPropertyOf (aux table).
+
+ // ---- Optimizer
+ // Early truncation of patterns
+ // ?s <p> <foo> . ?s <q> ?v . ?s <r> ?x
+ // Favour connected next triple pattern (but grounding makes this less relevant)
+ // If <r> has no solutions fall back to triple pattern 1
+ // Just need to keep var -> first def mapping but all mentions may be useful.
+ // (Idea from Alisdair)
+
+ // ---- NodeId:
+ // Bit 0: 0 - 63 bits of id (hash!) or block allocation for cluster.
+ // Bit 0: 1 - inline
+ // Schema compatibility needs to handle this carefully.
+}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/IsomorphoricResultSets.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/IsomorphoricResultSets.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/IsomorphoricResultSets.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/IsomorphoricResultSets.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ModelReadCloseTest.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ModelReadCloseTest.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ModelReadCloseTest.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ModelReadCloseTest.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -16,139 +16,139 @@
* limitations under the License.
*/
-package dev ;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openjena.riot.SysRIOT;
-
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.rdf.model.ModelFactory;
-
-/**
- * This class tests to make sure that Model.read(InputStream) does not call
- * close() on the InputStream handed to it when it is finished. The creator
- * of the InputStream should be the one to manage its lifecycle. If the
- * Model does call close(), this can break InputStreams that you can still
- * read more data from after -1 is returned from read().
- *
- * ZipInputStream is an example of a class with this behavior. Below is
- * a code snippet that will fail for all Model.read() calls except the
- * Jena N-Triples parser.
- *
- * ZipInputStream zin = new ZipInputStream(new FileInputStream("file.zip"));
- * ZipEntry ze = null;
- * while ((ze = zin.getNextEntry()) != null)
- * {
- * String filename = ze.getName();
- * Model m = ModelFactory.createDefaultModel();
- * m.read(zin, null, "N-TRIPLES");
- *
- * // Closes the current ZIP entry and positions the stream for reading
- * // the next entry.
- * zin.closeEntry();
- * }
- * zin.close();
- *
- * Test Results for Jena 2.6.3 and ARQ 2.8.5
- * -----------------------------------------
- * TestJenaReaderNTriples: PASSED
- * TestJenaReaderN3: ERROR
- * TestJenaReaderRDFXML: FAILED
- * TestRIOTReaderNTriples: FAILED
- * TestRIOTReaderN3: FAILED
- * TestRIOTReaderRDFXML: FAILED
- *
- * NOTE: A work-around is to us an InputStream wrapper that delegates all
- * calls except close(), which does nothing.
- */
-public class ModelReadCloseTest
-{
- @Test
- public void TestJenaReaderNTriples()
- {
- SysRIOT.resetJenaReaders();
- readNTriples();
- }
-
- @Test
- public void TestJenaReaderN3()
- {
- SysRIOT.resetJenaReaders();
- readN3();
- }
-
- @Test
- public void TestJenaReaderRDFXML()
- {
- SysRIOT.resetJenaReaders();
- readRDFXML();
- }
-
- @Test
- public void TestRIOTReaderNTriples()
- {
- SysRIOT.wireIntoJena();
- readNTriples();
- }
-
- @Test
- public void TestRIOTReaderN3()
- {
- SysRIOT.wireIntoJena();
- readN3();
- }
-
- @Test
- public void TestRIOTReaderRDFXML()
- {
- SysRIOT.wireIntoJena();
- readRDFXML();
- }
-
-
- void readNTriples()
- {
- performRead("<http://example.org/test> <http://www.w3.org/2000/01/rdf-schema#label> \"Test\" .", "N-TRIPLES");
- }
-
- void readN3()
- {
- performRead("<http://example.org/test> <http://www.w3.org/2000/01/rdf-schema#label> \"Test\" .", "N3");
- }
-
- void readRDFXML()
- {
- performRead(
- "<?xml version=\"1.0\"?>" +
- "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">" +
- "<rdf:Description rdf:about=\"http://example.org/test\" rdfs:label=\"Test\">" +
- "</rdf:Description>" +
- "</rdf:RDF>",
- "RDF/XML");
- }
-
- void performRead(String triples, String lang)
- {
- // Create an InputStream that doesn't like to be closed
- InputStream in = new ByteArrayInputStream(triples.getBytes())
- {
- /**
- * @throws IOException
- * @see java.io.InputStream#close()
- */
- @Override
- public void close() throws IOException
- {
- Assert.fail("Close should not be called.");
- }
- };
-
- Model m = ModelFactory.createDefaultModel();
- m.read(in, null, lang);
- }
+package dev ;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openjena.riot.SysRIOT;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+
+/**
+ * This class tests to make sure that Model.read(InputStream) does not call
+ * close() on the InputStream handed to it when it is finished. The creator
+ * of the InputStream should be the one to manage its lifecycle. If the
+ * Model does call close(), this can break InputStreams that you can still
+ * read more data from after -1 is returned from read().
+ *
+ * ZipInputStream is an example of a class with this behavior. Below is
+ * a code snippet that will fail for all Model.read() calls except the
+ * Jena N-Triples parser.
+ *
+ * ZipInputStream zin = new ZipInputStream(new FileInputStream("file.zip"));
+ * ZipEntry ze = null;
+ * while ((ze = zin.getNextEntry()) != null)
+ * {
+ * String filename = ze.getName();
+ * Model m = ModelFactory.createDefaultModel();
+ * m.read(zin, null, "N-TRIPLES");
+ *
+ * // Closes the current ZIP entry and positions the stream for reading
+ * // the next entry.
+ * zin.closeEntry();
+ * }
+ * zin.close();
+ *
+ * Test Results for Jena 2.6.3 and ARQ 2.8.5
+ * -----------------------------------------
+ * TestJenaReaderNTriples: PASSED
+ * TestJenaReaderN3: ERROR
+ * TestJenaReaderRDFXML: FAILED
+ * TestRIOTReaderNTriples: FAILED
+ * TestRIOTReaderN3: FAILED
+ * TestRIOTReaderRDFXML: FAILED
+ *
+ * NOTE: A work-around is to us an InputStream wrapper that delegates all
+ * calls except close(), which does nothing.
+ */
+public class ModelReadCloseTest
+{
+ @Test
+ public void TestJenaReaderNTriples()
+ {
+ SysRIOT.resetJenaReaders();
+ readNTriples();
+ }
+
+ @Test
+ public void TestJenaReaderN3()
+ {
+ SysRIOT.resetJenaReaders();
+ readN3();
+ }
+
+ @Test
+ public void TestJenaReaderRDFXML()
+ {
+ SysRIOT.resetJenaReaders();
+ readRDFXML();
+ }
+
+ @Test
+ public void TestRIOTReaderNTriples()
+ {
+ SysRIOT.wireIntoJena();
+ readNTriples();
+ }
+
+ @Test
+ public void TestRIOTReaderN3()
+ {
+ SysRIOT.wireIntoJena();
+ readN3();
+ }
+
+ @Test
+ public void TestRIOTReaderRDFXML()
+ {
+ SysRIOT.wireIntoJena();
+ readRDFXML();
+ }
+
+
+ void readNTriples()
+ {
+ performRead("<http://example.org/test> <http://www.w3.org/2000/01/rdf-schema#label> \"Test\" .", "N-TRIPLES");
+ }
+
+ void readN3()
+ {
+ performRead("<http://example.org/test> <http://www.w3.org/2000/01/rdf-schema#label> \"Test\" .", "N3");
+ }
+
+ void readRDFXML()
+ {
+ performRead(
+ "<?xml version=\"1.0\"?>" +
+ "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">" +
+ "<rdf:Description rdf:about=\"http://example.org/test\" rdfs:label=\"Test\">" +
+ "</rdf:Description>" +
+ "</rdf:RDF>",
+ "RDF/XML");
+ }
+
+ void performRead(String triples, String lang)
+ {
+ // Create an InputStream that doesn't like to be closed
+ InputStream in = new ByteArrayInputStream(triples.getBytes())
+ {
+ /**
+ * @throws IOException
+ * @see java.io.InputStream#close()
+ */
+ @Override
+ public void close() throws IOException
+ {
+ Assert.fail("Close should not be called.");
+ }
+ };
+
+ Model m = ModelFactory.createDefaultModel();
+ m.read(in, null, lang);
+ }
}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena102_TDBstats.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena102_TDBstats.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena102_TDBstats.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena102_TDBstats.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena142_VarScopeBind.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena142_VarScopeBind.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena142_VarScopeBind.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena142_VarScopeBind.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena143_TDBConcurrency.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena143_TDBConcurrency.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena143_TDBConcurrency.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena143_TDBConcurrency.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena149_Duration.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena149_Duration.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena149_Duration.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena149_Duration.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena154_GraphVarScope.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena154_GraphVarScope.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena154_GraphVarScope.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/ReportJena154_GraphVarScope.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Run.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Run.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Run.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Run.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunARQ.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunARQ.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunARQ.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -16,9 +16,9 @@
* limitations under the License.
*/
-package dev;
+package dev;
-import static dev.RunBase.* ;
+import static dev.RunBase.* ;
import java.io.FileInputStream ;
import java.io.InputStream ;
import java.util.Iterator ;
@@ -77,361 +77,361 @@ import com.hp.hpl.jena.sparql.sse.SSE ;
import com.hp.hpl.jena.sparql.util.* ;
import com.hp.hpl.jena.update.* ;
import com.hp.hpl.jena.util.FileManager ;
-
-public class RunARQ
-{
+
+public class RunARQ
+{
static { Log.setLog4j() ; }
-
- @SuppressWarnings("deprecation")
- public static void main(String[] argv) throws Exception
- {
- String DIR = "testing/ARQ/GroupBy/" ;
-
- arq.sparql.main("-v", "--data="+DIR+"data-1.ttl", "--query="+DIR+"count-05.arq") ;
- exit(0) ;
-
-
- ARQ.init();
-
- Dataset ds = (Dataset)AssemblerUtils.build("D.ttl", DatasetAssemblerVocab.tDataset) ;
- System.out.println(ds.asDatasetGraph().getContext()) ;
- exit(0) ;
-
- Node n = Node.createLiteral("9", null, XSDDatatype.XSDint) ;
- System.out.println(FmtUtils.stringForNode(n, (PrefixMapping)null)) ;
- exit(0) ;
-
- arq.update.main("--file=U.ru", "--dump") ;
- exit(0) ;
-
- FunctionRegistry.get().put("http://example/ns#wait", wait.class) ;
-
- QueryExecutionBase.cancelAllowDrain = true ;
- Query q = QueryFactory.create("PREFIX ex: <http://example/ns#> SELECT * { FILTER ex:wait(100) }") ;
- QueryExecution qExec = QueryExecutionFactory.create(q, ModelFactory.createDefaultModel()) ;
-
- try { exit(0) ;
-
- ResultSet rs = qExec.execSelect() ;
- System.out.println(rs.hasNext()) ;
- qExec.abort();
- System.out.println(rs.hasNext()) ;
- rs.nextSolution();
- System.out.println(rs.hasNext()) ;
- } finally { qExec.close() ; }
-
- exit(0) ;
-
- InputStream in = new FileInputStream("data") ;
- BindingInputStream bin = new BindingInputStream(in) ;
-
- Node nn = Node.createAnon() ;
- System.out.println(nn.getBlankNodeLabel()) ;
-
- BindingOutputStream bout = new BindingOutputStream(System.out) ;
-
- // <_:>
- Tokenizer tok = TokenizerFactory.makeTokenizerString("<_:123>") ;
- Token t = tok.next() ;
- System.out.println(t) ;
- exit(0) ;
- }
-
- public static void canoncialNodes()
- {
- NodeTransform ntLitCanon = CanonicalizeLiteral.get();
- // To do :
- // double and floats.
- // decimals and X.0
- String[] strings = { "123", "0123", "0123.00900" , "-0089", "-0089.0" , "1e5", "+001.5e6", "'fred'"} ;
- for ( String s : strings )
- {
- Node n = SSE.parseNode(s) ;
- Node n2 = ntLitCanon.convert(n) ;
- System.out.println(n+" => "+n2) ;
- }
- exit(0) ;
- }
-
-
- static public class wait extends FunctionBase1 {
-
- @Override
- public NodeValue exec(NodeValue nv)
- {
- if ( ! nv.isInteger() )
- throw new ExprEvalException("Not an integer") ;
- int x = nv.getInteger().intValue() ;
- Lib.sleep(x) ;
- return nv ;
- }
- }
-
- public static void queryExecTimeout()
- {
- FunctionRegistry.get().put("http://example/f#wait", wait.class) ;
-
- Model model = FileManager.get().loadModel("D.nt") ;
- Query query = QueryFactory.create("PREFIX f: <http://example/f#> SELECT *{?s ?p ?o FILTER (f:wait(1)) } ") ;
-
- QueryExecution qExec = QueryExecutionFactory.create(query, model) ;
-
- ((QueryExecutionBase)qExec).setTimeout(100) ;
- System.out.println("0"); // Not started yet.
- Lib.sleep(500) ;
-
- System.out.println("1");
- ResultSet rs = qExec.execSelect() ;
- System.out.println("2");
- rs.hasNext() ;
- System.out.println("3");
- rs.next() ;
- System.out.println("4");
- Lib.sleep(1000) ;
- System.out.println("5");
- exit(0) ;
-
- //ResultSetFormatter.out(rs) ;
- //System.out.println(rs.next()) ;
- //qExec.cancel() ;
- try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 1") ; }
- try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 2") ; }
- try { rs.next() ; }
- catch (QueryCancelledException ex) { System.out.println("CANCEL 3") ; }
- catch (NoSuchElementException ex) { System.out.println("No Elt 3") ; }
-
- System.out.println(rs.next()) ;
- qExec.abort() ;
- try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 4") ; }
- try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 5") ; }
- try { rs.next() ; }
- catch (QueryCancelledException ex) { System.out.println("CANCEL 6") ; }
- catch (NoSuchElementException ex) { System.out.println("No Elt 6") ; }
- }
-
- public static void parallelParser() throws Exception
- {
-
- final Triple marker = new Triple(Node.NULL, Node.NULL, Node.NULL) ;
- final String filename = "/home/afs/Datasets/MusicBrainz/tracks-1k.nt" ;
- final BlockingQueue<Triple> queue = new ArrayBlockingQueue<Triple>(10) ;
-
- final Sink<Triple> sink = new Sink<Triple>() {
-
+
+ @SuppressWarnings("deprecation")
+ public static void main(String[] argv) throws Exception
+ {
+ String DIR = "testing/ARQ/GroupBy/" ;
+
+ arq.sparql.main("-v", "--data="+DIR+"data-1.ttl", "--query="+DIR+"count-05.arq") ;
+ exit(0) ;
+
+
+ ARQ.init();
+
+ Dataset ds = (Dataset)AssemblerUtils.build("D.ttl", DatasetAssemblerVocab.tDataset) ;
+ System.out.println(ds.asDatasetGraph().getContext()) ;
+ exit(0) ;
+
+ Node n = Node.createLiteral("9", null, XSDDatatype.XSDint) ;
+ System.out.println(FmtUtils.stringForNode(n, (PrefixMapping)null)) ;
+ exit(0) ;
+
+ arq.update.main("--file=U.ru", "--dump") ;
+ exit(0) ;
+
+ FunctionRegistry.get().put("http://example/ns#wait", wait.class) ;
+
+ QueryExecutionBase.cancelAllowDrain = true ;
+ Query q = QueryFactory.create("PREFIX ex: <http://example/ns#> SELECT * { FILTER ex:wait(100) }") ;
+ QueryExecution qExec = QueryExecutionFactory.create(q, ModelFactory.createDefaultModel()) ;
+
+ try { exit(0) ;
+
+ ResultSet rs = qExec.execSelect() ;
+ System.out.println(rs.hasNext()) ;
+ qExec.abort();
+ System.out.println(rs.hasNext()) ;
+ rs.nextSolution();
+ System.out.println(rs.hasNext()) ;
+ } finally { qExec.close() ; }
+
+ exit(0) ;
+
+ InputStream in = new FileInputStream("data") ;
+ BindingInputStream bin = new BindingInputStream(in) ;
+
+ Node nn = Node.createAnon() ;
+ System.out.println(nn.getBlankNodeLabel()) ;
+
+ BindingOutputStream bout = new BindingOutputStream(System.out) ;
+
+ // <_:>
+ Tokenizer tok = TokenizerFactory.makeTokenizerString("<_:123>") ;
+ Token t = tok.next() ;
+ System.out.println(t) ;
+ exit(0) ;
+ }
+
+ public static void canoncialNodes()
+ {
+ NodeTransform ntLitCanon = CanonicalizeLiteral.get();
+ // To do :
+ // double and floats.
+ // decimals and X.0
+ String[] strings = { "123", "0123", "0123.00900" , "-0089", "-0089.0" , "1e5", "+001.5e6", "'fred'"} ;
+ for ( String s : strings )
+ {
+ Node n = SSE.parseNode(s) ;
+ Node n2 = ntLitCanon.convert(n) ;
+ System.out.println(n+" => "+n2) ;
+ }
+ exit(0) ;
+ }
+
+
+ static public class wait extends FunctionBase1 {
+
+ @Override
+ public NodeValue exec(NodeValue nv)
+ {
+ if ( ! nv.isInteger() )
+ throw new ExprEvalException("Not an integer") ;
+ int x = nv.getInteger().intValue() ;
+ Lib.sleep(x) ;
+ return nv ;
+ }
+ }
+
+ public static void queryExecTimeout()
+ {
+ FunctionRegistry.get().put("http://example/f#wait", wait.class) ;
+
+ Model model = FileManager.get().loadModel("D.nt") ;
+ Query query = QueryFactory.create("PREFIX f: <http://example/f#> SELECT *{?s ?p ?o FILTER (f:wait(1)) } ") ;
+
+ QueryExecution qExec = QueryExecutionFactory.create(query, model) ;
+
+ ((QueryExecutionBase)qExec).setTimeout(100) ;
+ System.out.println("0"); // Not started yet.
+ Lib.sleep(500) ;
+
+ System.out.println("1");
+ ResultSet rs = qExec.execSelect() ;
+ System.out.println("2");
+ rs.hasNext() ;
+ System.out.println("3");
+ rs.next() ;
+ System.out.println("4");
+ Lib.sleep(1000) ;
+ System.out.println("5");
+ exit(0) ;
+
+ //ResultSetFormatter.out(rs) ;
+ //System.out.println(rs.next()) ;
+ //qExec.cancel() ;
+ try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 1") ; }
+ try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 2") ; }
+ try { rs.next() ; }
+ catch (QueryCancelledException ex) { System.out.println("CANCEL 3") ; }
+ catch (NoSuchElementException ex) { System.out.println("No Elt 3") ; }
+
+ System.out.println(rs.next()) ;
+ qExec.abort() ;
+ try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 4") ; }
+ try { rs.hasNext() ; } catch (QueryCancelledException ex) { System.out.println("CANCEL 5") ; }
+ try { rs.next() ; }
+ catch (QueryCancelledException ex) { System.out.println("CANCEL 6") ; }
+ catch (NoSuchElementException ex) { System.out.println("No Elt 6") ; }
+ }
+
+ public static void parallelParser() throws Exception
+ {
+
+ final Triple marker = new Triple(Node.NULL, Node.NULL, Node.NULL) ;
+ final String filename = "/home/afs/Datasets/MusicBrainz/tracks-1k.nt" ;
+ final BlockingQueue<Triple> queue = new ArrayBlockingQueue<Triple>(10) ;
+
+ final Sink<Triple> sink = new Sink<Triple>() {
+
@Override
- public void close()
- {
- System.out.println("Close sink") ;
- queue.add(marker) ;
- }
-
+ public void close()
+ {
+ System.out.println("Close sink") ;
+ queue.add(marker) ;
+ }
+
@Override
- public void send(Triple item)
- {
- try
- {
- queue.put(item) ;
- } catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- }
-
+ public void send(Triple item)
+ {
+ try
+ {
+ queue.put(item) ;
+ } catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
@Override
- public void flush()
- {}
- } ;
-
- Runnable r = new Runnable() {
+ public void flush()
+ {}
+ } ;
+
+ Runnable r = new Runnable() {
@Override
- public void run()
- {
- RiotReader.parseTriples(filename, sink) ;
- sink.close() ;
- System.out.println("Thread end") ;
- }
- } ;
-
- ExecutorService executor = Executors.newFixedThreadPool(1);
- executor.execute(r) ;
-
- for ( ;; )
- {
- Triple triple = queue.take() ;
- if ( triple == marker )
- break ;
- System.out.println(triple);
- }
- System.out.println("Wait for thread") ;
-
- executor.shutdown() ;
-
-
- exit(0) ;
-
- }
-
-
-
- public static void runUpdate()
- {
- UpdateRequest request = UpdateFactory.create("INSERT DATA { GRAPH <G> { <s> <p> <o> }}") ;
- DatasetGraph dsg = DatasetGraphFactory.createMem() ;
- GraphStore gs = GraphStoreFactory.create(dsg) ;
- UpdateAction.execute(request, gs) ;
- SSE.write(gs) ;
- System.exit(0) ;
- }
-
- public static void runTest()
- {
- String dir = "/home/afs/W3C/SPARQL-docs/tests/data-sparql11/negation/" ;
- dir = "testing/ARQ/PropertyFunctions/" ;
- runTest(dir, "data-1.ttl", "list-8.rq") ;
- }
-
- public static void runTest(String dir, String dataFile, String queryFile)
- {
- if ( ! dir.endsWith("/") )
- dir = dir + "/" ;
- String queryArg = "--query="+dir+queryFile ;
- String dataArg = "--data="+dir+dataFile ;
- arq.sparql.main(/*"--engine=ref",*/ dataArg, queryArg) ;
- }
-
- private static void json()
- {
- // JSON
- // ** Double space for end of object, end of object.
- JsonValue obj = JSON.readAny("D.json") ;
- IndentedWriter out = new IndentedWriter(System.out) ;
- out.setFlatMode(true) ;
- //out.setEndOfLineMarker("$") ;
- JSON.write(out, obj) ;
- out.flush() ;
- System.exit(0) ;
-
-
- }
-
- private static void processIRI(String iriStr)
- {
-
-
- IRI iri = IRIFactory.iriImplementation().create(iriStr) ;
- System.out.println(iri) ;
- System.out.println("Relative: "+iri.isRelative()) ;
-
- Iterator<Violation> vIter = iri.violations(true) ;
- for ( ; vIter.hasNext() ; )
- {
- Violation v = vIter.next() ;
- System.out.println(v.getShortMessage()) ;
- //System.out.println(v.getSpecificationURL()) ;
- }
- System.out.println(iriStr + " ==> "+iri) ;
- CheckerIRI.iriViolations(iri, ErrorHandlerFactory.errorHandlerWarn) ;
- System.exit(0) ;
- }
-
- public static void analyseQuery(String ...queryString)
- {
- String qs = StrUtils.strjoinNL(queryString) ;
- Query query = QueryFactory.create(qs) ;
- Op op = Algebra.compile(query) ;
- divider() ;
- System.out.println(op) ;
- Op op2 = Algebra.optimize(op) ;
- divider() ;
- System.out.println(op2) ;
- divider() ;
- }
-
-
- private static void execTimed(Query query, Model model)
- {
-// System.out.println(ARQ.VERSION);
-// System.out.println(Jena.VERSION);
-
- Timer timer = new Timer() ;
- timer.startTimer() ;
- exec(query, model) ;
- long time = timer.endTimer() ;
- System.out.printf("Time = %.2fs\n", time/1000.0) ;
- }
-
- private static void exec(Query query, Model model)
- {
- QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
- QueryExecUtils.executeQuery(query, qexec) ;
- }
-
-
- public static NodeValue eval(String string)
- {
- try {
- Expr expr = ExprUtils.parse(string) ;
- return expr.eval(null, new FunctionEnvBase()) ;
- } catch (ExprEvalException ex)
- {
- ex.printStackTrace(System.err) ;
- return null ;
- }
- }
-
- public static void qexpr(String exprStr)
- {
- try {
- PrefixMapping pmap = PrefixMapping.Factory.create() ;
- pmap.setNsPrefixes(ARQConstants.getGlobalPrefixMap()) ;
- pmap.setNsPrefix("", "http://example/") ;
- pmap.setNsPrefix("ex", "http://example/ns#") ;
-
- Expr expr = ExprUtils.parse(exprStr, pmap) ;
- // Default action
- ARQ.getContext().set(ARQConstants.sysCurrentTime, NodeFactory.nowAsDateTime()) ;
- FunctionEnv env = new ExecutionContext(ARQ.getContext(), null, null, null) ;
- NodeValue r = expr.eval(null, env) ;
- //System.out.println(r.asQuotedString()) ;
- Node n = r.asNode() ;
- String s = FmtUtils.stringForNode(n) ;
- System.out.println(s) ;
- } catch (ARQException ex)
- {
- System.out.println(" ** "+ex) ;
- }
- }
-
- private static void runQTest(String dir, String manifest)
- {
- if ( ! dir.endsWith("/") )
- dir = dir + "/" ;
- String []a1 = { "--strict", dir+manifest } ;
- arq.qtest.main(a1) ;
- System.exit(0 ) ;
-
- }
-
- private static void execQueryCode(String datafile, String queryfile)
- {
- Model model = FileManager.get().loadModel(datafile) ;
- Query query = QueryFactory.read(queryfile) ;
-
- QuerySolutionMap initialBinding = new QuerySolutionMap();
- //initialBinding.add("s", model.createResource("http://example/x1")) ;
- initialBinding.add("o", model.createResource("http://example/z")) ;
-
- QueryExecution qExec = QueryExecutionFactory.create(query, model, initialBinding) ;
- ResultSetFormatter.out(qExec.execSelect()) ;
- }
-
- private static void execRemote()
- {
- System.setProperty("socksProxyHost", "socks-server") ;
-
- String a2[] = { "--service=http://dbpedia.org/sparql",
- "SELECT * WHERE { <http://dbpedia.org/resource/Angela_Merkel> <http://dbpedia.org/property/reference> ?object. FILTER (!isLiteral(?object))}"} ;
- arq.remote.main(a2) ;
- System.exit(0) ;
- }
+ public void run()
+ {
+ RiotReader.parseTriples(filename, sink) ;
+ sink.close() ;
+ System.out.println("Thread end") ;
+ }
+ } ;
+
+ ExecutorService executor = Executors.newFixedThreadPool(1);
+ executor.execute(r) ;
+
+ for ( ;; )
+ {
+ Triple triple = queue.take() ;
+ if ( triple == marker )
+ break ;
+ System.out.println(triple);
+ }
+ System.out.println("Wait for thread") ;
+
+ executor.shutdown() ;
+
+
+ exit(0) ;
+
+ }
+
+
+
+ public static void runUpdate()
+ {
+ UpdateRequest request = UpdateFactory.create("INSERT DATA { GRAPH <G> { <s> <p> <o> }}") ;
+ DatasetGraph dsg = DatasetGraphFactory.createMem() ;
+ GraphStore gs = GraphStoreFactory.create(dsg) ;
+ UpdateAction.execute(request, gs) ;
+ SSE.write(gs) ;
+ System.exit(0) ;
+ }
+
+ public static void runTest()
+ {
+ String dir = "/home/afs/W3C/SPARQL-docs/tests/data-sparql11/negation/" ;
+ dir = "testing/ARQ/PropertyFunctions/" ;
+ runTest(dir, "data-1.ttl", "list-8.rq") ;
+ }
+
+ public static void runTest(String dir, String dataFile, String queryFile)
+ {
+ if ( ! dir.endsWith("/") )
+ dir = dir + "/" ;
+ String queryArg = "--query="+dir+queryFile ;
+ String dataArg = "--data="+dir+dataFile ;
+ arq.sparql.main(/*"--engine=ref",*/ dataArg, queryArg) ;
+ }
+
+ private static void json()
+ {
+ // JSON
+ // ** Double space for end of object, end of object.
+ JsonValue obj = JSON.readAny("D.json") ;
+ IndentedWriter out = new IndentedWriter(System.out) ;
+ out.setFlatMode(true) ;
+ //out.setEndOfLineMarker("$") ;
+ JSON.write(out, obj) ;
+ out.flush() ;
+ System.exit(0) ;
+
+
+ }
+
+ private static void processIRI(String iriStr)
+ {
+
+
+ IRI iri = IRIFactory.iriImplementation().create(iriStr) ;
+ System.out.println(iri) ;
+ System.out.println("Relative: "+iri.isRelative()) ;
+
+ Iterator<Violation> vIter = iri.violations(true) ;
+ for ( ; vIter.hasNext() ; )
+ {
+ Violation v = vIter.next() ;
+ System.out.println(v.getShortMessage()) ;
+ //System.out.println(v.getSpecificationURL()) ;
+ }
+ System.out.println(iriStr + " ==> "+iri) ;
+ CheckerIRI.iriViolations(iri, ErrorHandlerFactory.errorHandlerWarn) ;
+ System.exit(0) ;
+ }
+
+ public static void analyseQuery(String ...queryString)
+ {
+ String qs = StrUtils.strjoinNL(queryString) ;
+ Query query = QueryFactory.create(qs) ;
+ Op op = Algebra.compile(query) ;
+ divider() ;
+ System.out.println(op) ;
+ Op op2 = Algebra.optimize(op) ;
+ divider() ;
+ System.out.println(op2) ;
+ divider() ;
+ }
+
+
+ private static void execTimed(Query query, Model model)
+ {
+// System.out.println(ARQ.VERSION);
+// System.out.println(Jena.VERSION);
+
+ Timer timer = new Timer() ;
+ timer.startTimer() ;
+ exec(query, model) ;
+ long time = timer.endTimer() ;
+ System.out.printf("Time = %.2fs\n", time/1000.0) ;
+ }
+
+ private static void exec(Query query, Model model)
+ {
+ QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
+ QueryExecUtils.executeQuery(query, qexec) ;
+ }
+
+
+ public static NodeValue eval(String string)
+ {
+ try {
+ Expr expr = ExprUtils.parse(string) ;
+ return expr.eval(null, new FunctionEnvBase()) ;
+ } catch (ExprEvalException ex)
+ {
+ ex.printStackTrace(System.err) ;
+ return null ;
+ }
+ }
+
+ public static void qexpr(String exprStr)
+ {
+ try {
+ PrefixMapping pmap = PrefixMapping.Factory.create() ;
+ pmap.setNsPrefixes(ARQConstants.getGlobalPrefixMap()) ;
+ pmap.setNsPrefix("", "http://example/") ;
+ pmap.setNsPrefix("ex", "http://example/ns#") ;
+
+ Expr expr = ExprUtils.parse(exprStr, pmap) ;
+ // Default action
+ ARQ.getContext().set(ARQConstants.sysCurrentTime, NodeFactory.nowAsDateTime()) ;
+ FunctionEnv env = new ExecutionContext(ARQ.getContext(), null, null, null) ;
+ NodeValue r = expr.eval(null, env) ;
+ //System.out.println(r.asQuotedString()) ;
+ Node n = r.asNode() ;
+ String s = FmtUtils.stringForNode(n) ;
+ System.out.println(s) ;
+ } catch (ARQException ex)
+ {
+ System.out.println(" ** "+ex) ;
+ }
+ }
+
+ private static void runQTest(String dir, String manifest)
+ {
+ if ( ! dir.endsWith("/") )
+ dir = dir + "/" ;
+ String []a1 = { "--strict", dir+manifest } ;
+ arq.qtest.main(a1) ;
+ System.exit(0 ) ;
+
+ }
+
+ private static void execQueryCode(String datafile, String queryfile)
+ {
+ Model model = FileManager.get().loadModel(datafile) ;
+ Query query = QueryFactory.read(queryfile) ;
+
+ QuerySolutionMap initialBinding = new QuerySolutionMap();
+ //initialBinding.add("s", model.createResource("http://example/x1")) ;
+ initialBinding.add("o", model.createResource("http://example/z")) ;
+
+ QueryExecution qExec = QueryExecutionFactory.create(query, model, initialBinding) ;
+ ResultSetFormatter.out(qExec.execSelect()) ;
+ }
+
+ private static void execRemote()
+ {
+ System.setProperty("socksProxyHost", "socks-server") ;
+
+ String a2[] = { "--service=http://dbpedia.org/sparql",
+ "SELECT * WHERE { <http://dbpedia.org/resource/Angela_Merkel> <http://dbpedia.org/property/reference> ?object. FILTER (!isLiteral(?object))}"} ;
+ arq.remote.main(a2) ;
+ System.exit(0) ;
+ }
}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunBase.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunBase.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunBase.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunHTTP.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunHTTP.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunHTTP.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/RunHTTP.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -16,97 +16,97 @@
* limitations under the License.
*/
-package dev;
-
-import java.io.IOException ;
-import java.io.OutputStream ;
-import java.net.URLEncoder ;
-import java.util.ArrayList ;
-import java.util.HashMap ;
-import java.util.List ;
-import java.util.Map ;
-
-import org.openjena.atlas.iterator.Iter ;
-import org.openjena.atlas.lib.StrUtils ;
-import org.openjena.atlas.logging.Log ;
-import org.openjena.riot.WebContent ;
-import org.openjena.riot.web.ContentProducer ;
-import org.openjena.riot.web.HttpOp ;
-import org.openjena.riot.web.HttpResponseHandler ;
-import org.openjena.riot.web.HttpResponseLib ;
-
-import com.hp.hpl.jena.query.ResultSetFormatter ;
-
-public class RunHTTP
-{
- static String divider = "----------------------------------------" ;
- static String nextDivider = null ;
- static void divider()
- {
- if ( nextDivider != null )
- System.out.println(nextDivider) ;
- nextDivider = divider ;
- }
-
- static { Log.setLog4j() ; }
-
- public static void exit(int code)
- {
- System.out.flush() ;
- System.out.println("DONE") ;
- System.exit(code) ;
- }
-
- public static void main(String ... args) throws Exception
- {
- final String queryString1 = "SELECT * { ?s ?p ?o } LIMIT 1" ;
- final String queryString2 = "SELECT * { ?s ?p ?o } LIMIT 10" ;
-
- // GET graph
- Map<String, HttpResponseHandler> handlers = new HashMap<String, HttpResponseHandler>() ;
- // Chnage to one handler for all graph types.
- handlers.put(WebContent.contentTypeTurtle, HttpResponseLib.graphReaderTurtle) ;
- handlers.put(WebContent.contentTypeRDFXML, HttpResponseLib.graphReaderRDFXML) ;
- handlers.put("*", HttpResponseLib.httpDumpResponse) ;
-
- // Better design.
- HttpResponseLib.HttpCaptureResponseResultSet captureRS = new HttpResponseLib.HttpCaptureResponseResultSet() ;
- handlers.put(WebContent.contentTypeResultsXML, captureRS) ;
- handlers.put(WebContent.contentTypeResultsJSON, captureRS) ;
- handlers.put(WebContent.contentTypeTextTSV, captureRS) ;
-
- List<String> acceptables = new ArrayList<String>() ;
- acceptables.add("text/turtle;q=0.8") ;
- acceptables.add("application/rdf+xml;q=0.1") ;
- String acceptHeader = Iter.asString(acceptables, " , ") ;
-
- HttpOp.execHttpGet("http://localhost:3030/ds/sparql?query="+URLEncoder.encode(queryString1,"UTF-8"),
- acceptHeader,
- handlers) ;
-
- ResultSetFormatter.out(captureRS.get()) ;
-
-
- ContentProducer cp = new ContentProducer() {
- //@Override
+package dev;
+
+import java.io.IOException ;
+import java.io.OutputStream ;
+import java.net.URLEncoder ;
+import java.util.ArrayList ;
+import java.util.HashMap ;
+import java.util.List ;
+import java.util.Map ;
+
+import org.openjena.atlas.iterator.Iter ;
+import org.openjena.atlas.lib.StrUtils ;
+import org.openjena.atlas.logging.Log ;
+import org.openjena.riot.WebContent ;
+import org.openjena.riot.web.ContentProducer ;
+import org.openjena.riot.web.HttpOp ;
+import org.openjena.riot.web.HttpResponseHandler ;
+import org.openjena.riot.web.HttpResponseLib ;
+
+import com.hp.hpl.jena.query.ResultSetFormatter ;
+
+public class RunHTTP
+{
+ static String divider = "----------------------------------------" ;
+ static String nextDivider = null ;
+ static void divider()
+ {
+ if ( nextDivider != null )
+ System.out.println(nextDivider) ;
+ nextDivider = divider ;
+ }
+
+ static { Log.setLog4j() ; }
+
+ public static void exit(int code)
+ {
+ System.out.flush() ;
+ System.out.println("DONE") ;
+ System.exit(code) ;
+ }
+
+ public static void main(String ... args) throws Exception
+ {
+ final String queryString1 = "SELECT * { ?s ?p ?o } LIMIT 1" ;
+ final String queryString2 = "SELECT * { ?s ?p ?o } LIMIT 10" ;
+
+ // GET graph
+ Map<String, HttpResponseHandler> handlers = new HashMap<String, HttpResponseHandler>() ;
+ // Chnage to one handler for all graph types.
+ handlers.put(WebContent.contentTypeTurtle, HttpResponseLib.graphReaderTurtle) ;
+ handlers.put(WebContent.contentTypeRDFXML, HttpResponseLib.graphReaderRDFXML) ;
+ handlers.put("*", HttpResponseLib.httpDumpResponse) ;
+
+ // Better design.
+ HttpResponseLib.HttpCaptureResponseResultSet captureRS = new HttpResponseLib.HttpCaptureResponseResultSet() ;
+ handlers.put(WebContent.contentTypeResultsXML, captureRS) ;
+ handlers.put(WebContent.contentTypeResultsJSON, captureRS) ;
+ handlers.put(WebContent.contentTypeTextTSV, captureRS) ;
+
+ List<String> acceptables = new ArrayList<String>() ;
+ acceptables.add("text/turtle;q=0.8") ;
+ acceptables.add("application/rdf+xml;q=0.1") ;
+ String acceptHeader = Iter.asString(acceptables, " , ") ;
+
+ HttpOp.execHttpGet("http://localhost:3030/ds/sparql?query="+URLEncoder.encode(queryString1,"UTF-8"),
+ acceptHeader,
+ handlers) ;
+
+ ResultSetFormatter.out(captureRS.get()) ;
+
+
+ ContentProducer cp = new ContentProducer() {
+ //@Override
@Override
- public void writeTo(OutputStream outstream) throws IOException
- {
- outstream.write(StrUtils.asUTF8bytes(queryString2)) ;
- //outstream.flush() ;
- }} ;
-
- List<String> acceptResultSets = new ArrayList<String>() ;
- acceptResultSets.add(WebContent.contentTypeResultsJSON+";q=0.9") ;
- acceptResultSets.add(WebContent.contentTypeResultsXML+";q=0.5") ;
- acceptResultSets.add(WebContent.contentTypeTextTSV+";q=0.8") ;
- String acceptResultSet = Iter.asString(acceptResultSets, " , ") ;
-
- HttpOp.execHttpPost("http://localhost:3030/ds/sparql",
- WebContent.contentTypeSPARQLQuery, cp,
- acceptResultSet, handlers) ;
- ResultSetFormatter.out(captureRS.get()) ;
- exit(0) ;
-
- }
+ public void writeTo(OutputStream outstream) throws IOException
+ {
+ outstream.write(StrUtils.asUTF8bytes(queryString2)) ;
+ //outstream.flush() ;
+ }} ;
+
+ List<String> acceptResultSets = new ArrayList<String>() ;
+ acceptResultSets.add(WebContent.contentTypeResultsJSON+";q=0.9") ;
+ acceptResultSets.add(WebContent.contentTypeResultsXML+";q=0.5") ;
+ acceptResultSets.add(WebContent.contentTypeTextTSV+";q=0.8") ;
+ String acceptResultSet = Iter.asString(acceptResultSets, " , ") ;
+
+ HttpOp.execHttpPost("http://localhost:3030/ds/sparql",
+ WebContent.contentTypeSPARQLQuery, cp,
+ acceptResultSet, handlers) ;
+ ResultSetFormatter.out(captureRS.get()) ;
+ exit(0) ;
+
+ }
}
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/TransformPropertyPathFlatten.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/TransformPropertyPathFlatten.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/TransformPropertyPathFlatten.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/TransformPropertyPathFlatten.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/TestFileManager.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/TestFileManager.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/TestFileManager.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/TestFileManager.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocationMapper.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocationMapper.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocationMapper.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/LocationMapper.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/Locator.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/Locator.java?rev=1198737&r1=1198736&r2=1198737&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/Locator.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/fm2/atlas/Locator.java Mon Nov 7 13:55:23 2011
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information