jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [35/50] [abbrv] jena git commit: JENA-1396: Merge //github/afs/mantis as subdirectory jena-db/
Date Thu, 28 Sep 2017 11:08:51 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/manifest.ttl
index 0000000,0000000..aacbb56
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/manifest.ttl
@@@ -1,0 -1,0 +1,101 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "Basic test cases" ;
++    mf:entries
++    ( 
++      [  mf:name    "Basic 00" ;
++         mf:action
++            [ qt:query  <basic-00.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic S" ;
++         mf:action
++            [ qt:query  <basic-1-S.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic P" ;
++         mf:action
++            [ qt:query  <basic-1-P.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic O" ;
++         mf:action
++            [ qt:query  <basic-1-O.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 1 SP" ;
++         mf:action
++            [ qt:query  <basic-1-SP.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 1 SO" ;
++         mf:action
++            [ qt:query  <basic-1-SO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 1 PO" ;
++         mf:action
++            [ qt:query  <basic-1-PO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 1 SPO" ;
++         mf:action
++            [ qt:query  <basic-1-SPO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 2 SO" ;
++         mf:action
++            [ qt:query  <basic-2-SO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++
++      [  mf:name    "Basic 3 S" ;
++         mf:action
++            [ qt:query  <basic-3-S.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 3 P" ;
++         mf:action
++            [ qt:query  <basic-3-P.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 3 O" ;
++         mf:action
++            [ qt:query  <basic-3-O.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 3 SP" ;
++         mf:action
++            [ qt:query  <basic-3-SP.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 3 SO" ;
++         mf:action
++            [ qt:query  <basic-3-SO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Basic 3 PO" ;
++         mf:action
++            [ qt:query  <basic-3-SO.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++    ) .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Data/solver-data.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Data/solver-data.ttl
index 0000000,0000000..cdbfb19
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Data/solver-data.ttl
@@@ -1,0 -1,0 +1,7 @@@
++@prefix : <http://example/> .
++
++:s :p :o .
++:s :p 10 .
++:s :p :x .
++:x :q :y .
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Loader/data-1.nq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Loader/data-1.nq
index 0000000,0000000..e9812a6
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Loader/data-1.nq
@@@ -1,0 -1,0 +1,1 @@@
++<s> <p> <o> <g> .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Loader/data-2.nt
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Loader/data-2.nt
index 0000000,0000000..81fc25f
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Loader/data-2.nt
@@@ -1,0 -1,0 +1,1 @@@
++<s> <p> <o> .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Loader/data-3.trig
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Loader/data-3.trig
index 0000000,0000000..8000cc1
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Loader/data-3.trig
@@@ -1,0 -1,0 +1,3 @@@
++prefix : <http://example/> 
++
++:g { :s :p :o }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Loader/data-4.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Loader/data-4.ttl
index 0000000,0000000..49678f1
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Loader/data-4.ttl
@@@ -1,0 -1,0 +1,4 @@@
++prefix : <http://example/> 
++
++:s :p :o .
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Pattern/data-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Pattern/data-1.ttl
index 0000000,0000000..d3a3d80
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Pattern/data-1.ttl
@@@ -1,0 -1,0 +1,17 @@@
++@prefix : <http://example/> .
++
++:x1 :p1 :z1 .
++:x1 :p1 :z2 .
++
++:x1 :p2 :z1 .
++:x1 :p2 :z2 .
++
++:x2 :p1 :z1 .
++:x2 :p1 :z2 .
++
++:x2 :p2 :z1 .
++:x2 :p2 :z2 .
++
++:x :p :x .
++:x :x :x .
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Pattern/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Pattern/manifest.ttl
index 0000000,0000000..094244b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Pattern/manifest.ttl
@@@ -1,0 -1,0 +1,35 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "Patterns" ;
++    mf:entries
++    ( 
++      [  mf:name    "Pattern 1" ;
++         mf:action
++            [ qt:query  <pattern-1.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Pattern 2" ;
++         mf:action
++            [ qt:query  <pattern-2.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++    ) .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Pattern/pattern-1.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Pattern/pattern-1.rq
index 0000000,0000000..ca7c8fc
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Pattern/pattern-1.rq
@@@ -1,0 -1,0 +1,7 @@@
++PREFIX :  <http://example/OTHER>
++
++SELECT * 
++{ 
++    :NoSuchNode ?p ?z .
++    ?x ?p ?z
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Pattern/pattern-2.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Pattern/pattern-2.rq
index 0000000,0000000..9b90038
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Pattern/pattern-2.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :  <http://example/OTHER>
++
++SELECT * 
++{ 
++    # Test shared variables
++    ?x1 :p1 ?z .
++    ?x2 :p1 ?z .
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/data-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/data-1.ttl
index 0000000,0000000..adc4239
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/data-1.ttl
@@@ -1,0 -1,0 +1,5 @@@
++@prefix : <http://example/> .
++
++:x :p 1 .
++
++:x1 :p :x .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/data-2.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/data-2.ttl
index 0000000,0000000..100a7c7
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/data-2.ttl
@@@ -1,0 -1,0 +1,5 @@@
++@prefix : <http://example/> .
++
++:x :p 1 .
++
++:x2 :p :x .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/data-dft.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/data-dft.ttl
index 0000000,0000000..a2ef718
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/data-dft.ttl
@@@ -1,0 -1,0 +1,10 @@@
++@prefix : <http://example/> .
++
++:x :p 1 .
++:x :p 2 .
++
++:y :p 1 .
++:y :p :x .
++:y :p :z .
++
++:z :q "abc" .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/manifest.ttl
index 0000000,0000000..15a46a7
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/manifest.ttl
@@@ -1,0 -1,0 +1,51 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "Quads and quad patterns" ;
++    mf:entries
++    ( 
++       [  mf:name    "Quad-1" ;
++          mf:action
++            [ qt:query  <quad-01.rq> ;
++              qt:data       <data-dft.ttl> ;
++              qt:graphData  <data-1.ttl> ;
++              qt:graphData  <data-2.ttl> ;
++             ]
++      ]
++       [  mf:name    "Quad-2" ;
++          mf:action
++            [ qt:query  <quad-02.rq> ;
++              qt:data       <data-dft.ttl> ;
++              qt:graphData  <data-1.ttl> ;
++              qt:graphData  <data-2.ttl> ;
++             ]
++      ]
++
++        ## Union of named graphs, explicitly named default graph
++        ## Complex patterns.
++
++##       [  mf:name    "Basic 00" ;
++##          mf:action
++##             [ qt:query  <basic-00.rq> ;
++##               qt:data   <data-1.ttl> ;
++##               qt:graphData ; ]
++##       ]
++    ) .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/quad-01.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/quad-01.rq
index 0000000,0000000..b705fc8
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/quad-01.rq
@@@ -1,0 -1,0 +1,9 @@@
++PREFIX : <http://example/>
++PREFIX sys: <urn:x-arq:>
++
++SELECT *
++{
++   {?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o}}
++}
++
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Quads/quad-02.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Quads/quad-02.rq
index 0000000,0000000..ef3bf2f
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Quads/quad-02.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX : <http://example/>
++PREFIX sys: <urn:x-arq:>
++
++SELECT *
++{
++  ?s ?p ?x
++   GRAPH ?g {?s1 ?p1 ?x }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/data-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/data-1.ttl
index 0000000,0000000..77be09c
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/data-1.ttl
@@@ -1,0 -1,0 +1,7 @@@
++@prefix : <http://example/> .
++
++:x :p 1 .
++:x :p 2 .
++
++
++:y :q :x .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/data-2.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/data-2.ttl
index 0000000,0000000..59ac719
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/data-2.ttl
@@@ -1,0 -1,0 +1,5 @@@
++@prefix : <http://example/> .
++
++:x :p 1 .
++:x :p 99 .
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/data-dft.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/data-dft.ttl
index 0000000,0000000..d64ddd9
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/data-dft.ttl
@@@ -1,0 -1,0 +1,5 @@@
++@prefix : <http://example/> .
++
++:x :p 11 .
++:x :p 999 .
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/manifest.ttl
index 0000000,0000000..217d229
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/manifest.ttl
@@@ -1,0 -1,0 +1,107 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix mfx:    <http://jena.hpl.hp.com/2005/05/test-manifest-extra#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "Union of named graphs" ;
++    mf:entries
++    ( 
++      [  mf:name    "Merge-1" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-1.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-1-results.srx>
++      ]
++      [  mf:name    "Merge-2" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-2.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-2-results.srx>
++      ]
++      [  mf:name    "Merge-3" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-3.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-3-results.srx>
++      ]
++      [  mf:name    "Merge-4" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-4.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-4-results.srx>
++      ]
++      [  mf:name    "Merge-5" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-5.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-5-results.srx>
++      ]
++      [  mf:name    "Merge-6" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-6.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-6-results.srx>
++      ]
++      # Queries that need more than one SQL query (currently)
++      [  mf:name    "Merge-A" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-A.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-A-results.srx>
++      ]
++      [  mf:name    "Merge-B" ;
++         rdf:type   mfx:TestQuery ; 
++         mf:action
++            [ qt:query  <merge-B.rq> ;
++              qt:data <data-dft.ttl> ;
++              qt:graphData <data-1.ttl> ;
++              qt:graphData <data-2.ttl> ;
++            ] ;
++         mf:result <merge-B-results.srx>
++      ]
++    ).

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-1-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-1-results.srx
index 0000000,0000000..f850ec3
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-1-results.srx
@@@ -1,0 -1,0 +1,57 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="s"/>
++    <variable name="p"/>
++    <variable name="o"/>
++  </head>
++  <results>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-1.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-1.rq
index 0000000,0000000..c403064
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-1.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { ?s ?p ?o }
++}
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-2-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-2-results.srx
index 0000000,0000000..18f9252
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-2-results.srx
@@@ -1,0 -1,0 +1,66 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="s"/>
++    <variable name="p"/>
++    <variable name="o"/>
++    <variable name="q"/>
++    <variable name="z"/>
++  </head>
++  <results>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-2.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-2.rq
index 0000000,0000000..27953a6
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-2.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { ?s ?p ?o . ?o ?q ?z }
++}
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-3-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-3-results.srx
index 0000000,0000000..4a65413
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-3-results.srx
@@@ -1,0 -1,0 +1,31 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="p"/>
++  </head>
++  <results>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++    </result>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++    </result>
++    <result>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++    </result>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-3.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-3.rq
index 0000000,0000000..1212926
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-3.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { [] ?p [] }
++}
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-4-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-4-results.srx
index 0000000,0000000..0b44cb2
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-4-results.srx
@@@ -1,0 -1,0 +1,99 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="s"/>
++    <variable name="p"/>
++    <variable name="o"/>
++    <variable name="q"/>
++    <variable name="z"/>
++  </head>
++  <results>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-4.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-4.rq
index 0000000,0000000..004f4bc
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-4.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph 
++    { ?s ?p ?o . OPTIONAL { ?o ?q ?z } }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-5-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-5-results.srx
index 0000000,0000000..c7d777f
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-5-results.srx
@@@ -1,0 -1,0 +1,33 @@@
++<?xml version="1.0"?>
++<sparql xmlns="http://www.w3.org/2005/sparql-results#">
++  <head>
++    <variable name="p"/>
++    <variable name="o"/>
++  </head>
++  <results>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-5.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-5.rq
index 0000000,0000000..fa9bfe3
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-5.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { :x ?p  ?o }
++}
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-6-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-6-results.srx
index 0000000,0000000..b4d31dc
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-6-results.srx
@@@ -1,0 -1,0 +1,43 @@@
++<?xml version="1.0"?>
++<sparql xmlns="http://www.w3.org/2005/sparql-results#">
++  <head>
++    <variable name="x"/>
++    <variable name="p"/>
++    <variable name="v"/>
++  </head>
++  <results>
++    <result>
++      <binding name="x">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="v">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="x">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="v">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="x">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="v">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-6.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-6.rq
index 0000000,0000000..7819cbb
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-6.rq
@@@ -1,0 -1,0 +1,7 @@@
++PREFIX :    <http://example/>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { ?x ?p  99 . ?x :p ?v }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-A-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-A-results.srx
index 0000000,0000000..1438c25
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-A-results.srx
@@@ -1,0 -1,0 +1,99 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="s"/>
++    <variable name="p"/>
++    <variable name="o"/>
++    <variable name="q"/>
++    <variable name="z"/>
++  </head>
++  <results>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">99</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="z">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="o">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-A.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-A.rq
index 0000000,0000000..7bab242
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-A.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph 
++    { ?s ?p ?o . OPTIONAL { ?o ?q ?z FILTER(?o != 123) } }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-B-results.srx
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-B-results.srx
index 0000000,0000000..60d7766
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-B-results.srx
@@@ -1,0 -1,0 +1,49 @@@
++<?xml version="1.0"?>
++<sparql
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:xs="http://www.w3.org/2001/XMLSchema#"
++    xmlns="http://www.w3.org/2005/sparql-results#" >
++  <head>
++    <variable name="s"/>
++    <variable name="p"/>
++    <variable name="o"/>
++    <variable name="q"/>
++    <variable name="v"/>
++  </head>
++  <results>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="v">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">11</literal>
++      </binding>
++    </result>
++    <result>
++      <binding name="s">
++        <uri>http://example/y</uri>
++      </binding>
++      <binding name="p">
++        <uri>http://example/q</uri>
++      </binding>
++      <binding name="o">
++        <uri>http://example/x</uri>
++      </binding>
++      <binding name="q">
++        <uri>http://example/p</uri>
++      </binding>
++      <binding name="v">
++        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">999</literal>
++      </binding>
++    </result>
++  </results>
++</sparql>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/UnionGraph/merge-B.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/UnionGraph/merge-B.rq
index 0000000,0000000..d4aceda
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/UnionGraph/merge-B.rq
@@@ -1,0 -1,0 +1,8 @@@
++PREFIX :    <http://example>
++PREFIX arq: <urn:x-arq:>
++
++SELECT *
++{
++    GRAPH arq:UnionGraph { ?s ?p ?o . }
++    { ?o ?q ?v }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Update/create-1.ru
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Update/create-1.ru
index 0000000,0000000..3276ec1
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Update/create-1.ru
@@@ -1,0 -1,0 +1,1 @@@
++CREATE GRAPH <http://example/graph>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Update/drop-1.ru
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Update/drop-1.ru
index 0000000,0000000..2512eb3
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Update/drop-1.ru
@@@ -1,0 -1,0 +1,1 @@@
++DROP GRAPH <http://example/graph>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Update/update-1.ru
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Update/update-1.ru
index 0000000,0000000..7a6b737
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Update/update-1.ru
@@@ -1,0 -1,0 +1,3 @@@
++PREFIX : <http://example/> 
++
++INSERT { :r :p 123 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Update/update-2.ru
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Update/update-2.ru
index 0000000,0000000..41e4ec0
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Update/update-2.ru
@@@ -1,0 -1,0 +1,5 @@@
++PREFIX : <http://example/> 
++
++CREATE GRAPH <http://example/g1>
++INSERT INTO GRAPH <http://example/g1>
++{ :r :p 123 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Update/update-3.ru
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Update/update-3.ru
index 0000000,0000000..17f8410
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Update/update-3.ru
@@@ -1,0 -1,0 +1,7 @@@
++PREFIX : <http://example/> 
++
++CREATE GRAPH <http://example/g1>
++INSERT INTO GRAPH <http://example/g1>
++{ :r :p 123 }
++DELETE FROM GRAPH <http://example/g1>
++{ :r :p 123 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/data-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/data-1.ttl
index 0000000,0000000..27c37dd
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/data-1.ttl
@@@ -1,0 -1,0 +1,23 @@@
++@prefix : <http://example/> .
++@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
++
++:x1 :p 1 .
++:x2 :p "1" .
++:x3 :p "1"@en .
++
++:x4 :p 1.5 .
++
++:x5 :p "2008-04-29T09:13:15+01:00"^^xsd:dateTime .
++
++:x6 :p "0008-04-29T09:13:15-01:00"^^xsd:dateTime .
++
++:x7 :p "-3000-04-29T09:13:15Z"^^xsd:dateTime .
++
++# Not encoded inline
++:x8 :p "-3000-04-29T09:13:15Z"^^xsd:dateTime .
++
++:x9 :p "2008-04-29"^^xsd:date .
++
++:x10 :p "2008-04-29Z"^^xsd:date .
++
++:x11 :p "2008-04-29+01:00"^^xsd:date .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/manifest.ttl
index 0000000,0000000..3396af5
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/manifest.ttl
@@@ -1,0 -1,0 +1,76 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "Value tests" ;
++    mf:entries
++    ( 
++      [  mf:name    "Value-00" ;
++         mf:action
++            [ qt:query  <value-00.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-01" ;
++         mf:action
++            [ qt:query  <value-01.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-02" ;
++         mf:action
++            [ qt:query  <value-02.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-03" ;
++         mf:action
++            [ qt:query  <value-03.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++
++      [  mf:name    "Value-04" ;
++         mf:action
++            [ qt:query  <value-04.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-05" ;
++         mf:action
++            [ qt:query  <value-05.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-06" ;
++         mf:action
++            [ qt:query  <value-06.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-07" ;
++         mf:action
++            [ qt:query  <value-07.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-08" ;
++         mf:action
++            [ qt:query  <value-08.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++      [  mf:name    "Value-09" ;
++         mf:action
++            [ qt:query  <value-09.rq> ;
++              qt:data   <data-1.ttl> ] ;
++      ]
++    ) .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-00.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-00.rq
index 0000000,0000000..d1fe80b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-00.rq
@@@ -1,0 -1,0 +1,1 @@@
++SELECT * { ?s ?p ?o }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-01.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-01.rq
index 0000000,0000000..664f67a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-01.rq
@@@ -1,0 -1,0 +1,1 @@@
++SELECT * { ?s ?p 1 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-02.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-02.rq
index 0000000,0000000..5dfe5ec
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-02.rq
@@@ -1,0 -1,0 +1,1 @@@
++SELECT * { ?s ?p 1.5 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-03.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-03.rq
index 0000000,0000000..7134be8
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-03.rq
@@@ -1,0 -1,0 +1,1 @@@
++SELECT * { ?s ?p "1" }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-04.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-04.rq
index 0000000,0000000..030116d
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-04.rq
@@@ -1,0 -1,0 +1,1 @@@
++SELECT * { ?s ?p "1"@en }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-05.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-05.rq
index 0000000,0000000..fbd8d9b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-05.rq
@@@ -1,0 -1,0 +1,5 @@@
++SELECT *
++{ 
++    ?s ?p ?o . 
++    FILTER(?o = 1)
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-06.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-06.rq
index 0000000,0000000..8f34124
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-06.rq
@@@ -1,0 -1,0 +1,6 @@@
++PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
++
++SELECT *
++{ 
++    ?s ?p "2008-04-29+01:00"^^xsd:date .
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-07.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-07.rq
index 0000000,0000000..cafd777
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-07.rq
@@@ -1,0 -1,0 +1,6 @@@
++PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
++
++SELECT *
++{ 
++    ?s ?p ?x . FILTER (?x = "2008-04-29+01:00"^^xsd:date) .
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-08.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-08.rq
index 0000000,0000000..e6fc284
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-08.rq
@@@ -1,0 -1,0 +1,6 @@@
++PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
++
++SELECT *
++{ 
++    ?s ?p "2008-04-29T09:13:15+01:00"^^xsd:dateTime .
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Values/value-09.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Values/value-09.rq
index 0000000,0000000..02dcc20
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Values/value-09.rq
@@@ -1,0 -1,0 +1,7 @@@
++PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
++
++SELECT *
++{ 
++    # Out of range - not an immediate literal
++    ?s ?p "-3000-04-29T09:13:15Z"^^xsd:dateTime
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/manifest.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/manifest.ttl
index 0000000,0000000..aeaf80e
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/manifest.ttl
@@@ -1,0 -1,0 +1,31 @@@
++#  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 regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  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.
++
++@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
++@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
++@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
++
++<>  rdf:type mf:Manifest ;
++    rdfs:label "TDB - Scripts" ;
++    mf:include (
++        <Basic/manifest.ttl>
++        <Pattern/manifest.ttl>
++        <Quads/manifest.ttl>
++        <Values/manifest.ttl>
++        <UnionGraph/manifest.ttl>
++    ) .
++
++

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/.gitignore
----------------------------------------------------------------------
diff --cc jena-db/tdb2/.gitignore
index 0000000,0000000..731afb6
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/.gitignore
@@@ -1,0 -1,0 +1,2 @@@
++DB*
++D.*

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/pom.xml
----------------------------------------------------------------------
diff --cc jena-db/tdb2/pom.xml
index 0000000,0000000..80cfc5a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/pom.xml
@@@ -1,0 -1,0 +1,108 @@@
++<?xml version="1.0" encoding="utf-8"?>
++<!--
++   Licensed under the Apache License, Version 2.0 (the "License");
++   you may not use this file except in compliance with the License.
++   You may obtain a copy of the License at
++ 
++       http://www.apache.org/licenses/LICENSE-2.0
++ 
++   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.
++ 
++   See the NOTICE file distributed with this work for additional
++   information regarding copyright ownership.
++-->
++
++<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
++
++  <modelVersion>4.0.0</modelVersion>
++
++  <artifactId>tdb2</artifactId>
++  <packaging>jar</packaging>
++  <name>Mantis (${project.artifactId})</name>
++
++  <parent>
++    <groupId>org.seaborne.mantis</groupId>
++    <artifactId>mantis</artifactId>
++    <version>0.3.1-SNAPSHOT</version>
++  </parent> 
++
++  <dependencies>
++
++    <!--
++        <dependency>
++        <groupId>org.seaborne.mantis</groupId>
++        <artifactId>dboe-quack</artifactId>
++        <version>0.2.0-SNAPSHOT</version>
++        </dependency>
++    -->
++    
++    <dependency>
++      <groupId>org.seaborne.mantis</groupId>
++      <artifactId>dboe-trans-data</artifactId>
++      <version>0.3.1-SNAPSHOT</version>
++    </dependency>
++
++    <dependency>
++      <groupId>org.apache.jena</groupId>
++      <artifactId>jena-core</artifactId>
++      <classifier>tests</classifier>
++      <scope>test</scope>
++    </dependency>
++
++    <dependency>
++      <groupId>org.apache.jena</groupId>
++      <artifactId>jena-arq</artifactId>
++      <classifier>tests</classifier>
++      <scope>test</scope>
++    </dependency>
++
++    <dependency>
++      <groupId>org.apache.jena</groupId>
++      <artifactId>jena-base</artifactId>
++      <classifier>tests</classifier>
++      <scope>test</scope>
++    </dependency>
++
++  </dependencies>
++
++  <build>
++    <plugins>
++      <plugin>
++        <groupId>org.apache.maven.plugins</groupId>
++        <artifactId>maven-jar-plugin</artifactId>
++        <executions>
++          <execution>
++            <goals>
++              <goal>test-jar</goal>
++            </goals>
++          </execution>
++        </executions>
++      </plugin>
++      <plugin>
++        <groupId>org.apache.maven.plugins</groupId>
++        <artifactId>maven-source-plugin</artifactId>
++        <executions>
++          <execution>
++            <id>attach-sources</id>
++            <!-- <phase>package</phase> package is the default -->
++            <goals>
++              <goal>jar-no-fork</goal>
++            </goals>
++          </execution>
++          <execution>
++            <id>attach-sources-test</id>
++            <goals>
++              <goal>test-jar-no-fork</goal>
++            </goals>
++          </execution>
++        </executions>
++      </plugin>
++
++    </plugins>
++  </build>
++  
++</project>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/DatabaseMgr.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/DatabaseMgr.java
index 0000000,0000000..098a646
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/DatabaseMgr.java
@@@ -1,0 -1,0 +1,114 @@@
++/*
++ * 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
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * 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 org.seaborne.tdb2;
++
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.sparql.core.DatasetGraph ;
++import org.seaborne.dboe.base.file.Location ;
++import org.seaborne.tdb2.store.DatasetGraphSwitchable ;
++import org.seaborne.tdb2.store.DatasetGraphTDB ;
++import org.seaborne.tdb2.sys.DatabaseConnection ;
++import org.seaborne.tdb2.sys.DatabaseOps ;
++import org.seaborne.tdb2.sys.TDBInternal ;
++
++/** Operations for TDBS DatasetGraph, including admin operations 
++ * See {@link TDB2Factory} for creating API-level {@link Dataset Datasets}.
++ * 
++ * @see TDB2Factory
++ */
++public class DatabaseMgr {
++
++    // All creation of DatasetGraph for TDB2 goes through this method.
++    private static DatasetGraph DB_ConnectCreate(Location location) {
++        return DatabaseConnection.connectCreate(location).getDatasetGraph();
++//        // One level.
++//        return StoreConnection.connectCreate(location).getDatasetGraph() ; 
++    }
++
++    /** Create or connect to a TDB2-backed dataset */
++    public static DatasetGraph connectDatasetGraph(Location location) {
++        return DB_ConnectCreate(location); 
++    }
++
++    /** Create or connect to a TDB2-backed dataset */
++    public static DatasetGraph connectDatasetGraph(String location) {
++        return connectDatasetGraph(Location.create(location)) ;
++    }
++    
++    /**
++     * Compact a datasets which must be a switchable TDB database.
++     * This is the normal dataset type for on-disk TDB2 databases.
++     *  
++     * @param container
++     */
++    public static void compact(DatasetGraph container) {
++        DatasetGraphSwitchable dsg = requireSwitchable(container);
++        DatabaseOps.compact(dsg);
++    }
++
++    /**
++     * Create a backup for a switchable TDB database. This is the normal dataset type for
++     * on-disk TDB2 databases.
++     * <p>
++     * The backup is created in the databases folder, under "Backups".
++     * <p>
++     * Backup creates a consistent copy og the database. It is performed as a read-transaction
++     * and does not lock out other use of the dataset.
++     * 
++     * @param container
++     * @return File name of the backup.
++     */
++    public static String backup(DatasetGraph container) {
++        DatasetGraphSwitchable dsg = requireSwitchable(container);
++        return DatabaseOps.backup(dsg);
++    }
++
++
++    /** Create an in-memory TDB2-backed dataset (for testing) */
++    public static DatasetGraph createDatasetGraph() {
++        return connectDatasetGraph(Location.mem()) ;
++    }
++
++    /** Return the location of a dataset if it is backed by TDB, else null */ 
++    public static boolean isBackedByTDB(DatasetGraph datasetGraph) {
++        return TDBInternal.isBackedByTDB(datasetGraph);
++    }
++
++    /** Return the location of a DatasetGraph if it is backed by TDB, else null. */
++    public static Location location(DatasetGraph datasetGraph) {
++        DatasetGraphSwitchable dsg = requireSwitchable(datasetGraph);
++        if ( dsg == null )
++            return null ;
++        return dsg.getLocation();
++    }
++
++    private static DatasetGraphSwitchable requireSwitchable(DatasetGraph datasetGraph) {
++        if ( datasetGraph instanceof DatasetGraphSwitchable )
++            return (DatasetGraphSwitchable)datasetGraph;
++        throw new TDBException("Not a switchable TDB database");
++    }
++
++    static DatasetGraphTDB requireDirect(DatasetGraph datasetGraph) {
++        DatasetGraphTDB dsg = TDBInternal.getDatasetGraphTDB(datasetGraph);
++        if ( dsg == null )
++            throw new TDBException("Not a TDB database (argument is neither a switchable nor direct TDB DatasetGraph)");
++        return dsg;
++    }
++
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2.java
index 0000000,0000000..6a18faa
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2.java
@@@ -1,0 -1,0 +1,268 @@@
++/*
++ *  Licensed under the Apache License, Version 2.0 (the "License");
++ *  you may not use this file except in compliance with the License.
++ *  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ *  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.
++ *
++ *  See the NOTICE file distributed with this work for additional
++ *  information regarding copyright ownership.
++ */
++
++package org.seaborne.tdb2 ;
++
++import org.apache.jena.atlas.lib.Sync ;
++import org.apache.jena.graph.Graph ;
++import org.apache.jena.ontology.OntModel ;
++import org.apache.jena.ontology.impl.OntModelImpl ;
++import org.apache.jena.query.ARQ ;
++import org.apache.jena.rdf.model.Model ;
++import org.apache.jena.reasoner.InfGraph ;
++import org.apache.jena.riot.lang.ReaderRIOTRDFXML;
++import org.apache.jena.sparql.SystemARQ ;
++import org.apache.jena.sparql.core.assembler.AssemblerUtils ;
++import org.apache.jena.sparql.engine.main.StageBuilder ;
++import org.apache.jena.sparql.engine.main.StageGenerator ;
++import org.apache.jena.sparql.lib.Metadata ;
++import org.apache.jena.sparql.mgt.SystemInfo ;
++import org.apache.jena.sparql.util.Context ;
++import org.apache.jena.sparql.util.MappingRegistry ;
++import org.apache.jena.sparql.util.Symbol ;
++import org.apache.jena.system.JenaSystem ;
++import org.seaborne.tdb2.assembler.VocabTDB2 ;
++import org.seaborne.tdb2.modify.UpdateEngineTDB ;
++import org.seaborne.tdb2.solver.QueryEngineTDB ;
++import org.seaborne.tdb2.solver.StageGeneratorDirectTDB ;
++import org.seaborne.tdb2.sys.EnvTDB ;
++import org.seaborne.tdb2.sys.SystemTDB ;
++import org.seaborne.tdb2.sys.TDBInternal ;
++import org.slf4j.Logger ;
++import org.slf4j.LoggerFactory ;
++
++public class TDB2 {
++    /** IRI for TDB */
++    public static final String  tdbIRI                           = "http://seaborne.org/#tdb" ;
++
++    /** Root of TDB-defined parameter names */
++    public static final String  tdbParamNS                       = "http://seaborne.org/TDB#" ;
++
++    /** Prefix for TDB-defined parameter names */
++    public static final String  tdbSymbolPrefix                  = "tdb" ;
++
++    // Internal logging
++    private static final Logger log                              = LoggerFactory.getLogger(TDB2.class) ;
++
++    /** Logger for loading information */
++    public static final String  logLoaderName                    = "org.apache.jena.tdb.loader" ;
++    /** Logger for loading information */
++    public static final Logger  logLoader                        = LoggerFactory.getLogger(logLoaderName) ;
++
++    /** Logger for general information */
++    public static final String  logInfoName                      = "org.apache.jena.info" ;
++    /** Logger for general information */
++    public static final Logger  logInfo                          = LoggerFactory.getLogger(logInfoName) ;
++
++    // /** Logger for execution information */
++    // public static final String logExecName = "org.apache.jena.tdb.exec" ;
++    // /** Logger for execution information */
++    // public static final Logger logExec = LoggerFactory.getLogger(logExecName)
++    // ;
++
++    public final static String  namespace                        = "http://jena.apache.org/2016/tdb#" ;
++
++    /** Symbol to use the union of named graphs as the default graph of a query */
++    public static final Symbol  symUnionDefaultGraph             = SystemTDB.allocSymbol("unionDefaultGraph") ;
++
++    /**
++     * A String enum Symbol that specifies the type of temporary storage for
++     * transaction journal write blocks.
++     * <p/>
++     * "mem" = Java heap memory (default) <br>
++     * "direct" = Process heap memory <br>
++     * "mapped" = Memory mapped temporary file <br>
++     */
++    public static final Symbol  transactionJournalWriteBlockMode = SystemTDB.allocSymbol("transactionJournalWriteBlockMode") ;
++
++    public static Context getContext() {
++        return ARQ.getContext() ;
++    }
++
++    /**
++     * Release any and all system resources held by TDB.
++     * All release datasets or graphs held by client code are no longer valid. 
++     */
++    public static void closedown() {
++        TDBInternal.reset() ;
++    }
++
++    /** Sync a TDB-backed Model. Do nothing if not TDB-backed. */
++    public static void sync(Model model) {
++        if ( model instanceof OntModelImpl ) {
++            OntModelImpl ontModel = (OntModelImpl)model ;
++            sync(ontModel.getBaseGraph()) ;
++            return ;
++        }
++        // This never happens (there is only one OntModel implementation)
++        if ( model instanceof OntModel ) {
++            OntModel ontModel = (OntModel)model ;
++            sync(ontModel.getBaseModel()) ;
++            return ;
++        }
++
++        sync(model.getGraph()) ;
++    }
++
++    /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */
++    public static void sync(Graph graph) {
++        if ( graph == null )
++            return ;
++
++        if ( graph instanceof InfGraph ) {
++            InfGraph infGraph = (InfGraph)graph ;
++            sync(infGraph.getRawGraph()) ;
++            return ;
++        }
++        syncObject(graph) ;
++    }
++
++//    /** Sync a TDB-backed Dataset. Do nothing if not TDB-backed. */
++//    public static void sync(Dataset dataset) {
++//        if ( dataset == null )
++//            return ;
++//        DatasetGraph ds = dataset.asDatasetGraph() ;
++//        sync(ds) ;
++//    }
++//
++//    /** Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. */
++//    public static void sync(DatasetGraph dataset) {
++//        if ( dataset == null )
++//            return ;
++//        
++//        // Should be: SystemARQ.sync(dataset) ;
++//        if ( dataset instanceof DatasetGraphTDB ) {
++//            syncObject(dataset) ;
++//            return ;
++//        }
++//
++//        if ( dataset instanceof DatasetGraphTransaction ) {
++//            DatasetGraphTransaction dsgt = (DatasetGraphTransaction)dataset ;
++//            // This only sync if the dataset has not been used transactionally.
++//            // Can't sync transactional datasets (it's meaningless)
++//            dsgt.syncIfNotTransactional() ;
++//            return ;
++//        }
++//
++//        // May be a general purpose dataset with TDB objects in it.
++//        sync(dataset.getDefaultGraph()) ;
++//        Iterator<Node> iter = dataset.listGraphNodes() ;
++//        iter = Iter.toList(iter).iterator() ; // Avoid iterator concurrency.
++//        for (; iter.hasNext();) {
++//            Node n = iter.next() ;
++//            Graph g = dataset.getGraph(n) ;
++//            sync(g) ;
++//        }
++//    }
++
++    /**
++     * Sync a TDB synchronizable object (model, graph, dataset). If force is
++     * true, synchronize as much as possible (e.g. file metadata) else make a
++     * reasonable attenpt at synchronization but does not gauarantee disk state.
++     * Do nothing otherwise
++     */
++    private static void syncObject(Object object) {
++        if ( object == null )
++            return ;
++        if ( object instanceof Sync )
++            ((Sync)object).sync() ;
++    }
++
++    private static final Object initLock = new Object() ;
++    private static volatile boolean initialized = false ;
++    static { JenaSystem.init(); }
++    
++    /**
++     * TDB System initialization - normally, this is not explicitly called
++     * because all routes to use TDB will cause initialization to occur.
++     * However, calling it repeatedly is safe and low cost.
++     */
++    public static void init() {
++        if ( initialized )
++            return ;
++        synchronized(initLock) {
++            if ( initialized ) {
++                if ( JenaSystem.DEBUG_INIT )
++                    System.err.println("TDB2.init - return") ;
++                return ;
++            }
++            initialized = true ;
++            if ( JenaSystem.DEBUG_INIT )
++                System.err.println("TDB2.init - start") ;
++
++            SystemTDB.init() ;
++            ARQ.init() ;
++            ReaderRIOTRDFXML.RiotUniformCompatibility = true ;
++            EnvTDB.processGlobalSystemProperties() ;
++
++            MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix, SystemTDB.symbolNamespace) ;
++            AssemblerUtils.init() ;
++            VocabTDB2.init() ;
++            QueryEngineTDB.register() ;
++            UpdateEngineTDB.register() ;
++            MappingRegistry.addPrefixMapping(TDB2.tdbSymbolPrefix, TDB2.tdbParamNS) ;
++
++            wireIntoExecution() ;
++            if ( JenaSystem.DEBUG_INIT )
++                System.err.println("TDB.init - finish") ;
++        }
++    }
++
++    private static void wireIntoExecution() {
++        // Globally change the stage generator to intercept BGP on TDB
++        // Globally change the stage generator to intercept BGP on TDB
++        Context cxt = ARQ.getContext() ;
++        StageGenerator orig = StageBuilder.chooseStageGenerator(cxt) ; 
++
++        // Wire in the TDB stage generator which will make TDB work whether
++        // or not the TDB executor is used. This means that datasets of mixed
++        // graph types inside a general purpose dataset work.
++        StageGenerator stageGenerator = new StageGeneratorDirectTDB(orig) ;
++        StageBuilder.setGenerator(ARQ.getContext(), stageGenerator) ;
++    }
++
++    // ---- Static constants read by modVersion
++    // ---- Must be after initialization.
++
++    static private String      metadataLocation = "org/apache/jena/tdb/tdb-properties.xml" ;
++    static private Metadata    metadata         = new Metadata(metadataLocation) ;
++
++    /** The root package name for TDB */
++    public static final String PATH             = "org.apache.jena.tdb" ;
++
++    // The names known to ModVersion : "NAME", "VERSION", "BUILD_DATE"
++
++    public static final String NAME             = "TDB" ;
++
++    /** The full name of the current TDB version */
++    public static final String VERSION          = metadata.get(PATH + ".version", "DEV") ;
++
++    /** The date and time at which this release was built */
++    public static final String BUILD_DATE       = metadata.get(PATH + ".build.datetime", "unset") ;
++
++    // Final initialization (in case any statics in this file are important).
++    static {
++        initialization2() ;
++    }
++
++    private static void initialization2() {
++        // Set management information.
++        SystemInfo systemInfo = new SystemInfo(TDB2.tdbIRI, TDB2.PATH, TDB2.VERSION, TDB2.BUILD_DATE) ;
++        SystemARQ.registerSubSystem(systemInfo) ;
++    }
++
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2Factory.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2Factory.java
index 0000000,0000000..93cc3d2
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDB2Factory.java
@@@ -1,0 -1,0 +1,124 @@@
++/*
++ *  Licensed under the Apache License, Version 2.0 (the "License");
++ *  you may not use this file except in compliance with the License.
++ *  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ *  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.
++ *
++ *  See the NOTICE file distributed with this work for additional
++ *  information regarding copyright ownership.
++ */
++
++package org.seaborne.tdb2;
++
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.query.DatasetFactory ;
++import org.apache.jena.sparql.core.DatasetGraph ;
++import org.seaborne.dboe.base.file.Location ;
++
++/**
++ *  Public factory for connecting to and creating datasets backed by TDB2 storage.
++ */
++public class TDB2Factory
++{
++    private TDB2Factory() {} 
++
++    /** @deprecated Use {@link DatabaseMgr#connectDatasetGraph(Location)} */
++    @Deprecated
++    public static DatasetGraph createDatasetGraph(Location location) {
++        return DatabaseMgr.connectDatasetGraph(location);
++    }
++    
++    /** @deprecated Use {@link #connectDataset(Location)} */
++    @Deprecated
++    public static Dataset createDataset(Location location) {
++        return connectDataset(location);
++    }
++    
++    /** Create or connect to a TDB2-backed dataset */
++    public static Dataset connectDataset(Location location) {
++        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(location) ;
++        return DatasetFactory.wrap(dsg) ;
++    }
++
++    /** @deprecated Use {@link DatabaseMgr#connectDatasetGraph(String)} */
++    @Deprecated
++    public static DatasetGraph createDatasetGraph(String location) {
++        return DatabaseMgr.connectDatasetGraph(location);
++    }
++    
++    /** @deprecated Use {@link #connectDataset(String)} */
++    @Deprecated
++    public static Dataset createDataset(String location) {
++        return connectDataset(location);
++    }
++    
++    /** Create or connect to a TDB2-backed dataset */
++    public static Dataset connectDataset(String location) {
++        return connectDataset(Location.create(location)) ;    }
++
++    /**
++     * Create an in-memory TDB2-backed dataset (for testing). In-memory TDB2 datasets are use
++     * a simple simulation of disk I/O to give exact semantics, which is useful to create
++     * tests that run fast where setup and teardown of datasets can be the major cost.
++     * <p> 
++     * In-memory TDB2 datasets are not designed to scale, nor provide efficient execution for
++     * applications for long-term use. 
++     */ 
++    public static Dataset createDataset() { return connectDataset(Location.mem()) ; }
++
++//    /**
++//     *  Read the file and assembler a dataset
++//     */
++//    public static Dataset assembleDataset(String assemblerFile) {
++//        return (Dataset)AssemblerUtils.build(assemblerFile, VocabTDB.tDatasetTDB) ;
++//    }
++//    
++//    /** Release from the JVM. All caching is lost. */
++//    public static void release(Dataset dataset) {
++//        _release(location(dataset)) ;
++//    }
++//    
++//    /** Release from the JVM.  All caching is lost. */
++//    public static void release(DatasetGraph dataset) {
++//        _release(location(dataset)) ;
++//    }
++
++    /** Tes whether a dataset is backed by TDB or not. */ 
++    public static boolean isBackedByTDB(Dataset dataset) {
++        DatasetGraph dsg = dataset.asDatasetGraph() ;
++        return DatabaseMgr.isBackedByTDB(dsg) ;
++    }
++    
++    /** Return the location of a dataset if it is backed by TDB, else null */
++    public static Location location(Dataset dataset) {
++        DatasetGraph dsg = dataset.asDatasetGraph() ;
++        return DatabaseMgr.location(dsg) ;
++    }
++
++//    /** Set the {@link StoreParams} for specific Location.
++//     *  This call must only be called before a dataset from Location
++//     *  is created. This operation should be used with care; bad choices
++//     *  of {@link StoreParams} can reduce performance.
++//     *  
++//     *  <a href="http://jena.apache.org/documentation/tdb/store-paramters.html"
++//     *  >See documentation</a>.
++//     *  
++//     *  @param location  The persistent storage location
++//     *  @param params  StoreParams to use
++//     *  @throws IllegalStateException If the dataset has already been setup.
++//     */
++//    public static void setup(Location location, StoreParams params) {
++//        StoreConnection sConn = StoreConnection.getExisting(location) ;
++//        if ( sConn != null )
++//            throw new IllegalStateException("Location is already active") ;
++//        StoreConnection.make(location, params) ;
++//    }
++    
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDBException.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDBException.java
index 0000000,0000000..2e0ea26
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/TDBException.java
@@@ -1,0 -1,0 +1,28 @@@
++/*
++ *  Licensed under the Apache License, Version 2.0 (the "License");
++ *  you may not use this file except in compliance with the License.
++ *  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ *  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.
++ *
++ *  See the NOTICE file distributed with this work for additional
++ *  information regarding copyright ownership.
++ */
++
++package org.seaborne.tdb2;
++
++import org.apache.jena.shared.JenaException ;
++
++public class TDBException extends JenaException
++{
++    public TDBException()                          { super() ; }
++    public TDBException(String msg)                { super(msg) ; }
++    public TDBException(Throwable th)              { super(th) ; }
++    public TDBException(String msg, Throwable th)  { super(msg, th) ; }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/DatasetAssemblerTDB.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/DatasetAssemblerTDB.java
index 0000000,0000000..dc2d67a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/DatasetAssemblerTDB.java
@@@ -1,0 -1,0 +1,79 @@@
++/*
++ *  Licensed under the Apache License, Version 2.0 (the "License");
++ *  you may not use this file except in compliance with the License.
++ *  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ *  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.
++ *
++ *  See the NOTICE file distributed with this work for additional
++ *  information regarding copyright ownership.
++ */
++
++package org.seaborne.tdb2.assembler;
++
++import static org.apache.jena.sparql.util.graph.GraphUtils.exactlyOneProperty ;
++import static org.apache.jena.sparql.util.graph.GraphUtils.getStringValue ;
++import static org.seaborne.tdb2.assembler.VocabTDB2.pLocation ;
++import static org.seaborne.tdb2.assembler.VocabTDB2.pUnionDefaultGraph ;
++
++import org.apache.jena.assembler.Assembler ;
++import org.apache.jena.assembler.Mode ;
++import org.apache.jena.assembler.exceptions.AssemblerException ;
++import org.apache.jena.atlas.logging.Log ;
++import org.apache.jena.graph.Node ;
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.query.DatasetFactory ;
++import org.apache.jena.rdf.model.Resource ;
++import org.apache.jena.sparql.core.DatasetGraph ;
++import org.apache.jena.sparql.core.assembler.AssemblerUtils ;
++import org.apache.jena.sparql.core.assembler.DatasetAssembler ;
++import org.apache.jena.sparql.expr.NodeValue ;
++import org.apache.jena.system.JenaSystem ;
++import org.seaborne.dboe.base.file.Location ;
++import org.seaborne.tdb2.DatabaseMgr ;
++import org.seaborne.tdb2.TDB2 ;
++
++public class DatasetAssemblerTDB extends DatasetAssembler
++{
++    static { JenaSystem.init(); }
++    
++    @Override
++    public Dataset createDataset(Assembler a, Resource root, Mode mode) {
++        TDB2.init() ;
++        return make(root) ;
++    }
++
++    static Dataset make(Resource root) {
++        if ( !exactlyOneProperty(root, pLocation) )
++            throw new AssemblerException(root, "No location given") ;
++
++        String dir = getStringValue(root, pLocation) ;
++        Location loc = Location.create(dir) ;
++        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(loc) ;
++
++        if ( root.hasProperty(pUnionDefaultGraph) ) {
++            Node b = root.getProperty(pUnionDefaultGraph).getObject().asNode() ;
++            NodeValue nv = NodeValue.makeNode(b) ;
++            if ( nv.isBoolean() )
++                dsg.getContext().set(TDB2.symUnionDefaultGraph, nv.getBoolean()) ;
++            else
++                Log.warn(DatasetAssemblerTDB.class, "Failed to recognize value for union graph setting (ignored): " + b) ;
++        }
++
++        /*
++        <r> rdf:type tdb:DatasetTDB2 ;
++            tdb:location "dir" ;
++            //ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;
++            tdb:unionGraph true ; # or "true"
++        */
++        AssemblerUtils.setContext(root, dsg.getContext());
++        return DatasetFactory.wrap(dsg) ; 
++    }
++    
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/TDBGraphAssembler.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/TDBGraphAssembler.java
index 0000000,0000000..eebe51b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2/src/main/java/org/seaborne/tdb2/assembler/TDBGraphAssembler.java
@@@ -1,0 -1,0 +1,124 @@@
++/*
++ *  Licensed under the Apache License, Version 2.0 (the "License");
++ *  you may not use this file except in compliance with the License.
++ *  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ *  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.
++ *
++ *  See the NOTICE file distributed with this work for additional
++ *  information regarding copyright ownership.
++ */
++
++package org.seaborne.tdb2.assembler;
++
++import static org.apache.jena.sparql.util.graph.GraphUtils.getAsStringValue ;
++import static org.apache.jena.sparql.util.graph.GraphUtils.getResourceValue ;
++import static org.apache.jena.sparql.util.graph.GraphUtils.getStringValue ;
++import static org.seaborne.tdb2.assembler.VocabTDB2.* ;
++
++import org.apache.jena.assembler.Assembler ;
++import org.apache.jena.assembler.Mode ;
++import org.apache.jena.assembler.assemblers.AssemblerBase ;
++import org.apache.jena.assembler.exceptions.AssemblerException ;
++import org.apache.jena.atlas.logging.Log ;
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.rdf.model.* ;
++import org.apache.jena.riot.out.NodeFmtLib ;
++import org.seaborne.dboe.base.file.Location ;
++import org.seaborne.tdb2.TDB2 ;
++import org.seaborne.tdb2.TDBException ;
++import org.seaborne.tdb2.TDB2Factory ;
++
++public class TDBGraphAssembler extends AssemblerBase implements Assembler
++{
++    @Override
++    public Model open(Assembler a, Resource root, Mode mode)
++    {
++        // In case we go via explicit index construction,
++        // although given we got here, the assembler is wired in
++        // and that probably means TDB.init
++        TDB2.init() ;
++        
++        // Make a model - the default model of the TDB dataset
++        // [] rdf:type tdb:GraphTDB ;
++        //    tdb:location "dir" ;
++        
++        // Make a named model.
++        // [] rdf:type tdb:GraphTDB ;
++        //    tdb:location "dir" ;
++        //    tdb:graphName <http://example/name> ;
++
++        // Location or dataset reference.
++        String locationDir = getStringValue(root, pLocation) ;
++        Resource dataset = getResourceValue(root, pDataset) ;
++        
++        if ( locationDir != null && dataset != null )
++            throw new AssemblerException(root, "Both location and dataset given: exactly one required") ; 
++        
++        if ( locationDir == null && dataset == null )
++            throw new AssemblerException(root, "Must give location or refer to a dataset description") ;
++        
++        String graphName = null ;
++        if ( root.hasProperty(pGraphName1) )
++            graphName = getAsStringValue(root, pGraphName1) ;
++        if ( root.hasProperty(pGraphName2) )
++            graphName = getAsStringValue(root, pGraphName2) ;
++
++        if ( root.hasProperty(pIndex) )
++            Log.warn(this, "Custom indexes not implemented yet - ignored") ;
++
++        final Dataset ds ;
++        
++        if ( locationDir != null )
++        {
++            Location location = Location.create(locationDir) ;
++            ds = TDB2Factory.connectDataset(location) ;
++        }
++        else
++            ds = DatasetAssemblerTDB.make(dataset) ;
++
++        try {
++            if ( graphName != null )
++                return ds.getNamedModel(graphName) ;
++            else
++                return ds.getDefaultModel() ;
++        } catch (RuntimeException ex)
++        {
++            ex.printStackTrace(System.err) ;
++            throw ex ;
++        }
++    }
++    
++    //@Unused
++    private void indexes(Resource root)
++    {
++        // ---- API ways
++
++        StmtIterator sIter = root.listProperties(pIndex) ;
++        while(sIter.hasNext())
++        {
++            RDFNode obj = sIter.nextStatement().getObject() ;
++            if ( obj.isLiteral() )
++            {
++                String desc = ((Literal)obj).getString() ;
++                System.out.printf("Index: %s\n", desc) ; System.out.flush();
++                continue ;
++            }
++            throw new TDBException("Wrong format for tdb:index: should be a string: found: "+NodeFmtLib.displayStr(obj)) ; 
++            //          Resource x = (Resource)obj ;
++            //          String desc = x.getProperty(pDescription).getString() ;
++            //          String file = x.getProperty(pFile).getString() ;
++            //          System.out.printf("Index: %s in file %s\n", desc, file) ; System.out.flush();
++        }
++
++        System.out.flush();
++        throw new TDBException("Custom indexes turned off") ; 
++    }
++
++}


Mime
View raw message