Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 137EF200D12 for ; Sat, 7 Oct 2017 13:45:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 11FB21609D3; Sat, 7 Oct 2017 11:45:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2EC7A1609B8 for ; Sat, 7 Oct 2017 13:45:13 +0200 (CEST) Received: (qmail 13560 invoked by uid 500); 7 Oct 2017 11:45:12 -0000 Mailing-List: contact commits-help@jena.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jena.apache.org Delivered-To: mailing list commits@jena.apache.org Received: (qmail 13551 invoked by uid 99); 7 Oct 2017 11:45:12 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Oct 2017 11:45:12 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 602783A01A6 for ; Sat, 7 Oct 2017 11:45:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1811408 - in /jena/site/trunk/content/documentation: tdb/index.mdtext tdb2/ tdb2/index.md tdb2/tdb2_admin.md tdb2/tdb2_cmds.md tdb2/tdb2_fuseki.md tdb2/tdb2_migration.md Date: Sat, 07 Oct 2017 11:45:07 -0000 To: commits@jena.apache.org From: andy@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171007114510.602783A01A6@svn01-us-west.apache.org> archived-at: Sat, 07 Oct 2017 11:45:14 -0000 Author: andy Date: Sat Oct 7 11:45:06 2017 New Revision: 1811408 URL: http://svn.apache.org/viewvc?rev=1811408&view=rev Log: TDB2 documentation Added: jena/site/trunk/content/documentation/tdb2/ jena/site/trunk/content/documentation/tdb2/index.md jena/site/trunk/content/documentation/tdb2/tdb2_admin.md jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md jena/site/trunk/content/documentation/tdb2/tdb2_fuseki.md jena/site/trunk/content/documentation/tdb2/tdb2_migration.md Modified: jena/site/trunk/content/documentation/tdb/index.mdtext Modified: jena/site/trunk/content/documentation/tdb/index.mdtext URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb/index.mdtext?rev=1811408&r1=1811407&r2=1811408&view=diff ============================================================================== --- jena/site/trunk/content/documentation/tdb/index.mdtext (original) +++ jena/site/trunk/content/documentation/tdb/index.mdtext Sat Oct 7 11:45:06 2017 @@ -1,4 +1,4 @@ -Title: TDB +Title: Apache Jena - TDB TDB is a component of [Jena](http://jena.apache.org) for RDF storage @@ -7,6 +7,12 @@ TDB can be used as a high performance RD This documentation describes the latest version, unless otherwise noted. +This is the documentation for the current standard version of TDB. +This is called TDB1 to distinguish it from the next generation version +[TDB2](../tdb2/) + +*TDB1 and TDB2 databases are not compatible.* + A TDB store can be accessed and managed with the provided command line scripts and via the Jena API. When accessed using [transactions](tdb_transactions.html) a TDB dataset is protected against corruption, unexpected process terminations and system crashes. Added: jena/site/trunk/content/documentation/tdb2/index.md URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/index.md?rev=1811408&view=auto ============================================================================== --- jena/site/trunk/content/documentation/tdb2/index.md (added) +++ jena/site/trunk/content/documentation/tdb2/index.md Sat Oct 7 11:45:06 2017 @@ -0,0 +1,30 @@ +Title: Apache Jena - TDB2 + +TDB2 is a component of +[Apache Jena](http://jena.apache.org) for RDF storage +and query. It support the full range of Jena APIs. +TDB2 can be used as a high performance RDF store on a single machine. +TDB2 can be used with Apache Jena Fuseki. + +TDB1 is the previous generation native storage system for Jena. + +Comparsed to TDB1: + +- No size limits on transactions : bulk uploads into a live Fuseki can be 100's +of millions of triples. +- Models and Graphs can be passed across transactions +- Transactional only (there is currently no "autocommit" mode). +- Better transaction control + - No queue of delayed updates + - No backlog problems. + - "Writer pays" - readers don't +- Datatypes of numerics preserved; `xsd:doubles` supported. + +*TDB2 is not compatible with TDB1* + +## Documentation + +- [Migrating from TDB1](tdb2_migration.html) +- [Use with Fuseki2](tdb2_fuseki.html) +- [Command line tools](tdb2_cmds.html) +- [Database administration](tdb2_admin.html) Added: jena/site/trunk/content/documentation/tdb2/tdb2_admin.md URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_admin.md?rev=1811408&view=auto ============================================================================== --- jena/site/trunk/content/documentation/tdb2/tdb2_admin.md (added) +++ jena/site/trunk/content/documentation/tdb2/tdb2_admin.md Sat Oct 7 11:45:06 2017 @@ -0,0 +1,4 @@ +Title: Apache Jena TDB2 - Database Administration. + +@@backup +@@admin Added: jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md?rev=1811408&view=auto ============================================================================== --- jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md (added) +++ jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md Sat Oct 7 11:45:06 2017 @@ -0,0 +1,22 @@ +Title: Apache Jena TDB2 - Command line tools. + +*TDB2 is not compatible with TDB1* + +Do not run TDB1 tools on a TDB2 database, nor run TDB2 tools on a TDB1 database. + +* `tdb2.tdbbackup` +* `tdb2.tdbdump` +* `tdb2.tdbcompact` +* `tdb2.tdbloader` +* `tdb2.tdbquery` +* `tdb2.tdbstats` +* `tdb2.tdbupdate` + +Example usage: + +``` +java -cp JENA_HOME/lib/* tdb2.tdbloader --loc file1 file2 ... +``` +where "`JENA_HOME`" is the location of an unpacked Apache Jena binary +distribution. + Added: jena/site/trunk/content/documentation/tdb2/tdb2_fuseki.md URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_fuseki.md?rev=1811408&view=auto ============================================================================== --- jena/site/trunk/content/documentation/tdb2/tdb2_fuseki.md (added) +++ jena/site/trunk/content/documentation/tdb2/tdb2_fuseki.md Sat Oct 7 11:45:06 2017 @@ -0,0 +1,83 @@ +Title: Apache Jena TDB2 - Use with Fuseki2 + +TDB2 is incorporated into Fuseki2, both in the full server, with UI, and +[Fuseki2 basic server](../fuseki2/fuseki-embedded.html#fuseki-basic). + +In each case, the database needs to be defined in a configuration file, +either a completw server configuration (see below) or as an entry in the +`FUSEKI_BASE/configuration/` area of the full server. + + +Example complete server configuration file for full or basic servers: +The base URL will be of the form `http::/_host:port_/tdb2-database`. + +``` +PREFIX : <#> +PREFIX fuseki: +PREFIX rdf: +PREFIX rdfs: +PREFIX tdb2: +PREFIX ja: + +[] rdf:type fuseki:Server ; + fuseki:services ( + <#service_tdb2> + ) . + +<#service_tdb2> rdf:type fuseki:Service ; + rdfs:label "TDB2 Service (RW)" ; + fuseki:name "tdb2-database" ; + fuseki:serviceQuery "query" ; + fuseki:serviceQuery "sparql" ; + fuseki:serviceUpdate "update" ; + fuseki:serviceUpload "upload" ; + fuseki:serviceReadWriteGraphStore "data" ; + # A separate read-only graph store endpoint: + fuseki:serviceReadGraphStore "get" ; + fuseki:dataset <#tdb_dataset_readwrite> ; + . + +<#tdb_dataset_readwrite> rdf:type *tdb2:DatasetTDB2* ; + *tdb2:location* "TDB2" ; + ## This works: tdb2:unionDefaultGraph true ; + . +``` + +This example is available in [fuseki-tdb2.ttl](https://github.com/apache/jena/tree/master/jena-fuseki2/examples/fuseki-tdb2.ttl) + +The key difference is the declared `rdf:type` of the dataset. + +Note that the Fuseki UI does not provide a way to create TDB2 databases; +a configuration file must be used. Once setup, upload, query and graph +editting will be routed to the TDB2 database. + +For a service configuration in `FUSEKI_BASE/configuration/`: + +``` +PREFIX : <#> +PREFIX fuseki: +PREFIX rdf: +PREFIX rdfs: +PREFIX tdb2: +PREFIX ja: + +<#service_tdb2> rdf:type fuseki:Service ; + rdfs:label "TDB2 Service (RW)" ; + fuseki:name "tdb2-database" ; + fuseki:serviceQuery "query" ; + fuseki:serviceQuery "sparql" ; + fuseki:serviceUpdate "update" ; + fuseki:serviceUpload "upload" ; + fuseki:serviceReadWriteGraphStore "data" ; + # A separate read-only graph store endpoint: + fuseki:serviceReadGraphStore "get" ; + fuseki:dataset <#tdb_dataset_readwrite> ; + . + + +<#tdb_dataset_readwrite> rdf:type *tdb2:DatasetTDB2* ; + *tdb2:location* "TDB2" ; + ## This works: tdb2:unionDefaultGraph true ; + . + +``` \ No newline at end of file Added: jena/site/trunk/content/documentation/tdb2/tdb2_migration.md URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_migration.md?rev=1811408&view=auto ============================================================================== --- jena/site/trunk/content/documentation/tdb2/tdb2_migration.md (added) +++ jena/site/trunk/content/documentation/tdb2/tdb2_migration.md Sat Oct 7 11:45:06 2017 @@ -0,0 +1,24 @@ +Title: Apache Jena TDB2 - Migration from TDB1. + +Simple migration of code is to use `TDB2Factory` in place of TDBFactory to create +datasets. `DatasetGraph` objects are now created via `DatabaseMgr`. + +Beware that many classes have the same name in TDB1 and TDB2 but are in +different packages. The API package for TDB2 is `org.apache.jena.tdb2`. + +Example code: **`TDB2Factory`** + +``` +import org.apache.jena.tdb2.TDB2Factory; +... + + public static void main(String[] args) { + Dataset ds = TDB2Factory.createDataset() ; + Txn.execWrite(ds, ()->{ + RDFDataMgr.read(ds, "SomeData.ttl"); + }) ; + Txn.execRead(dsg, ()->{ + RDFDataMgr.write(System.out, ds, Lang.TRIG) ; + }) ; + } +```