Return-Path: X-Original-To: apmail-incubator-jena-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-jena-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 082C69C31 for ; Tue, 1 Nov 2011 00:40:39 +0000 (UTC) Received: (qmail 55682 invoked by uid 500); 1 Nov 2011 00:40:39 -0000 Delivered-To: apmail-incubator-jena-commits-archive@incubator.apache.org Received: (qmail 55661 invoked by uid 500); 1 Nov 2011 00:40:38 -0000 Mailing-List: contact jena-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-dev@incubator.apache.org Delivered-To: mailing list jena-commits@incubator.apache.org Received: (qmail 55654 invoked by uid 99); 1 Nov 2011 00:40:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 00:40:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 00:40:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3597E23889EA for ; Tue, 1 Nov 2011 00:40:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r797817 [1/3] - /websites/staging/jena/trunk/content/jena/documentation/tdb/ Date: Tue, 01 Nov 2011 00:40:13 -0000 To: jena-commits@incubator.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111101004014.3597E23889EA@eris.apache.org> Author: buildbot Date: Tue Nov 1 00:40:11 2011 New Revision: 797817 Log: Staging update by buildbot Added: websites/staging/jena/trunk/content/jena/documentation/tdb/architecture.html websites/staging/jena/trunk/content/jena/documentation/tdb/assembler.html websites/staging/jena/trunk/content/jena/documentation/tdb/commands.html websites/staging/jena/trunk/content/jena/documentation/tdb/configuration.html websites/staging/jena/trunk/content/jena/documentation/tdb/datasets.html websites/staging/jena/trunk/content/jena/documentation/tdb/dynamic_datasets.html websites/staging/jena/trunk/content/jena/documentation/tdb/installation.html websites/staging/jena/trunk/content/jena/documentation/tdb/java_api.html websites/staging/jena/trunk/content/jena/documentation/tdb/joseki_integration.html websites/staging/jena/trunk/content/jena/documentation/tdb/jvm_64_32.html websites/staging/jena/trunk/content/jena/documentation/tdb/optimizer.html websites/staging/jena/trunk/content/jena/documentation/tdb/quadfilter.html websites/staging/jena/trunk/content/jena/documentation/tdb/requirements.html websites/staging/jena/trunk/content/jena/documentation/tdb/value_canonicalization.html Modified: websites/staging/jena/trunk/content/jena/documentation/tdb/index.html Added: websites/staging/jena/trunk/content/jena/documentation/tdb/architecture.html ============================================================================== --- websites/staging/jena/trunk/content/jena/documentation/tdb/architecture.html (added) +++ websites/staging/jena/trunk/content/jena/documentation/tdb/architecture.html Tue Nov 1 00:40:11 2011 @@ -0,0 +1,298 @@ + + + + + + + Apache Jena - TDB Architecture + + + + + + + + + + +
+

TDB Architecture

+

This page gives an overview of the TDB architecture. Specific +details refer to TDB 0.8.

+

Contents

+ +

Terminology

+

Terms like "table" and "index" are used in this description. They +don't directly correspond to concepts in SQL, For example, in SQL +terms, there is no triple table; that can be seen as just having +indexes for the table or, alternatively, there are 3 tables, each +of which has a primary key and TDB manages the relationship between +them.

+

Design

+

A dataset backed by TDB is stored in a single directory in the +filing system. A dataset consists of

+
    +
  • The node table
  • +
  • Triple and Quad indexes
  • +
  • The prefixes table
  • +
+

The Node Table

+

The node table stores the representation of RDF terms (except for +inlined value - see below). It provides two mappings from Node to +NodeId and from NodeId to Node. This is sometimes called a +dictionary.

+

The Node to NodeId mapping is used during data loading and when +converting constant terms in queries from their Jena Node +representation to the TDB-specific internal ids.

+

The NodeId to Node mapping is used to turn query results expressed +as TDB NodeIds into the Jena Node representation and also during +query processing when filters are applied if the whole node +representation is needed for testing (e.g. regex).

+

Node table implementations usually provide a large cache - the +NodeId to Node mapping is heavily used in query processing yet the +same NodeId can appear in many query results.

+

NodeIds are 8 byte quantities. The Node to NodeId mapping is based +on hash of the Node (a 128 bit MD5 hash - the length was found not +to major performance factor).

+

The default storage of the node table is a sequential access file +for the NodeId to Node mapping and a B+Tree for the Node to NodeId +mapping.

+

Triple and Quad indexes

+

Quads are used for named graphs, triples for the default graph. +Triples are held as 3-tuples of NodeIds in triple indexes - quads +as 4-tuples. Otherwise they are handled in the same manner.

+

The triple table is 3 indexes - there is no distinguished triple +table with secondary indexes. Instead, each index has all the +information about a triple.

+

The default storage of each indexes

+

Prefixes Table

+

The prefixes table uses a node table and a index for GPU +(Graph->Prefix->URI). It is usually small. It does not take part +in query processing. It provides support for Jena's PrefixMappings +used mainly for presentation and for serialisation of triples in +RDF/XML +or +Turtle.

+

TDB B+Trees

+

Many of the persistent data structures in TDB use a custom +implementation of threaded +B+Trees. +The TDB implementation only provides for fixed length key and fixed +length value. There is no use of the value part in triple indexes.

+

The threaded nature means that long scans of indexes proceeds +without needing to traverse the branches of the tree.

+

See the description of index caching below.

+

Inline values

+

Values of certain datatypes are held as part of the NodeId in the +bottom 56 bits. The top 8 bits indicates the type - external NodeId +or the value space.

+

The value spaces handled are (TDB 0.8): xsd:decimal, xsd:integer, +xsd:dateTime, xsd:date and xsd:boolean. Each has it's own encoding +to fit in 56 bits. If a node falls outside of the range of values +that can be represented in the 56 bit encoding.

+

The xsd:dateTime and xsd:date ranges cover about 8000 years from +year zero with a precision down to 1 millisecond. Timezone +information is retained to an accuracy of 15 minutes with special +timezones for Z and for no explicit timezone.

+

By storing the value, the exact lexical form is not recorded. The +integers 01 and 1 will both be treated as a the value 1.

+

Derived XSD datatypes are held as their base type. The exact +datatype is not retained; the value of the RDF term is.

+

Query Processing

+

TDB uses the +OpExecutor extension point of ARQ. +TDB provides low level optimization of basic graph patterns using a +statistics based optimizer.

+

Caching on 32 and 64 bit Java systems

+

TDB runs on both 32-bit and 64-bit Java Virtual Machines. The same +file formats are used on both systems and database files can be +transferred between architectures (no TDB system should be running +for the the database at the time of copy). What differs is the file +access mechanism used.

+

TDB is faster on a 64 bit JVM because more memory is available for +file caching.

+

The node table caches are always in the Java heap.

+

The file access mechanism can be set explicitly, but this is not a +good idea for production usage, only for experimentation - see the +File Access mode option.

+

On 64-bit Java, TDB uses memory mapped files, accessed 8M segments, +and the operating system handles caching between RAM and disk. The +amount of RAM used for file caching increases and decreases as +other application run on the machine. The fewer other programs +running on the machine, the more RAM will be available for file +caching. The mapped address space counts as part of the application +processes memory usage but this space is not part of the Java +heap.

+

On a 32 bit JVM, this approach does not work because Java +addressing is limited to about 1.5Gbytes (the exact figure is JVM +specific and includes any memory mapped file usage) and this would +limit the size of TDB datasets. Instead, TDB provides an in-heap +LRU cache of B+Tree blocks. Applications should set the JVM heap to +1G or above (within the JVM specific limit).

+

On 32-bit Java, TDB uses it's own file caching to enable large +databases. 32-bit Java limits the address space of the JVM to about +1.5Gbytes (the exact size is JVM-dependent), and this includes +memory mapped files, even though they are not in the Java heap. The +JVM heap size may need to be increased to make space for the disk +caches used by TDB.

+
+ + + + + Added: websites/staging/jena/trunk/content/jena/documentation/tdb/assembler.html ============================================================================== --- websites/staging/jena/trunk/content/jena/documentation/tdb/assembler.html (added) +++ websites/staging/jena/trunk/content/jena/documentation/tdb/assembler.html Tue Nov 1 00:40:11 2011 @@ -0,0 +1,365 @@ + + + + + + + Apache Jena - TDB Assembler + + + + + + + + + + +
+

TDB Assembler

+

Assemblers +are a general mechanism in Jena to describe objects to be built, +often these objects are models and datasets. Assemblers are used +heavily in +Joseki for +datset and model descriptions, for example.

+

SPARQL queries operate over an +RDF dataset, +which is a unnamed, default graph and zero or more named graphs.

+

Having the description in a file means that the data that the +application is going to work on can be changed without changing the +program code.

+

Contents

+ +

Dataset

+

This is needed for use in Fuseki or +Joseki.

+

A dataset can be constructed in an assembler file:

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
+tdb:GraphTDB    rdfs:subClassOf  ja:Model      .
+
+<#dataset> rdf:type         tdb:DatasetTDB ;
+    tdb:location "DB" ;
+    .
+
+ + +

Only one dataset can be stored in a location (filing system +directory).

+

The first section declares the prefixes used later:

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+ + +

then there is a statement that causes TDB to be loaded. TDB +initialization occurs automatically when loaded. The TDB jar must +be on the Java classpath.

+

While order in this file does not matter to the machine, because in +this case the jena assembler system checks for any ja:loadClass +statements before any attempt to assemble an object is made, having +it early in the file is helpful to any person looking at the file.

+
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+
+ + +

And finally there is the description of the TDB dataset itself:

+
<#graph> rdf:type tdb:DatasetTDB ;
+    tdb:location "DB" ;
+
+ + +

The property tdb:location gives the file name as a string. It is +relative to the applications current working directory, not where +the assembler file is read from.

+

The dataset description is usually found by looking for the one +subject with type tdb:GraphDataset. If more than one graph is +given in a single file, the application will have to specify which +description it wishes to use.

+

Union Default Graph

+

An assembler can specify that the default graph for query is the +union of the named graphs. This is done by adding +tdb:unionDefaultGraph.

+
<#dataset> rdf:type         tdb:DatasetTDB ;
+    tdb:location "DB" ;
+    tdb:unionDefaultGraph true ;
+    .
+
+ + +

Graph

+

A single graph can be described as well:

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+
+ <#graph> rdf:type tdb:GraphTDB ;
+     tdb:location "DB" .
+
+ + +

but note that this graph is a single graph at that location; it is +the default graph of a dataset.

+

A particular named graph in the dataset at a location can be +assembled with:

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+
+<#graph> rdf:type tdb:GraphTDB ;
+     tdb:location "DB" ;
+     tdb:graphName <http://example/graph1> ;
+     .
+
+ + +

It is also possible to describe a graph, or named graph, in a +dataset where the dataset description can now be shared:

+
<#graph2> rdf:type tdb:GraphTDB ;
+     tdb:dataset <#dataset> ;
+     .
+
+<#dataset> rdf:type tdb:DatasetTDB ;
+   tdb:location "DB" ;
+   .
+
+ + +

Mixed Datasets

+

It is possible to create a dataset with graphs backed by different +storage subsystems, although query is not necessarily as +efficient.

+

To include as a named graph in a dataset use vocabulary as shown +below:

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
+tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
+tdb:GraphTDB    rdfs:subClassOf  ja:Model .
+
+# A dataset of one TDB-backed graph as the default graph and an in-memory graph as a named graph.
+<#dataset> rdf:type      ja:RDFDataset ;
+     ja:defaultGraph <#graph> ;
+     ja:namedGraph
+        [ ja:graphName      <http://example.org/name1> ;
+          ja:graph          <#graph2> ] ;
+     .
+
+<#graph> rdf:type tdb:GraphTDB ;
+    tdb:location "DB" ;
+    .
+
+<#graph2> rdf:type ja:MemoryModel ;
+     ja:content [ja:externalContent <file:Data/books.n3> ] ;
+     .
+
+ + +

Note here we added:

+
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
+tdb:GraphTDB    rdfs:subClassOf  ja:Model .
+
+ + +

which provides for integration with complex model setups, such as +reasoners.

+

RDFS

+

(to be finished)

+
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+tdb:Dataset a rdfs:Class .
+tdb:GraphTDB a rdfs:Class .
+
+tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
+tdb:GraphTDB    rdfs:subClassOf  ja:Model .
+
+tdb:location a rdf:Property ;
+   # domain is tdb:Dataset or tdb:GraphTDB
+   # The range is simple literal
+   .
+
+tdb:unionDefaultGraph a rdf:Property ;
+   rdfs:domain tdb:Dataset ;
+   # The range is xsd:boolean
+   .
+
+tdb:graphName a rdf:Property ;
+   rdfs:domain tdb:GraphTDB ;
+   # range is a URI
+   .
+
+
+ + + + + Added: websites/staging/jena/trunk/content/jena/documentation/tdb/commands.html ============================================================================== --- websites/staging/jena/trunk/content/jena/documentation/tdb/commands.html (added) +++ websites/staging/jena/trunk/content/jena/documentation/tdb/commands.html Tue Nov 1 00:40:11 2011 @@ -0,0 +1,269 @@ + + + + + + + Apache Jena - TDB Command-line Utilities + + + + + + + + + + +
+

TDB Command-line Utilities

+

Contents

+ +

Scripts

+

The directory bin/ contains shell scripts to run the commands +from the command line. The scripts are bash scripts which also run +over Cygwin.

+

Script set up

+

Set the environment variable TDBROOT to the root of the the TDB +installation.

+

They are bash scripts, and work on Linux and Cygwin for MS +Windows.

+
 $ PATH=$TDBROOT/bin:$PATH
+
+ + +

Alternatively, there are wrapper scripts in $TDBROOT/bin2 which +can be placed in a convenient directory that is already on the +shell command path.

+

Argument Structure

+

Each command then has command-specific arguments described below.

+

All commands support --help to give details of named and +positional arguments.

+

There are two equivalent forms of named argument syntax:

+
--arg=val
+
+--arg val
+
+ + +

Setting options from the command line

+

TDB has a number of +configuration options +which can be set from the command line using:

+
 --set tdb:symbol=value
+
+ + +

Using tdb: is really a short hand for the URI prefix +http://jena.hpl.hp.com/TDB# so the full URI form is

+
 --set http://jena.hpl.hp.com/TDB#symbol=value
+
+ + +

TDB Commands

+

Store description

+

TDB commands use an assembler description for the persistent store

+
--desc=assembler.ttl
+--tdb=assembler.ttl
+
+ + +

or a direct reference to the directory with the index and node +files:

+
--loc=DIRECTORY
+--location=DIRECTORY
+
+ + +

The assembler description follow the form for a dataset given in +TDB assembler description page.

+

If neither assembler file nor location is given, --desc=tdb.ttl +is assumed.

+

tdbloader

+

Bulk loader and index builder. Performans bulk load operations more +efficiently than simply reading RDF into a TDB-back model.

+

tdbloader2

+

Bulk loader and index builder. Faster than tdbloader but only works +on Linux and Mac OS/X.

+

This bulk loader can only be used to create a database. It may +overwrite existing data. It only accepts the --loc argument and a +list of files to load.

+

tdbquery

+

Invoke a SPARQL query on a store. Use --time for timing +information. The store is attached on each run of this command so +timing includes some overhead not present in a running system.

+

Details about query execution can be obtained -- see notes on the +TDB Optimizer.

+

tdbdump

+

(Version 0.8.5)

+

Dump the store in +N-Quads +format.

+

tdbstats

+

Produce a statistics for the dataset. See the +TDB Optimizer description..

+
+ + + + + Added: websites/staging/jena/trunk/content/jena/documentation/tdb/configuration.html ============================================================================== --- websites/staging/jena/trunk/content/jena/documentation/tdb/configuration.html (added) +++ websites/staging/jena/trunk/content/jena/documentation/tdb/configuration.html Tue Nov 1 00:40:11 2011 @@ -0,0 +1,273 @@ + + + + + + + Apache Jena - TDB Configuration + + + + + + + + + + +
+

TDB Configuration

+

There are a number of configuration options that affect the +operation of TDB.

+

Contents

+ +

Setting Options

+

Options can be set globally, through out the JVM, or on a per query +execution basis. TDB uses the same mechanism as +ARQ.

+

There is a global context, which is give to each query query +execution as it is created. Modifications to the global context +after the query execution is created are not seen by the query +execution. Modifications to the context of a single query execution +do not affect any other query execution nor the global context.

+

A context is a set of symbol/value pairs. Symbols are used created +internal to ARQ and TDB and accessed via Java constants. Values are +any Java object, together with the values true and false, which +are short for the constants of class java.lang.Boolean.

+

Setting globally:

+
 TDB.getContext().set(symbol, value) ;
+
+ + +

Per query execution:

+
 QueryExecution qExec = QueryExecutionFactory.create(...) ;
+ qExec.getContext().set(symbol, value) ;
+
+ + +

Setting for a query execution happens before any query compilation +or setup happens. Creation of a query execution object does not +compile the query, which happens when the appropriate .exec +method is called.

+

Setting from the command line

+

Options can also set from the +command line.

+

Setting with Java System properties

+

(TDB 0.8.5 and later)

+

Options can be set when invoking the JVM using the Java system +properties as set by "-D".

+

Query of the union of named graphs

+

See TDB/Datasets.

+

Logging Query Execution

+

If the symbol "tdb:logExec" is set to "true", and also the logger +com.hp.hpl.jena.tdb.exec is enabled fro level "info", then each +basic graph patterns is logged before execution. This pattern +logged is after substitution of variable values and after +optimization by the +BGP optimizer.

+

Dataset Caching

+

(TDB 0.8.0 and later)

+

TDB caches datasets based on the location of the backing directory. +Within a single JVM, all attempts to create or open a dataset at a +particular location go through the same dataset (and same disk +caching). Therefore, an application can open the same location +several times in different places in the code and still get the +same underlying dataset for query and update.

+

Note that closing the dataset closes it everywhere (the opening +calls are not being reference counted).

+

File Access Mode

+

The context symbol can be set to "mapped" or "direct". Unset, or +the value "default", ask TDB to use to make the choice based on +JVM. Leaving it to the default is strongly encouraged.

+

TDB Configuration Symbols

+

Configuration Symbols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolJava ConstantEffectDefault
tdb:logExecTDB.symLogExecLog execution of BGPs. Set to "true" to enable. Must also enable the logger "com.hp.hpl.jena.tdb.exec". e.g. log4j.properties log4j.logger.com.hp.hpl.jena.tdb.exec=INFOunset
tdb:unionDefaultGraphTDB.symUnionDefaultGraphQuery patterns on the default graph match against the union of the named graphs.unset
tdb:fileModeSystemTDB.fileModeForce use of memory mapped files ("mapped") or direct file caching ("direct"). See discussion of TDB on 32 or 64 bit hardware, especially limitations of memory mapped files on 32 bit Java.Set by the system based on 32 or 64 bit java.
+
+ + + + + Added: websites/staging/jena/trunk/content/jena/documentation/tdb/datasets.html ============================================================================== --- websites/staging/jena/trunk/content/jena/documentation/tdb/datasets.html (added) +++ websites/staging/jena/trunk/content/jena/documentation/tdb/datasets.html Tue Nov 1 00:40:11 2011 @@ -0,0 +1,233 @@ + + + + + + + Apache Jena - TDB Datasets + + + + + + + + + + +
+

TDB Datasets

+

An +RDF Dataset +is a collection of one, unnamed, default graph and zero, or more +named graphs. In a SPARQL query, a query pattern is matched against +the default graph unless the GRAPH keyword is applied to a +pattern.

+

Dataset Storage

+

One file location (directory) is used to store one RDF dataset. The +unnamed graph of the dataset is held as a single graph while all +the named graphs are held in a collection of quad indexes.

+

Every dataset is obtained via TDBFactory.createDataset(Location) +within a JVM is the same dataset. If a model is obtained from via +TDBFactory.createModel(Location) there is a hidden, shared dataset +and the appropriate model is returned.

+

Dataset Query

+

There is full support for SPARQL query over named graphs in a +TDB-back dataset.

+

All the named graphs can be treated as a single graph which is the +union (RDF merge) of all the named graphs. This is given the +special graph name <urn:x-arq:UnionGraph> in a GRAPH pattern.

+

When querying the RDF merge of named graphs, the default graph in +the store is not included. This feature applies to queries only. It +does not affect the storage nor does it change loading.

+

Alternatively, if the symbol tdb:unionDefaultGraph (see +TDB Configuration) is +set, the unnamed graph for the query is the union of all the named +graphs in the datasets. The stored default graph is ignored and is +not part of the the data of the union graph although it is +accessible by the special name <urn:x-arq:DefaultGraph\> in a GRAPH +pattern.

+

Set globally:

+
TDB.getContext().set(TDB.symUnionDefaultGraph, true) ;
+
+ + +

or set on a per query basis:

+
QueryExecution qExec = QueryExecutionFactory.create(...) ;
+qExec.getContext().set(TDB.symUnionDefaultGraph, true) ;
+
+ + +

Special Graph Names

+ + + + + + + + + + + + + + + + + +
URIMeaning
urn:x-arq:UnionGraphThe RDF merge of all the named graphs in the datasets of the query.
urn:x-arq:DefaultGraphThe default graph of the dataset, used when the default graph of the query is the union graph.
+

Note that setting tdb:unionDefaultGraph does not affect the default +graph or default model obtained with dataset.getDefaultModel().

+

The RDF merge of all named graph can be accessed as the named graph +urn:x-arq:UnionGraph using +Dataset.getNamedModel("urn:x-arq:UnionGraph") .

+
+ + + + +