You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by gi...@apache.org on 2024/03/29 12:18:06 UTC
(jena-site) branch asf-site updated: Updated site from main (23128afbf952f097f4aed594d6709deb58ab00f0)
This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/jena-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new b87eb3d97 Updated site from main (23128afbf952f097f4aed594d6709deb58ab00f0)
b87eb3d97 is described below
commit b87eb3d975e082271b931a760df28c2a112afbcd
Author: jenkins <bu...@apache.org>
AuthorDate: Fri Mar 29 12:18:02 2024 +0000
Updated site from main (23128afbf952f097f4aed594d6709deb58ab00f0)
---
content/about_jena/about.html | 2 +-
content/about_jena/architecture.html | 2 +-
content/about_jena/index.xml | 2 +-
content/documentation/archive/sdb/commands.html | 14 +-
.../documentation/archive/sdb/configuration.html | 8 +-
.../archive/sdb/dataset_description.html | 10 +-
content/documentation/archive/sdb/javaapi.html | 70 +-
.../documentation/archive/sdb/loading_data.html | 4 +-
content/documentation/archive/sdb/quickstart.html | 2 +-
.../archive/sdb/store_description.html | 18 +-
.../archive/serving_data/fuseki1.html | 104 +--
.../documentation/assembler/assembler-howto.html | 514 ++++++------
content/documentation/assembler/index.html | 43 +-
.../documentation/assembler/inside-assemblers.html | 21 +-
.../documentation/extras/querybuilder/index.html | 280 ++++---
.../fuseki2/fuseki-data-access-control.html | 235 +++---
.../geosparql/geosparql-assembler.html | 139 ++--
.../documentation/geosparql/geosparql-fuseki.html | 53 +-
content/documentation/geosparql/index.html | 112 ++-
content/documentation/index.xml | 21 +-
content/documentation/inference/index.html | 521 ++++++-------
content/documentation/io/json-ld-11.html | 18 +-
content/documentation/io/rdfxml-input.html | 4 +-
content/documentation/io/rdfxml-output.html | 2 +-
content/documentation/io/rdfxml_howto.html | 46 +-
content/documentation/notes/rdf-frames.html | 22 +-
content/documentation/ontology/index.html | 38 +-
content/documentation/query/algebra.html | 10 +-
content/documentation/query/app_api.html | 4 +-
content/documentation/query/arq-query-eval.html | 20 +-
content/documentation/query/assignment.html | 2 +-
content/documentation/query/explain.html | 4 +-
content/documentation/query/extension.html | 4 +-
content/documentation/query/group-by.html | 3 +-
content/documentation/query/library-function.html | 4 +-
content/documentation/query/library-propfunc.html | 12 +-
content/documentation/query/logging.html | 10 +-
.../query/manipulating_sparql_using_arq.html | 34 +-
content/documentation/query/programmatic.html | 2 +-
content/documentation/query/property_paths.html | 4 +-
content/documentation/query/rdf_lists.html | 4 +-
content/documentation/query/select_expr.html | 9 +-
content/documentation/query/support_request.html | 4 +-
content/documentation/query/text-query.html | 31 +-
content/documentation/query/writing_functions.html | 5 +-
content/documentation/tdb/assembler.html | 50 +-
content/documentation/tdb/configuration.html | 2 +-
content/documentation/tdb/datasets.html | 2 +-
content/documentation/tdb/dynamic_datasets.html | 8 +-
content/documentation/tdb/faqs.html | 6 +-
content/documentation/tdb/java_api.html | 30 +-
content/documentation/tdb/optimizer.html | 22 +-
content/documentation/tdb/store-parameters.html | 56 +-
content/documentation/tdb/tdb_transactions.html | 2 +-
content/documentation/tdb2/tdb2_admin.html | 23 +-
content/documentation/tdb2/tdb2_fuseki.html | 115 ++-
content/documentation/txn/transactions_api.html | 189 +++--
content/documentation/txn/txn.html | 229 +++---
content/download/index.html | 19 +-
content/download/maven.html | 64 +-
content/index.json | 2 +-
content/index.xml | 35 +-
content/sitemap.xml | 164 ++--
content/tutorials/index.xml | 12 +-
content/tutorials/rdf_api.html | 25 +-
content/tutorials/rdf_api_pt.html | 858 ++++++++++-----------
content/tutorials/sparql.html | 6 +-
content/tutorials/sparql_basic_patterns.html | 105 ++-
content/tutorials/sparql_basic_patterns_pt.html | 103 ++-
content/tutorials/sparql_data.html | 130 ++--
content/tutorials/sparql_data_pt.html | 124 ++-
content/tutorials/sparql_datasets.html | 230 +++---
content/tutorials/sparql_datasets_pt.html | 221 +++---
content/tutorials/sparql_filters.html | 94 ++-
content/tutorials/sparql_filters_pt.html | 84 +-
content/tutorials/sparql_optionals.html | 208 +++--
content/tutorials/sparql_optionals_pt.html | 182 +++--
content/tutorials/sparql_pt.html | 2 +-
content/tutorials/sparql_query1.html | 39 +-
content/tutorials/sparql_query1_pt.html | 55 +-
content/tutorials/sparql_results.html | 24 +-
content/tutorials/sparql_results_pt.html | 14 +-
content/tutorials/sparql_union.html | 162 ++--
content/tutorials/sparql_union_pt.html | 158 ++--
84 files changed, 3016 insertions(+), 3309 deletions(-)
diff --git a/content/about_jena/about.html b/content/about_jena/about.html
index dad0257e4..1717224c2 100644
--- a/content/about_jena/about.html
+++ b/content/about_jena/about.html
@@ -183,7 +183,7 @@
</nav>
</aside>
<article class="flex-column me-lg-4">
- <p>Jena is a Java framework for building Semantic Web applications. It provides a
+ <p>Jena is a Java framework for building Semantic Web applications. It provides an
extensive Java libraries for helping developers develop code that
handles RDF, RDFS, RDFa, OWL and SPARQL in line with
published <a href="https://www.w3.org/2001/sw/">W3C recommendations</a>.
diff --git a/content/about_jena/architecture.html b/content/about_jena/architecture.html
index 25ced9efc..effa0cd68 100644
--- a/content/about_jena/architecture.html
+++ b/content/about_jena/architecture.html
@@ -185,7 +185,7 @@ defined interfaces between them. First let’s start with the big picture:</
<p>RDF triples and graphs, and their various components, are accessed through Jena’s
RDF API. Typical abstractions here are <code>Resource</code> representing an
RDF resource (whether named with a URI or anonymous), <code>Literal</code> for data
-values (numbers, strings, dates, etc), <code>Statement</code> representing an RDF
+values (numbers, strings, dates, etc.), <code>Statement</code> representing an RDF
triple and <code>Model</code> representing the whole graph. The RDF API has basic
facilities for adding and removing triples to graphs and finding triples that match
particular patterns. Here you can also read in RDF from external sources, whether
diff --git a/content/about_jena/index.xml b/content/about_jena/index.xml
index 64880becc..8917ffedc 100644
--- a/content/about_jena/index.xml
+++ b/content/about_jena/index.xml
@@ -85,7 +85,7 @@ an API for reading, processing and writing RDF data in XML, N-triples and Turtle
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/about_jena/about.html</guid>
- <description>Jena is a Java framework for building Semantic Web applications. It provides a extensive Java libraries for helping developers develop code that handles RDF, RDFS, RDFa, OWL and SPARQL in line with published W3C recommendations. Jena includes a rule-based inference engine to perform reasoning based on OWL and RDFS ontologies, and a variety of storage strategies to store RDF triples in memory or on disk.
+ <description>Jena is a Java framework for building Semantic Web applications. It provides an extensive Java libraries for helping developers develop code that handles RDF, RDFS, RDFa, OWL and SPARQL in line with published W3C recommendations. Jena includes a rule-based inference engine to perform reasoning based on OWL and RDFS ontologies, and a variety of storage strategies to store RDF triples in memory or on disk.
History Jena was originally developed by researchers in HP Labs, starting in Bristol, UK, in 2000.</description>
</item>
diff --git a/content/documentation/archive/sdb/commands.html b/content/documentation/archive/sdb/commands.html
index aef7e18b8..a82e00803 100644
--- a/content/documentation/archive/sdb/commands.html
+++ b/content/documentation/archive/sdb/commands.html
@@ -285,16 +285,16 @@ read, then any command line arguments used to modify the
description, then the appropriate object is created from the
modified description.</p>
<p>Set the layout type:</p>
-<pre><code> --layout : layout name
+<pre><code> --layout : layout name
</code></pre>
<p>Currently, one of <code>layout1</code>, <code>layout2</code>, <code>layout2/index</code>,
<code>layout2/hash</code>.</p>
<p>Set JDBC details:</p>
-<pre><code> --dbName : Database Name
- --dbHost : Host machine name
- --dbType : Database type.
- --dbUser : Database use
- --dbPassword : Database password.
+<pre><code> --dbName : Database Name
+ --dbHost : Host machine name
+ --dbType : Database type.
+ --dbUser : Database use
+ --dbPassword : Database password.
</code></pre>
<p>The host name can <code>host</code> or <code>host:port</code>.</p>
<p>The better way to handle passwords is to use environment variables
@@ -344,7 +344,7 @@ line.</p>
<td>Create indexes for querying</td>
</tr>
<tr>
-<td><code>--dropIndexes</code> </td>
+<td><code>--dropIndexes</code></td>
<td>Drop indexes for querying.</td>
</tr>
</tbody>
diff --git a/content/documentation/archive/sdb/configuration.html b/content/documentation/archive/sdb/configuration.html
index d93e98a15..a2fee81b4 100644
--- a/content/documentation/archive/sdb/configuration.html
+++ b/content/documentation/archive/sdb/configuration.html
@@ -224,11 +224,11 @@ internal to ARQ and SDB and access via Java constants. Values are
any Java object, together with the values <code>true</code> and <code>false</code>, which
are short for the constants of class <code>java.lang.Boolean</code>.</p>
<p>Setting globally:</p>
-<pre><code> SDB.getContext().set(symbol, value) ;
+<pre><code> SDB.getContext().set(symbol, value) ;
</code></pre>
<p>Per query execution:</p>
-<pre><code> QueryExecution qExec = QueryExecutionFactory.create(...) ;
- qExec.getContext.set(symbol, value) ;
+<pre><code> QueryExecution qExec = QueryExecutionFactory.create(...) ;
+ qExec.getContext.set(symbol, value) ;
</code></pre>
<p>Setting for a query execution happens before any query compilation
or setup happens. Creation of a query execution object does not
@@ -312,7 +312,7 @@ also setting the Graph API to streaming.</p>
<p>SQL generation can include SQL comments to show how SPARQL has been
turned into SQL. This option is <code>true</code> by default and always set
for the command <code>sdbprint</code>.</p>
-<pre><code>SDB.getContext().setFalse(SDB.annotateGeneratedSQL) ;
+<pre><code>SDB.getContext().setFalse(SDB.annotateGeneratedSQL) ;
</code></pre>
</article>
diff --git a/content/documentation/archive/sdb/dataset_description.html b/content/documentation/archive/sdb/dataset_description.html
index 34c828bff..3242de1aa 100644
--- a/content/documentation/archive/sdb/dataset_description.html
+++ b/content/documentation/archive/sdb/dataset_description.html
@@ -218,10 +218,10 @@ PREFIX sdb: <http://jena.hpl.hp.com/2007/sdb#>
sdb:DatasetStore rdfs:subClassOf ja:RDFDataset .
-<#dataset> rdf:type sdb:DatasetStore ;
+<#dataset> rdf:type sdb:DatasetStore ;
sdb:store <#store> .
-<#store> rdf:type sdb:Store ;
+<#store> rdf:type sdb:Store ;
...
.
</code></pre>
@@ -233,12 +233,12 @@ Java object is created.</p>
at the API level rather than at the query level, the following can
be added to an assembler description:</p>
<pre><code># Default graph
-<#myModel1> rdf:type sdb:Model ;
+<#myModel1> rdf:type sdb:Model ;
sdb:dataset <#dataset> .
# Named graph
-<#myModel2> rdf:type sdb:Model ;
- sdb:namedGraph data:graph1 ;
+<#myModel2> rdf:type sdb:Model ;
+ sdb:namedGraph data:graph1 ;
sdb:dataset <#dataset> .
</code></pre>
<p>There can several model descriptions in the same file, referring to
diff --git a/content/documentation/archive/sdb/javaapi.html b/content/documentation/archive/sdb/javaapi.html
index c069a51cb..6ac13b25a 100644
--- a/content/documentation/archive/sdb/javaapi.html
+++ b/content/documentation/archive/sdb/javaapi.html
@@ -261,7 +261,7 @@ different databases (e.g. testing and production) by changing a
configuration file, and not the code, which would require
recompilation and a rebuild.</p>
<p>To create a <code>Store</code> from a store assembler</p>
-<pre><code> Store store = SDBFactory.connectStore("sdb.ttl") ;
+<pre><code> Store store = SDBFactory.connectStore("sdb.ttl") ;
</code></pre>
<p>The assembler file has two parts, the connection details and the
store type.</p>
@@ -270,15 +270,15 @@ store type.</p>
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .
- _:c rdf:type sdb:SDBConnection ;
- sdb:sdbType "derby" ;
- sdb:sdbName "DB/SDB2" ;
- sdb:driver "org.apache.derby.jdbc.EmbeddedDriver" ;
+ _:c rdf:type sdb:SDBConnection ;
+ sdb:sdbType "derby" ;
+ sdb:sdbName "DB/SDB2" ;
+ sdb:driver "org.apache.derby.jdbc.EmbeddedDriver" ;
.
- [] rdf:type sdb:Store ;
- sdb:layout "layout2" ;
- sdb:connection _:c ;
+ [] rdf:type sdb:Store ;
+ sdb:layout "layout2" ;
+ sdb:connection _:c ;
.
</code></pre>
<p>See the full details of
@@ -288,11 +288,11 @@ for the options.</p>
<p>The less flexible way to create a store description is to build it
in Java. For example:</p>
<pre><code> StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
- DatabaseType.Derby) ;
- JDBC.loadDriverDerby() ;
+ DatabaseType.Derby) ;
+ JDBC.loadDriverDerby() ;
String jdbcURL = "jdbc:derby:DB/SDB2";
- SDBConnection conn = new SDBConnection(jdbcURL, null, null) ;
- Store store = SDBFactory.connectStore(conn, storeDesc) ;
+ SDBConnection conn = new SDBConnection(jdbcURL, null, null) ;
+ Store store = SDBFactory.connectStore(conn, storeDesc) ;
</code></pre>
<h3 id="database-user-and-password">Database User and Password</h3>
<p>The user and password for the database can be set in explicitly in
@@ -316,7 +316,7 @@ result in any database or JDBC connection actions.</p>
SDB connection information is ignored when reading to get just the
store description. The store description can be kept across store
creations:</p>
-<pre><code> storeDesc = StoreDesc.read("sdb.ttl") ;
+<pre><code> storeDesc = StoreDesc.read("sdb.ttl") ;
</code></pre>
<p>then used with an JDBC connection object passed from the connection
container:</p>
@@ -324,18 +324,18 @@ container:</p>
StoreDesc storeDesc,
Connection jdbcConnection)
{
- Query query = QueryFactory.create(queryString) ;
+ Query query = QueryFactory.create(queryString) ;
- SDBConnection conn = SDBFactory.createConnection(jdbcConnection) ;
+ SDBConnection conn = SDBFactory.createConnection(jdbcConnection) ;
- Store store = SDBFactory.connectStore(conn, storeDesc) ;
+ Store store = SDBFactory.connectStore(conn, storeDesc) ;
- Dataset ds = SDBFactory.connectDataset(store) ;
+ Dataset ds = SDBFactory.connectDataset(store) ;
try(QueryExecution qe = QueryExecutionFactory.create(query, ds)) {
- ResultSet rs = qe.execSelect() ;
- ResultSetFormatter.out(rs) ;
+ ResultSet rs = qe.execSelect() ;
+ ResultSetFormatter.out(rs) ;
}
- store.close() ;
+ store.close() ;
}
</code></pre>
<h2 id="formatting-or-emptying-the-store">Formatting or Emptying the Store</h2>
@@ -362,23 +362,23 @@ implementation of that interface.</p>
<a href="../query/app_api.html">querying with ARQ</a>.
SDB is an ARQ query engine that can handle queries made on an RDF
dataset which is of the SDB class <code>DatasetStore</code>:</p>
-<pre><code> Dataset ds = DatasetStore.create(store) ;
+<pre><code> Dataset ds = DatasetStore.create(store) ;
</code></pre>
<p>This is then used as normal with ARQ:</p>
-<pre><code> Dataset ds = DatasetStore.create(store) ;
+<pre><code> Dataset ds = DatasetStore.create(store) ;
try(QueryExecution qe = QueryExecutionFactory.create(query, ds)) {
- ResultSet rs = qe.execSelect() ;
- ResultSetFormatter.out(rs) ;
+ ResultSet rs = qe.execSelect() ;
+ ResultSetFormatter.out(rs) ;
}
</code></pre>
<p>When finished, the store should be closed to release any resources
associated with the particular implementation. Closing a store does
<em>not</em> close it’s JDBC connection.</p>
-<pre><code> store.close() ;
+<pre><code> store.close() ;
</code></pre>
<p>Closing the SDBConnection <em>does</em> close the JDBC connection:</p>
-<pre><code> store.getConnection().close() ;
- store.close() ;
+<pre><code> store.getConnection().close() ;
+ store.close() ;
</code></pre>
<p>If models or graphs backed by SDB are placed in a general Dataset
then the query is not efficiently executed by SDB.</p>
@@ -386,17 +386,17 @@ then the query is not efficiently executed by SDB.</p>
<p>A Jena model can be connected to one graph in the store and used
with all the Jena API operations.</p>
<p>Here, the graph for the model is the default graph:</p>
-<pre><code> Store store = SDBFactory.connectStore("sdb.ttl") ;
- Model model = SDBFactory.connectDefaultModel(store) ;
+<pre><code> Store store = SDBFactory.connectStore("sdb.ttl") ;
+ Model model = SDBFactory.connectDefaultModel(store) ;
- StmtIterator sIter = model.listStatements() ;
- for ( ; sIter.hasNext() ; )
+ StmtIterator sIter = model.listStatements() ;
+ for ( ; sIter.hasNext() ; )
{
- Statement stmt = sIter.nextStatement() ;
- System.out.println(stmt) ;
+ Statement stmt = sIter.nextStatement() ;
+ System.out.println(stmt) ;
}
- sIter.close() ;
- store.close() ;
+ sIter.close() ;
+ store.close() ;
</code></pre>
<p>SDB is optimized for SPARQL queries but queries and other Jena API
operations can be mixed. The results from a SPARQL query are Jena
diff --git a/content/documentation/archive/sdb/loading_data.html b/content/documentation/archive/sdb/loading_data.html
index 06948ba72..9b60a1538 100644
--- a/content/documentation/archive/sdb/loading_data.html
+++ b/content/documentation/archive/sdb/loading_data.html
@@ -229,11 +229,11 @@ add operation.</p>
</code></pre>
<p><strong>Failing to notify the end of the operations will result in data loss</strong>.</p>
<p>A try/finally block can ensure that the finish is notified.</p>
-<pre><code> model.notifyEvent(GraphEvents.startRead) ;
+<pre><code> model.notifyEvent(GraphEvents.startRead) ;
try {
... do add/remove operations ...
} finally {
- model.notifyEvent(GraphEvents.finishRead) ;
+ model.notifyEvent(GraphEvents.finishRead) ;
}
</code></pre>
<p>The <code>model.read</code> operations do this automatically.</p>
diff --git a/content/documentation/archive/sdb/quickstart.html b/content/documentation/archive/sdb/quickstart.html
index f73808a50..1677cc0b8 100644
--- a/content/documentation/archive/sdb/quickstart.html
+++ b/content/documentation/archive/sdb/quickstart.html
@@ -236,7 +236,7 @@ execute in a reasonable time.</p>
<pre><code> $ sdbconfig --sdb sdb.ttl --index
</code></pre>
<h3 id="query">Query</h3>
-<pre><code> $ sdbquery --sdb sdb.ttl 'SELECT * WHERE { ?s a ?p }'
+<pre><code> $ sdbquery --sdb sdb.ttl 'SELECT * WHERE { ?s a ?p }'
$ sdbquery --sdb sdb.ttl --file query.rq
</code></pre>
diff --git a/content/documentation/archive/sdb/store_description.html b/content/documentation/archive/sdb/store_description.html
index ebcd85fa4..12efda659 100644
--- a/content/documentation/archive/sdb/store_description.html
+++ b/content/documentation/archive/sdb/store_description.html
@@ -222,8 +222,8 @@ in J2EE application servers.</p>
<h2 id="store-descriptions">Store Descriptions</h2>
<p>A store description identifies which storage layout is being used,
the connection to use and the database type.</p>
-<pre><code> [] rdf:type sdb:Store ;
- sdb:layout "layout2" ;
+<pre><code> [] rdf:type sdb:Store ;
+ sdb:layout "layout2" ;
sdb:connection <#conn> .
<#conn> ...
@@ -244,15 +244,15 @@ same.</p>
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .
-<#myStore> rdf:type sdb:Store ;
- sdb:layout "layout2" ;
- sdb:connection <#conn> ;
+<#myStore> rdf:type sdb:Store ;
+ sdb:layout "layout2" ;
+ sdb:connection <#conn> ;
.
-<#conn> rdf:type sdb:SDBConnection ;
- sdb:sdbType "derby" ;
- sdb:sdbName "DB/SDB2" ;
- sdb:driver "org.apache.derby.jdbc.EmbeddedDriver" ;
+<#conn> rdf:type sdb:SDBConnection ;
+ sdb:sdbType "derby" ;
+ sdb:sdbName "DB/SDB2" ;
+ sdb:driver "org.apache.derby.jdbc.EmbeddedDriver" ;
.
</code></pre>
<p>Examples of assembler files are to be found in the <code>Store/</code>
diff --git a/content/documentation/archive/serving_data/fuseki1.html b/content/documentation/archive/serving_data/fuseki1.html
index 9214b2181..ed45fee7c 100644
--- a/content/documentation/archive/serving_data/fuseki1.html
+++ b/content/documentation/archive/serving_data/fuseki1.html
@@ -272,12 +272,12 @@ download.</p>
</li>
</ol>
<p>The server logging goes to the console:</p>
-<pre><code>09:25:41 INFO Fuseki :: Dataset: in-memory
-09:25:41 INFO Fuseki :: Update enabled
-09:25:41 INFO Fuseki :: Fuseki development
-09:25:41 INFO Fuseki :: Jetty 7.2.1.v20101111
-09:25:41 INFO Fuseki :: Dataset = /ds
-09:25:41 INFO Fuseki :: Started 2011/01/06 09:25:41 GMT on port 3030
+<pre><code>09:25:41 INFO Fuseki :: Dataset: in-memory
+09:25:41 INFO Fuseki :: Update enabled
+09:25:41 INFO Fuseki :: Fuseki development
+09:25:41 INFO Fuseki :: Jetty 7.2.1.v20101111
+09:25:41 INFO Fuseki :: Dataset = /ds
+09:25:41 INFO Fuseki :: Started 2011/01/06 09:25:41 GMT on port 3030
</code></pre>
<h2 id="user-interface">User Interface</h2>
<p>The Fuseki download includes a number of services:</p>
@@ -305,7 +305,7 @@ selected dataset.</p>
<pre><code>s-get http://localhost:3030/ds/data default
</code></pre>
<p>Query it with SPARQL using the …/query endpoint.</p>
-<pre><code>s-query --service http://localhost:3030/ds/query 'SELECT * {?s ?p ?o}'
+<pre><code>s-query --service http://localhost:3030/ds/query 'SELECT * {?s ?p ?o}'
</code></pre>
<p>Update it with SPARQL using the …/update endpoint.</p>
<pre><code>s-update --service http://localhost:3030/ds/update 'CLEAR DEFAULT'
@@ -420,8 +420,8 @@ and protocol details. For example, to load in a file <code>data.rdf</code>:</p>
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
-<#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
+<#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
.
</code></pre>
<p>The form:</p>
@@ -430,9 +430,9 @@ and protocol details. For example, to load in a file <code>data.rdf</code>:</p>
<p>is a shorthand for such an assembler with location <code>DB</code>.</p>
<p>To make triples from all the named graphs appear as the default,
unnamed graph, use:</p>
-<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
- tdb:unionDefaultGraph true ;
+<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
+ tdb:unionDefaultGraph true ;
.
</code></pre>
<h2 id="fuseki-server-and-general-dataset-descriptions">Fuseki Server and general dataset descriptions</h2>
@@ -445,19 +445,19 @@ to build a variety of model and datasets types.</p>
<a href="/documentation/assembler/">assembler documentation</a> and <a href="/documentation/assembler/assembler-howto.html">assembler howto</a>.</p>
<p>A general dataset is described by:</p>
<pre><code># Dataset of default graph and one named graph.
-<#dataset> rdf:type ja:RDFDataset ;
- ja:defaultGraph <#modelDft> ;
+<#dataset> rdf:type ja:RDFDataset ;
+ ja:defaultGraph <#modelDft> ;
ja:namedGraph
- [ ja:graphName <http://example.org/name1> ;
- ja:graph <#model1> ] ;
+ [ ja:graphName <http://example.org/name1> ;
+ ja:graph <#model1> ] ;
.
-<#modelDft> a ja:MemoryModel ;
+<#modelDft> a ja:MemoryModel ;
ja:content [ ja:externalContent <file:Data.ttl> .
-<#model1> rdf:type ja:MemoryModel ;
- ja:content [ ja:externalContent <file:FILE-1.ttl> ] ;
- ja:content [ ja:externalContent <file:FILE-2.ttl> ] ;
+<#model1> rdf:type ja:MemoryModel ;
+ ja:content [ ja:externalContent <file:FILE-1.ttl> ] ;
+ ja:content [ ja:externalContent <file:FILE-2.ttl> ] ;
.
</code></pre>
<p>The models can be
@@ -479,19 +479,19 @@ split to allow for commentary.</p>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
-@prefix : <#> .
+@prefix : <#> .
</code></pre>
<h3 id="server-section">Server Section</h3>
<p>Order of the file does not matter to the machine, but it’s useful
to start with the server description, then each of the services
with its datasets.</p>
-<pre><code>[] rdf:type fuseki:Server ;
+<pre><code>[] rdf:type fuseki:Server ;
# Server-wide context parameters can be given here.
# For example, to set query timeouts: on a server-wide basis:
# Format 1: "1000" -- 1 second timeout
# Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
# See java doc for ARQ.queryTimeout
- # ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
+ # ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "10000" ] ;
# Services available. Only explicitly listed services are configured.
# If there is a service description not linked from this list, it is ignored.
@@ -513,16 +513,16 @@ Initially, the dataset is empty.</p>
<pre><code>## ---------------------------------------------------------------
## Updatable in-memory dataset.
-<#service1> rdf:type fuseki:Service ;
- fuseki:name "ds" ; # http://host:port/ds
- fuseki:serviceQuery "query" ; # SPARQL query service
- fuseki:serviceQuery "sparql" ; # SPARQL query service
- fuseki:serviceUpdate "update" ; # SPARQL query service
- fuseki:serviceUpload "upload" ; # Non-SPARQL upload service
- fuseki:serviceReadWriteGraphStore "data" ; # SPARQL Graph store protocol (read and write)
+<#service1> rdf:type fuseki:Service ;
+ fuseki:name "ds" ; # http://host:port/ds
+ fuseki:serviceQuery "query" ; # SPARQL query service
+ fuseki:serviceQuery "sparql" ; # SPARQL query service
+ fuseki:serviceUpdate "update" ; # SPARQL query service
+ fuseki:serviceUpload "upload" ; # Non-SPARQL upload service
+ fuseki:serviceReadWriteGraphStore "data" ; # SPARQL Graph store protocol (read and write)
# A separate read-only graph store endpoint:
- fuseki:serviceReadGraphStore "get" ; # SPARQL Graph store protocol (read only)
- fuseki:dataset <#dataset-mem> ;
+ fuseki:serviceReadGraphStore "get" ; # SPARQL Graph store protocol (read only)
+ fuseki:dataset <#dataset-mem> ;
.
<#dataset-mem> rdf:type ja:RDFDataset .
@@ -534,38 +534,38 @@ SPARQl Graph Store protocol). The dataset is a single in-memory
graph:</p>
<p>This service offers read-only access to a dataset with a single
graph of data.</p>
-<pre><code><#service2> rdf:type fuseki:Service ;
- fuseki:name "books" ; # http://host:port/books
- fuseki:serviceQuery "query" ; # SPARQL query service
- fuseki:serviceReadGraphStore "data" ; # SPARQL Graph store protocol (read only)
- fuseki:dataset <#books> ;
+<pre><code><#service2> rdf:type fuseki:Service ;
+ fuseki:name "books" ; # http://host:port/books
+ fuseki:serviceQuery "query" ; # SPARQL query service
+ fuseki:serviceReadGraphStore "data" ; # SPARQL Graph store protocol (read only)
+ fuseki:dataset <#books> ;
.
-<#books> rdf:type ja:RDFDataset ;
- rdfs:label "Books" ;
+<#books> rdf:type ja:RDFDataset ;
+ rdfs:label "Books" ;
ja:defaultGraph
- [ rdfs:label "books.ttl" ;
- a ja:MemoryModel ;
- ja:content [ja:externalContent <file:Data/books.ttl> ] ;
- ] ;
+ [ rdfs:label "books.ttl" ;
+ a ja:MemoryModel ;
+ ja:content [ja:externalContent <file:Data/books.ttl> ] ;
+ ] ;
.
</code></pre>
<h3 id="service-3">Service 3</h3>
<p>This service offers SPARQL query access only to a TDB database. The
TDB database can have specific features set, such as query timeout
or making the default graph the union of all named graphs.</p>
-<pre><code><#service3> rdf:type fuseki:Service ;
- fuseki:name "tdb" ; # http://host:port/tdb
- fuseki:serviceQuery "sparql" ; # SPARQL query service
- fuseki:dataset <#dataset> ;
+<pre><code><#service3> rdf:type fuseki:Service ;
+ fuseki:name "tdb" ; # http://host:port/tdb
+ fuseki:serviceQuery "sparql" ; # SPARQL query service
+ fuseki:dataset <#dataset> ;
.
-<#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
+<#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
# Query timeout on this dataset (1s, 1000 milliseconds)
- ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "1000" ] ;
+ ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "1000" ] ;
# Make the default graph be the union of all named graphs.
- ## tdb:unionDefaultGraph true ;
+ ## tdb:unionDefaultGraph true ;
.
</code></pre>
<h2 id="sparql-over-http">SPARQL Over HTTP</h2>
@@ -584,7 +584,7 @@ s-get http://localhost:3030/ds/data default
s-put http://localhost:3030/ds/data http://example/graph D.nt
# Query
-s-query --service http://localhost:3030/ds/query 'SELECT * {?s ?p ?o}'
+s-query --service http://localhost:3030/ds/query 'SELECT * {?s ?p ?o}'
# Update
s-update --service http://localhost:3030/ds/update --file=update.ru
diff --git a/content/documentation/assembler/assembler-howto.html b/content/documentation/assembler/assembler-howto.html
index 645c47763..bf397d242 100644
--- a/content/documentation/assembler/assembler-howto.html
+++ b/content/documentation/assembler/assembler-howto.html
@@ -240,11 +240,10 @@ constructed by specifying a base model and a reasoner. The
specifications for the components are themselves Assembler
specifications given by other Resources in the same Model.For
example, to specify a memory model with data loaded from a file:</p>
-<pre><code>eg:model a ja:MemoryModel
- ; ja:content [ja:externalContent <file:////home/kers/projects/jena2/doc/assembler/Data/example.n3>]
- .
-</code></pre>
-<p>The <code>rdf:type</code> of <code>eg:model</code> specifies that the constructed Model is to
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">model</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>;<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><file:////home/kers/projects/jena2/doc/ [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The <code>rdf:type</code> of <code>eg:model</code> specifies that the constructed Model is to
be a Jena memory-based model. The <code>ja:content</code> property specifies
that the model is to be loaded with the content of the resource
<code>file:Data/example.n3</code>. The content handler guesses from the “.n3”
@@ -264,11 +263,10 @@ this document, we will usually leave out inferrable types.</p>
<p>We can construct our example model from the specification like this
(you may need to tweak the filename to make this work in your
environment):</p>
-<pre><code>Model spec = RDFDataMgr.loadModel( "examples.ttl" );
-Resource root = spec.createResource( spec.expandPrefix( "eg:opening-example" ) );
-Model m = Assembler.general.openModel( root );
-</code></pre>
-<p>The model is constructed from the “root resource”,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model spec <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span> <span style="color:#b44">"examples.ttl"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource root <span style="color:#666">=</span> spec<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span> spec<span style="color:#666">.</span><span style="color:#b44">expandPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"eg:opening-example"</span> <span style="color:#666">)</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Model m <span style="color:#666">=</span> Assembler<span style="color:#666">.</span><span style="color:#b44">general</span><span style="color:#666">.</span><span style="color:#b44">openModel</span><span style="color:#666">(</span> root <span style="color:#666">);</span>
+</span></span></code></pre></div><p>The model is constructed from the “root resource”,
<code>eg:opening-example</code> in our example. <code>general</code> knows how to create
all the kinds of objects - not just Models - that we describe in
the next sections.</p>
@@ -277,43 +275,41 @@ the next sections.</p>
inference, ontology, and file-backed. All of these model
specifications share a set of base properties for attaching
content and prefix mappings.</p>
-<pre><code>ja:Loadable a rdfs:Class ;
- rdfs:subClassOf ja:Object
-.
-ja:initialContent a rdf:Property ;
- rdfs:domain ja:Loadable
- rdfs:range ja:Content
-.
-ja:content a rdf:Property ;
- rdfs:domain ja:Loadable ;
- rdfs:range ja:Content
-.
-
-ja:Model a rdfs:Class ;
- rdfs:subClassOf ja:ContentItem ;
- rdfs:subClassOf ja:Loadable
-.
-
-ja:prefixMapping a rdf:Property ;
- rdfs:domain ja:Model ;
- rdfs:range ja:PrefixMapping
-.
-</code></pre>
-<p>All of a model’s <code>ja:content</code> property values are interpreted as
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Loadable</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">initialContent</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Loadable</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Content</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Loadable</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Content</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">Class</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ContentItem</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Loadable</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">prefixMapping</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">PrefixMapping</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>All of a model’s <code>ja:content</code> property values are interpreted as
specifying <code>Content</code> objects and a single composite <code>Content</code>
object is constructed and used to initialise the model. See
<a href="#content-specification">Content</a> for the description of Content
specifications. For example:</p>
-<pre><code>eg:sharedContent
- ja:externalContent <http://somewhere/RDF/ont.owl>
- .
-eg:common-example a ja:MemoryModel ;
- ja:content eg:sharedContent ;
- ja:content [ja:externalContent <file:////home/kers/projects/jena2/doc/assembler/Data/A.rdf>] ;
- ja:content [ja:externalContent <file:////home/kers/projects/jena2/doc/assembler/Data/B.rdf>]
- .
-</code></pre>
-<p>The model constructed for <code>eg:A</code> will be loaded with the contents
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">sharedContent</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/RDF/ont.owl></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">common-example</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">MemoryModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">sharedContent</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><file:////home/kers/projects/jena2/doc/assembler/Data/A.rdf></span>] [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><file:////home/kers/projects/jena2/doc/assembler/Data/B.rdf></span>] [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The model constructed for <code>eg:A</code> will be loaded with the contents
of <code>Data/A.n3</code>, <code>Data/B.rdf</code>, and <code>http://somewhere/RDF/ont.owl</code>.
If the model supports transactions, then the content is loaded
inside a transaction; if the load fails, the transaction is
@@ -330,29 +326,27 @@ Content specifications.</p>
models. Content can be external (files and URLs) or literal
(strings in the specification) or quotations (referring to RDF
which is part of the specification).</p>
-<pre><code>ja:Content a rdfs:Class ;
- rdfs:subClassOf ja:HasFileManager
-.
-
-ja:HasFileManager a rdfs:Class ;
- rdfs:subClassOf ja:Object
-.
-ja:fileManager a rdf:Property ;
- rdfs:domain ja:HasFileManager ;
- rdfs:range ja:FileManager
-.
-</code></pre>
-<p>A <code>ja:Content</code> specification may have zero or more
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Content</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasFileManager</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasFileManager</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">Class</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">fileManager</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasFileManager</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">FileManager</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>A <code>ja:Content</code> specification may have zero or more
<code>ja:externalContent</code> property values. These are URI resources
naming an external (file or http etc) RDF object. The constructed
Content object contains the union of the values of all such
resources. For example:</p>
-<pre><code>eg:external-content-example
- ja:externalContent <file:////home/kers/projects/jena2/doc/assembler/Data/C.owl>,
- <http://jena.hpl.hp.com/some-jena-data.rdf>
- .
-</code></pre>
-<p>The external content is located using a <code>FileManager</code>. If the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">external-content-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><file:////home/kers/projects/jena2/doc/assembler/Data/C.owl></span>,<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/some-jena-data.rdf></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The external content is located using a <code>FileManager</code>. If the
<code>Content</code> resource has a <code>ja:fileManager</code> property, then the
<code>FileManager</code> described by that resource is used. Otherwise, if the
<code>ContentAssembler</code> assembling this specification was constructed
@@ -365,11 +359,10 @@ Content object contains that RDF. The language is either specified
by an explicit <code>ja:contentEncoding</code> property value, or guessed from
the content of the string. The only encodings permitted are “N3”
and “RDF/XML”. For example:</p>
-<pre><code>eg:literal-content-example
- ja:literalContent "_:it dc:title 'Interesting Times'"
- .
-</code></pre>
-<p>The literal content is wrapped so that prefix declarations for
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">literal-content-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">literalContent</span><span style="color:#bbb"> </span><span style="color:#b44">"_:it dc:title 'Interesting Times'"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The literal content is wrapped so that prefix declarations for
<strong>rdf</strong>, <strong>rdfs</strong>, <strong>owl</strong>, <strong>dc</strong>, and <strong>xsd</strong> apply before
interpretation.</p>
<p>The property values of any <code>ja:quotedContent</code> properties should be
@@ -380,35 +373,32 @@ content.</p>
<p>Inference models are specified by supplying a description of the
reasoner that is used by the model and (optionally) a base model to
reason over. For example:</p>
-<pre><code>eg:inference-example
- ja:baseModel [a ja:MemoryModel] ;
- ja:reasoner [ja:reasonerURL <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner>]
- .
-</code></pre>
-<p>describes an inference model that uses RDFS reasoning. The
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">inference-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span>[<span style="">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">MemoryModel</span>]<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerURL</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner></span>]<span style=" [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>describes an inference model that uses RDFS reasoning. The
<em>reasonerURL</em> property value is the URI used to identify the
reasoner (it is the value of the Jena constant
<code>RDFSRuleReasonerFactory.URI</code>). The base model is specified as a
memory model; if it is left out, an empty memory model is used.</p>
-<pre><code>eg:db-inference-example
- ja:baseModel eg:model-example ;
- ja:reasoner [ja:reasonerURL <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner>]
- .
-</code></pre>
-<p>The same reasoner as used as in the previous example, but now the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">db-inference-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">model-example</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerURL</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner></span>]<span style="co [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The same reasoner as used as in the previous example, but now the
base model is a specific model description in the same way as our earlier
example.</p>
<p>Because Jena’s access to external reasoners goes through the same
API as for its internal reasoners, you can access a DIG reasoner
(such as Pellet running as a server) using an Assembler
specification:</p>
-<pre><code>eg:external-inference-example
- ja:reasoner [<http://jena.hpl.hp.com/2003/JenaReasoner#extReasonerURL>
- <http://localhost:2004/> ;
- ja:reasonerURL <http://jena.hpl.hp.com/2003/DIGReasoner>]
- .
-</code></pre>
-<p>If there’s a DIG server running locally on port 2004, this
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">external-inference-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner</span><span style="color:#bbb"> </span>[<span style="color:#b8860b"><http://jena.hpl.hp.com/2003/JenaReasoner#extReasonerURL></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://localhost:2004/></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerURL</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/2003/DIGReasoner></span>]<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>If there’s a DIG server running locally on port 2004, this
specification will create a DIG inference model that uses it.</p>
<p>The internal rule reasoner can be supplied with rules written
inside the specification, or outside from some resource (file or
@@ -419,35 +409,34 @@ ja:reasoner [ja:rule “[r1: (?x my:P ?y) -> (?x rdf:type my:T)]”]
<p>This reasoner will infer a type declaration from a use of a
property. (The prefix <em>my</em> will have to be known to the rule
parser, of course.)</p>
-<pre><code>ja:InfModel a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:reasoner; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:baseModel; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:Model
-.
-ja:reasoner a rdf:Property ;
- rdfs:domain ja:InfModel ;
- rdfs:range ja:ReasonerFactory
-.
-ja:baseModel a rdf:Property ;
- rdfs:domain ja:InfModel ;
- rdfs:range ja:Model
-.
-
-ja:HasRules a rdfs:Class ;
- rdfs:subClassOf ja:Object
-.
-ja:rule a rdf:Property ;
- rdfs:domain ja:HasRules
-.
-ja:rulesFrom a rdf:Property ;
- rdfs:domain ja:HasRules
-.
-ja:rules a rdf:Property ;
- rdfs:domain ja:HasRules ;
- rdfs:range ja:RuleSet
-.
-</code></pre>
-<p>An InfModel’s <code>ja:baseModel</code> property value specifies the base
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">InfModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseMode [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">InfModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">InfModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">Class</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">rule</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">rulesFrom</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">rules</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">RuleSet</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>An InfModel’s <code>ja:baseModel</code> property value specifies the base
model for the inference model; if omitted, an empty memory model is
used.</p>
<p>An InfModel’s <code>ja:ReasonerFactory</code> property value specifies the
@@ -462,22 +451,21 @@ rules of the implied <code>RuleSet</code> are added to the <code>Reasoner</code>
<h4 id="reasonerfactory">ReasonerFactory</h4>
<p>A ReasonerFactory can be specified by URL or by class name (but not
both).</p>
-<pre><code>ja:ReasonerFactory a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:ReasonerURL; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:HasRules
-.
-ja:reasonerClass a rdf:Property ;
- rdfs:domain ja:ReasonerFactory
-.
-ja:reasonerURL a rdf:Property ;
- rdfs:domain ja:ReasonerFactory
-.
-ja:schema a rdf:Property ;
- rdfs:domain ja:ReasonerFactory ;
- rdfs:range ja:Model
-.
-</code></pre>
-<p>If the optional unique property <code>ja:reasonerURL</code> is specified, then
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><spa [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Reasoner [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerClass</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerURL</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">schema</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>If the optional unique property <code>ja:reasonerURL</code> is specified, then
its resource value is the URI of a reasoner in the Jena reasoner
registry; the reasoner is the one with the given URI.</p>
<p>If the optional property <code>ja:schema</code> is specified, then the models
@@ -498,11 +486,10 @@ documentation.</p>
<p>A <code>RuleSet</code> specification allows rules (for ReasonerFactories) to
be specified inline, elsewhere in the specification model, or in an
external resource.</p>
-<pre><code>ja:RuleSet a rdfs:Class ;
- rdfs:subClassOf ja:HasRules
-.
-</code></pre>
-<p>The optional repeatable property <code>ja:rule</code> has as its value a
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">RuleSet</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasRules</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The optional repeatable property <code>ja:rule</code> has as its value a
literal string which is the text of a Jena rule or rules. All those
rules are added to the <code>RuleSet</code>.</p>
<p>The optional repeatable property <code>ja:rulesFrom</code> has as its value a
@@ -517,58 +504,55 @@ model. All those rules from that <code>RuleSet</code> are added to this
<p>Ontology models can be specified in several ways. The simplest is
to use the name of an OntModelSpec from the Java OntModelSpec
class:</p>
-<pre><code>eg:simple-ont-example
- ja:ontModelSpec ja:OWL_DL_MEM_RULE_INF
- .
-</code></pre>
-<p>This constructs an <code>OntModel</code> with an empty base model and using
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">simple-ont-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ontModelSpec</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OWL_DL_MEM_RULE_INF</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>This constructs an <code>OntModel</code> with an empty base model and using
the OWL_DL language and the full rule reasoner. All of the
OntModelSpec constants in the Jena implementation are available in
this way. A base model can be specified:</p>
-<pre><code>eg:base-ont-example
- ja:baseModel [a ja:MemoryModel ;
- ja:content [ja:externalContent <http://jena.hpl.hp.com/some-jena-data.rdf>]]
- .
-</code></pre>
-<p>The OntModel has a base which is a memory model loaded with the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">base-ont-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span>[<span style="">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">MemoryModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/some-jena-data.rdf></span>]]<span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The OntModel has a base which is a memory model loaded with the
contents of <code>http://jena.hpl.hp.com/some-jena-data.rdf</code>. Since the
ontModelSpec was omitted, it defaults to <code>OWL_MEM_RDFS_INF</code> - the
same default as <code>ModelFactory.createOntologyModel()</code>.</p>
-<pre><code>ja:OntModel a rdfs:Class ;
- rdfs:subClassOf ja:UnionModel ;
- rdfs:subClassOf ja:InfModel
-.
-ja:ontModelSpec a rdf:Property ;
- rdfs:domain ja:OntModel ;
- rdfs:range ja:OntModelSpec
-.
-
-ja:OntModelSpec a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:like; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:reasonerFactory; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:importSource; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:documentManager; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:ontLanguage; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:Object
-.
-ja:importSource a rdf:Property ;
- rdfs:domain ja:OntModelSpec
-.
-ja:reasonerFactory a rdf:Property ;
- rdfs:domain ja:OntModelSpec ;
- rdfs:range ja:ReasonerFactory
-.
-ja:documentManager a rdf:Property ;
- rdfs:domain ja:OntModelSpec
-.
-ja:ontLanguage a rdf:Property ;
- rdfs:domain ja:OntModelSpec
-.
-ja:likeBuiltinSpec a rdf:Property ;
- rdfs:domain ja:OntModelSpec
-.
-</code></pre>
-<p><code>OntModel</code> is a subclass of <code>InfModel</code>, and the <code>ja:baseModel</code>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">UnionModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">InfModel</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ontModelSpec</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">Class</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">like</sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">importSo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">document [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ontLangu [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">importSource</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerFactory</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ReasonerFactory</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">documentManager</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ontLanguage</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">likeBuiltinSpec</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpec</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p><code>OntModel</code> is a subclass of <code>InfModel</code>, and the <code>ja:baseModel</code>
property means the same thing.</p>
<p>The <code>OntModelSpec</code> property value is a resource, interpreted as an
OntModelSpec description based on its name and the value of the
@@ -616,16 +600,15 @@ used as the default value.</p>
<p>An <code>OntDocumentManager</code> can be specified by a <code>ja:DocumentManager</code>
specification which describes the <code>OntDocumentManager</code>’s file
manager and policy settings.</p>
-<pre><code>eg:mapper
- lm:mapping [lm:altName "file:etc/foo.n3" ;
- lm:name "file:foo.n3"]
- .
-eg:document-manager-example
- ja:fileManager [ja:locationMapper eg:mapper] ;
- ja:meta [ dm:altURL <http://localhost/RDF/my-alt.rdf>]
- .
-</code></pre>
-<p>In this example, <code>eg:document-manager-example</code> is a
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">mapper</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">lm:</span><span style="color:#008000;font-weight:bold">mapping</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">lm:</span><span style="color:#008000;font-weight:bold">altName</span><span style="color:#bbb"> </span><span style="color:#b44">"file:etc/foo.n3"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">lm:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"file:foo.n3"</span>]<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">document-manager-example</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">fileManager</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">locationMapper</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">mapp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">meta</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dm:</span><span style="color:#008000;font-weight:bold">altURL</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://localhost/RDF/my-alt.rdf></span>]<span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>In this example, <code>eg:document-manager-example</code> is a
<code>ja:DocumentManager</code> specification. It has its own
<code>FileManager specification</code>, the object of the
<code>ja:fileManager property</code>; that <code>FileManager</code> has a location
@@ -635,18 +618,17 @@ document manager meta-data: the sub-model of the assembler
specification reachable from <code>eg:document-manager-example</code> is
passed to the document manager when it is created. For the meanings
of the <code>dm:</code> properties, see the Jena ontology documentation and
-the ontology.rdf ontology.</p>
-<pre><code>ja:DocumentManager a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:policyPath; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:fileManager; owl:maxCardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:fileManager; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:HasFileManager
-.
-ja:policyPath a rdf:Property ;
- rdfs:domain ja:DocumentManager
-.
-</code></pre>
-<p>The <code>ja:fileManager</code> property value, if present, has as its object
+the <code>ontology.rdf</code> ontology.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">DocumentManager</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00 [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">poli [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">file [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">file [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">HasFileManager</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">policyPath</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">DocumentManager</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The <code>ja:fileManager</code> property value, if present, has as its object
a <code>ja:FileManager</code> specification; the constructed document manager
is given a new file manager constructed from that specification. If
there is no <code>ja:fileManager</code> property, then the default
@@ -658,27 +640,25 @@ documentation. If absent, the usual default path is applied.</p>
DocumentManager resource contains any OntDocumentManager
<code>DOC_MGR_POLICY</code> or <code>ONTOLOGY_SPEC</code> objects, they will be
interpreted by the constructed document manager object.</p>
-<pre><code>ja:FileManager a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:locationMapper; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:Object
-.
-ja:locationMapper a rdf:Property ;
- rdfs:domain ja:FileManager ;
- rdfs:range ja:LocationMapper
-.
-</code></pre>
-<p>A <code>ja:FileManager</code> object may have a <code>ja:locationMapper</code> property
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">FileManager</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">location [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">locationMapper</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">FileManager</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">LocationMapper</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>A <code>ja:FileManager</code> object may have a <code>ja:locationMapper</code> property
value which identifies the specification of a <code>LocationMapper</code>
object initialising that file manager.</p>
-<pre><code>ja:LocationMapper a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty lm:mapping; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:Object
-.
-lm:mapping a rdf:Property ;
- rdfs:domain ja:LocationMapper
-.
-</code></pre>
-<p>A <code>ja:LocationMapper</code> object may have <code>lm:mapping</code> property values,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">LocationMapper</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">lm:</span><span style="color:#008000;font-weight:bold">mapping< [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">lm:</span><span style="color:#008000;font-weight:bold">mapping</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">LocationMapper</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>A <code>ja:LocationMapper</code> object may have <code>lm:mapping</code> property values,
describing the location mapping, as described in the FileManager
documentation. (Note that the vocabulary for those items is in a
different namespace than the JA properties and classes.)</p>
@@ -686,20 +666,19 @@ different namespace than the JA properties and classes.)</p>
<p>Union models can be constructed from any number of sub-models and a
single <em>root</em> model. The root model is the one written to when the
union model is updated; the sub-models are untouched.</p>
-<pre><code>ja:UnionModel a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:rootModel; owl:maxCardinality 1] ;
- rdfs:subClassOf ja:Model
-.
-ja:rootModel a rdf:Property ;
- rdfs:domain ja:UnionModel ;
- rdfs:range ja:Model
-.
-ja:subModel a rdf:Property ;
- rdfs:domain ja:UnionModel ;
- rdfs:range ja:Model
-.
-</code></pre>
-<p>If the single <code>ja:rootModel</code> property is present, its value
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">UnionModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span sty [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">rootMode [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">rootModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">UnionModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">subModel</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">UnionModel</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Model</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>If the single <code>ja:rootModel</code> property is present, its value
describes a model to use as the root model of the union. All
updates to the union are directed to this root model. If no root
model is supplied, the union is given an <em>immutable</em>, <em>empty</em> model
@@ -711,27 +690,26 @@ property).</p>
<h3 id="prefix-mappings">Prefix mappings</h3>
<p>The PrefixMappings of a model may be set from PrefixMapping
specifications.</p>
-<pre><code>ja:PrefixMapping a rdfs:Class ;
- rdfs:subClassOf ja:Object
-.
-ja:includes a rdf:Property ;
- rdfs:domain ja:PrefixMapping ;
- rdfs:range ja:PrefixMapping
-.
-
-ja:SinglePrefixMapping a rdfs:Class ;
- rdfs:subClassOf [owl:onProperty ja:namespace; owl:cardinality 1] ;
- rdfs:subClassOf [owl:onProperty ja:prefix; owl:cardinality 1] ;
- rdfs:subClassOf ja:PrefixMapping
-.
-ja:namespace a rdf:Property ;
- rdfs:domain ja:SinglePrefixMapping
-.
-ja:prefix a rdf:Property ;
- rdfs:domain ja:SinglePrefixMapping
-.
-</code></pre>
-<p>The <code>ja:includes</code> property allows a PrefixMapping to include the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">PrefixMapping</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">Object</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">includes</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">PrefixMapping</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">range</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">PrefixMapping</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">SinglePrefixMapping</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">Class</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">namespac [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">onProperty</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">prefix</ [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">PrefixMapping</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">namespace</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">SinglePrefixMapping</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">prefix</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">Property</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">domain</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">SinglePrefixMapping</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The <code>ja:includes</code> property allows a PrefixMapping to include the
content of other specified PrefixMappings.</p>
<p>The <code>ja:prefix</code> and <code>ja:namespace</code> properties allow the
construction of a single element of a prefix mapping by specifying
@@ -741,27 +719,23 @@ the prefix and namespace of the mapping.</p>
Assembler specification: the <em>assembler</em> and <em>imports</em> directives.</p>
<h4 id="assembler">Assembler</h4>
<p>A specification may contain statements of the form:</p>
-<pre><code>someResource ja:assembler "some.Assembler.class.name"
-</code></pre>
-<p>When <code>someResource</code> is used as the type of a root object, the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">someResource</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">assembler</span><span style="color:#bbb"> </span><span style="color:#b44">"some.Assembler.class.name"</span><span style=" [...]
+</span></span></span></code></pre></div><p>When <code>someResource</code> is used as the type of a root object, the
AssemblerGroup that processes the description will use an instance
of the Java class named by the object of the statement. That class
must implement the <code>Assembler</code> interface. See
<a href="inside-assemblers.html#loading-assembler-classes">loading assembler classes</a> for more
details.</p>
<p>Similarly, statements of the form:</p>
-<pre><code>someResource ja:loadClass "some.class.name"
-</code></pre>
-<p>will cause the named class to be loaded (but not treated as
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">someResource</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">loadClass</span><span style="color:#bbb"> </span><span style="color:#b44">"some.class.name"</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>will cause the named class to be loaded (but not treated as
assemblers).</p>
<h4 id="imports">Imports</h4>
<p>If a specification contains statements of the form:</p>
-<pre><code>anyResource owl:imports someURL
-</code></pre>
-<p>or, equivalently,</p>
-<pre><code>anyResource ja:imports someURL
-</code></pre>
-<p>then the specification is regarded as also containing the contents
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">anyResource</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">owl:</span><span style="color:#008000;font-weight:bold">imports</span><span style="color:#bbb"> </span><span style="">someURL</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>or, equivalently,</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">anyResource</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">imports</span><span style="color:#bbb"> </span><span style="">someURL</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>then the specification is regarded as also containing the contents
of the RDF at <code>someURL</code>. That RDF may in turn contain <code>imports</code>
referring to other RDF.</p>
<h2 id="limited-rdfs-inference">Limited RDFS inference</h2>
diff --git a/content/documentation/assembler/index.html b/content/documentation/assembler/index.html
index a012252de..0431b67b1 100644
--- a/content/documentation/assembler/index.html
+++ b/content/documentation/assembler/index.html
@@ -211,9 +211,8 @@ of model specification.</p>
<p>Suppose the Model <code>M</code> contains an Assembler specification whose
<em>root</em> - the Resource describing the whole Model to construct is
<code>R</code> (so <code>R.getModel() == M)</code>. Invoke:</p>
-<pre><code>Assembler.general.openModel(R)
-</code></pre>
-<p>The result is the desired Model. Further details about the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Assembler<span style="color:#666">.</span><span style="color:#b44">general</span><span style="color:#666">.</span><span style="color:#b44">openModel</span><span style="color:#666">(</span>R<span style="color:#666">)</span>
+</span></span></code></pre></div><p>The result is the desired Model. Further details about the
<code>Assembler</code> interface, the special Assembler <code>general</code>, and the
details of specific Assemblers, are deferred to the
<a href="assembler-howto.html">Assembler howto</a>.</p>
@@ -221,31 +220,27 @@ details of specific Assemblers, are deferred to the
<p>In the remaining sections, the object we want to describe is given
the root resource <code>my:root</code>.</p>
<h3 id="-a-memory-model">… a memory model?</h3>
-<pre><code>my:root a ja:MemoryModel.
-</code></pre>
-<h3 id="-an-inference-model">… an inference model?</h3>
-<pre><code>my:root
- ja:reasoner [ja:reasonerURL theReasonerURL] ;
- ja:baseModel theBaseModelResource
- .
-</code></pre>
-<p><em>theReasonerURL</em> is one of the reasoner (factory) URLs given in the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">my:</span><span style="color:#008000;font-weight:bold">root</span><span style="color:#bbb"> </span><span style="color:#0b0;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="colo [...]
+</span></span></span></code></pre></div><h3 id="-an-inference-model">… an inference model?</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">my:</span><span style="color:#008000;font-weight:bold">root</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasoner</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">reasonerURL</span><span style="color:#bbb"> </span><span style="">theReasonerURL</span>]<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span><span style="">theBaseModelResource</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p><em>theReasonerURL</em> is one of the reasoner (factory) URLs given in the
inference documentation and code; <em>theBaseModelResource</em> is another
resource in the same document describing the base model.</p>
<h3 id="-some-initialising-content">… some initialising content?</h3>
-<pre><code>my:root
- ja:content [ja:externalContent <someContentURL>]
- ... rest of model specification ...
- .
-</code></pre>
-<p>The model will be pre-loaded with the contents of <em>someContentURL</em>.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">my:</span><span style="color:#008000;font-weight:bold">root</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">content</span><span style="color:#bbb"> </span>[<span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">externalContent</span><span style="color:#bbb"> </span><span style="color:#b8860b"><someContentURL></span>]<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb"> </span><span style="">rest</span><span style="color:#bbb"> </span><span style="">of</span><span style="color:#bbb"> </span><span style="">model</span><span style="color:#bbb"> </span><span style="">specification</span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The model will be pre-loaded with the contents of <em>someContentURL</em>.</p>
<h3 id="-an-ontology-model">… an ontology model?</h3>
-<pre><code>my:root
- ja:ontModelSpec ja:OntModelSpecName ;
- ja:baseModel somebaseModel
- .
-</code></pre>
-<p>The <em>OntModelSpecName</em> can be any of the predefined Jena
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">my:</span><span style="color:#008000;font-weight:bold">root</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">ontModelSpec</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">OntModelSpecName</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#008000;font-weight:bold">baseModel</span><span style="color:#bbb"> </span><span style="">somebaseModel</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The <em>OntModelSpecName</em> can be any of the predefined Jena
OntModelSpec names, eg <code>OWL_DL_MEM_RULE_INF</code>. The baseModel is
another model description - it can be left out, in which case you
get an empty memory model. See
diff --git a/content/documentation/assembler/inside-assemblers.html b/content/documentation/assembler/inside-assemblers.html
index 383e53d96..677b5718b 100644
--- a/content/documentation/assembler/inside-assemblers.html
+++ b/content/documentation/assembler/inside-assemblers.html
@@ -206,17 +206,16 @@ writing assembler descriptions, see the
<h2 id="the-assembler-interface">The Assembler interface</h2>
<p>An <code>Assembler</code> is an object that builds objects (most importantly,
<code>Model</code>s) from RDF descriptions.</p>
-<pre><code>public Object open( Assembler a, Resource root, Mode mode );
-
-public Object open( Assembler a, Resource root );
-
-public Object open( Resource root );
-
-public Model openModel( Resource root );
-
-public Model openModel( Resource root, Mode mode );
-</code></pre>
-<p>The fundamental method is the first: all the others are shorthands
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> Object <span style="color:#00a000">open</span><span style="color:#666">(</span> Assembler a<span style="color:#666">,</span> Resource root<span style="color:#666">,</span> Mode mode <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> Object <span style="color:#00a000">open</span><span style="color:#666">(</span> Assembler a<span style="color:#666">,</span> Resource root <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> Object <span style="color:#00a000">open</span><span style="color:#666">(</span> Resource root <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> Model <span style="color:#00a000">openModel</span><span style="color:#666">(</span> Resource root <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> Model <span style="color:#00a000">openModel</span><span style="color:#666">(</span> Resource root<span style="color:#666">,</span> Mode mode <span style="color:#666">);</span>
+</span></span></code></pre></div><p>The fundamental method is the first: all the others are shorthands
for ways of calling it. The abstract class <code>AssemblerBase</code>
implements <code>Assembler</code> leaving only that method abstract and
defining the others in terms of it.</p>
diff --git a/content/documentation/extras/querybuilder/index.html b/content/documentation/extras/querybuilder/index.html
index 1e1e59d21..f18cf358f 100644
--- a/content/documentation/extras/querybuilder/index.html
+++ b/content/documentation/extras/querybuilder/index.html
@@ -198,161 +198,145 @@
<h2 id="overview">Overview</h2>
<p>Query Builder provides implementations of Ask, Construct, Select and Update builders that allow developers to create queries without resorting to StringBuilders or similar solutions. The Query Builder module is an extra package and is found in the <code>jena-querybuilder</code> jar.</p>
<p>Each of the builders has a series of methods to define the query. Each method returns the builder for easy chaining. The example:</p>
-<pre><code>SelectBuilder sb = new SelectBuilder()
- .addVar( "*" )
- .addWhere( "?s", "?p", "?o" );
-
-Query q = sb.build() ;
-</code></pre>
-<p>produces</p>
-<pre><code>SELECT *
-WHERE
- { ?s ?p ?o }
-</code></pre>
-<p>Standard Java variables can be used in the various clauses as long as the datatype has a registered Datatype within Jena. For example:</p>
-<pre><code>Integer five = Integer.valueof(5);
-SelectBuilder sb = new SelectBuilder()
- .addVar( "*" )
- .addWhere( "?s", "?p", five );
-
-Query q = sb.build() ;
-</code></pre>
-<p>produces</p>
-<pre><code>SELECT *
-WHERE
- { ?s ?p "5"^^<http://www.w3.org/2001/XMLSchema#integer> }
-</code></pre>
-<p>Java Collections are properly expanded to RDF collections within the query builder provided there is a registered Datatype for the elements. Nested collections are expanded. Collections can also be defined with the standard SPARQL shorthand. So the following produce equivalent queries:</p>
-<pre><code>SelectBuilder sb = new SelectBuilder()
- .addVar( "*" )
- .addWhere( "?s", "?p", List.of( "a", "b", "c") );
-
-Query q = sb.build() ;
-</code></pre>
-<p>and</p>
-<pre><code>SelectBuilder sb = new SelectBuilder()
- .addVar( "*" )
- .addWhere( "?s", "?p", "('a' 'b' 'c')" );
-
-Query q = sb.build() ;
-</code></pre>
-<p>It is common to create <code>Var</code> objects and use them in complex queries to make the query more readable. For example:</p>
-<pre><code>Var node = Var.alloc("node");
-Var x = Var.alloc("x");
-Var y = Var.alloc("y");
-SelectBuilder sb = new SelectBuilder()
- .addVar(x).addVar(y)
- .addWhere(node, RDF.type, Namespace.Obst)
- .addWhere(node, Namespace.x, x)
- .addWhere(node, Namespace.y, y);
-</code></pre>
-<h1 id="constructing-expressions">Constructing Expressions</h1>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"*"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> <span style="color:#b44">"?o"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Query q <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>produces</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> }
+</span></span></code></pre></div><p>Standard Java variables can be used in the various clauses as long as the datatype has a registered Datatype within Jena. For example:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Integer five <span style="color:#666">=</span> Integer<span style="color:#666">.</span><span style="color:#b44">valueof</span><span style="color:#666">(</span><span style="color:#666">5</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"*"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> five <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Query q <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>produces</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b44">"5"</span><span style="color:#666">^^</span><span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#integer></span> }
+</span></span></code></pre></div><p>Java Collections are properly expanded to RDF collections within the query builder provided there is a registered Datatype for the elements. Nested collections are expanded. Collections can also be defined with the standard SPARQL shorthand. So the following produce equivalent queries:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"*"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> List<span style="color:#666">.</span><span style="color:#b44">of</span><span style="color:#666">(</span> <span style="color:#b44">"a"</span><span style="color:#666">,</s [...]
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Query q <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>and</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"*"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> <span style="color:#b44">"('a' 'b' 'c')"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Query q <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>It is common to create <code>Var</code> objects and use them in complex queries to make the query more readable. For example:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Var node <span style="color:#666">=</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span><span style="color:#b44">"node"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Var x <span style="color:#666">=</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span><span style="color:#b44">"x"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Var y <span style="color:#666">=</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span><span style="color:#b44">"y"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span>x<span style="color:#666">).</span><span style="color:#b44">addVar</span><span style="color:#666">(</span>y<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span>node<span style="color:#666">,</span> RDF<span style="color:#666">.</span><span style="color:#b44">type</span><span style="color:#666">,</span> Namespace<span style="color:#666">.</span><span style="color:#b44">Obst</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span>node<span style="color:#666">,</span> Namespace<span style="color:#666">.</span><span style="color:#b44">x</span><span style="color:#666">,</span> x<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span>node<span style="color:#666">,</span> Namespace<span style="color:#666">.</span><span style="color:#b44">y</span><span style="color:#666">,</span> y<span style="color:#666">);</span>
+</span></span></code></pre></div><h1 id="constructing-expressions">Constructing Expressions</h1>
<p>Expressions are primarily used in <code>filter</code> and <code>bind</code> statements as well as in select clauses. All the standard expressions are implemented in the <code>ExprFactory</code> class. An <code>ExprFactory</code> can be retrieved from any Builder by calling the <code>getExprFactory()</code> method. This will create a Factory that has the same prefix mappings and the query. An alternative is to construct the <code>ExprFactory</code> directly, this factory will not h [...]
-<pre><code>SelectBuilder builder = new SelectBuilder();
-ExprFactory exprF = builder.getExprFactory()
- .addPrefix( "cf",
- "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/");
-builder.addVar( exprF.floor( ?v ), ?floor )
- .addWhere( ?s, "cf:air_temperature", ?v );
-</code></pre>
-<h2 id="update-builder">Update Builder</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder builder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>ExprFactory exprF <span style="color:#666">=</span> builder<span style="color:#666">.</span><span style="color:#b44">getExprFactory</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"cf"</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>builder<span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> exprF<span style="color:#666">.</span><span style="color:#b44">floor</span><span style="color:#666">(</span> <span style="color:#666">?</span>v <span style="color:#666">),</span> <span style="color:#666">?</span>floor <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#666">?</span>s<span style="color:#666">,</span> <span style="color:#b44">"cf:air_temperature"</span><span style="color:#666">,</span> <span style="color:#666">?</span>v <span style="color:#666">);</span>
+</span></span></code></pre></div><h2 id="update-builder">Update Builder</h2>
<p>The <code>UpdateBuilder</code> is used to create <code>Update</code>, <code>UpdateDeleteWhere</code> or <code>UpdateRequest</code> objects. When an <code>UpdateRequest</code> is built is contains a single <code>Update</code> object as defined by the <code>UpdateBuilder</code>. <code>Update</code> objects can be added to an UpdateRequest using the <code>appendTo()</code> method.</p>
-<pre><code>Var subj = Var.alloc( "s" );
-Var obj = Var.alloc( "o" );
-
-UpdateBuilder builder = new UpdateBuilder( PrefixMapping.Standard)
- .addInsert( subj, "rdfs:comment", obj )
- .addWhere( subj, "dc:title", obj);
-
-UpdateRequest req = builder.buildRequest();
-
-UpdateBuilder builder2 = new UpdateBuilder()
- .addPrefix( "dc", "http://purl.org/dc/elements/1.1/")
- .addDelete( subj, "?p", obj)
- .where( subj, dc:creator, "me")
- .appendTo( req );
-</code></pre>
-<h2 id="where-builder">Where Builder</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Var subj <span style="color:#666">=</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span> <span style="color:#b44">"s"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Var obj <span style="color:#666">=</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span> <span style="color:#b44">"o"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>UpdateBuilder builder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> UpdateBuilder<span style="color:#666">(</span> PrefixMapping<span style="color:#666">.</span><span style="color:#b44">Standard</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addInsert</span><span style="color:#666">(</span> subj<span style="color:#666">,</span> <span style="color:#b44">"rdfs:comment"</span><span style="color:#666">,</span> obj <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> subj<span style="color:#666">,</span> <span style="color:#b44">"dc:title"</span><span style="color:#666">,</span> obj<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>UpdateRequest req <span style="color:#666">=</span> builder<span style="color:#666">.</span><span style="color:#b44">buildRequest</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>UpdateBuilder builder2 <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> UpdateBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"dc"</span><span style="color:#666">,</span> <span style="color:#b44">"http://purl.org/dc/elements/1.1/"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addDelete</span><span style="color:#666">(</span> subj<span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> obj<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">where</span><span style="color:#666">(</span> subj<span style="color:#666">,</span> dc<span style="color:#666">:</span>creator<span style="color:#666">,</span> <span style="color:#b44">"me"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">appendTo</span><span style="color:#666">(</span> req <span style="color:#666">);</span>
+</span></span></code></pre></div><h2 id="where-builder">Where Builder</h2>
<p>In some use cases it is desirable to create a where clause without constructing an entire query. The <code>WhereBuilder</code> is designed to fit this need. For example to construct the query:</p>
-<pre><code>PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-SELECT ?page ?type WHERE
-{
- ?s foaf:page ?page .
- { ?s rdfs:label "Microsoft"@en . BIND ("A" as ?type) }
- UNION
- { ?s rdfs:label "Apple"@en . BIND ("B" as ?type) }
-}
-</code></pre>
-<p>You could use a WhereBuilder to construct the union queries and add them to a Select or other query builder.</p>
-<pre><code>WhereBuilder whereBuilder = new WhereBuilder()
- .addPrefix( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" )
- addWhere( "?s", "rdfs:label", "'Microsoft'@en" )
- .addBind( "'A'", "?type")
- .addUnion( new WhereBuilder()
- .addPrefix( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" )
- .addWhere( "?s", "rdfs:label", "'Apple'@en" )
- .addBind( "'B'", "?type")
- );
-
-SelectBuilder builder = new SelectBuilder()
- .addPrefix( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" )
- .addPrefix( "foaf", "http://xmlns.com/foaf/0.1/" );
- .addVar( "?page")
- .addVar( "?type" )
- .addWhere( "?s", "foaf:page", "?page" )
- .addWhere( whereBuilder );
-</code></pre>
-<p>The where clauses could be built inline as:</p>
-<pre><code>SelectBuilder builder = new SelectBuilder()
- .addPrefixs( PrefixMapping.Standard )
- .addPrefix( "foaf", "http://xmlns.com/foaf/0.1/" );
- .addVar( "?page")
- .addVar( "?type" )
- .addWhere( "?s", "foaf:page", "?page" )
- .addWhere( new WhereBuilder()
- .addPrefix( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" )
- .addWhere( "?s", "rdfs:label", "'Microsoft'@en" )
- .addBind( "'A'", "?type")
- .addUnion( new WhereBuilder()
- .addPrefix( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" )
- .addWhere( "?s", "rdfs:label", "'Apple'@en" )
- .addBind( "'B'", "?type")
- )
- );
-</code></pre>
-<h2 id="template-usage">Template Usage</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdfs</span>: <span style="color:#a0a000"><http://www.w3.org/2000/01/rdf-schema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?page</span> <span style="color:#b8860b">?type</span> <span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?s</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">page</span> <span style="color:#b8860b">?page</span> .
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#00f;font-weight:bold">rdfs</span>:<span style="color:#008000;font-weight:bold">label</span> <span style="color:#b44">"Microsoft"</span><span style="color:#666">@</span><span style="color:#00a000">en</span> . <span style="color:#a2f;font-weight:bold">BIND</span> (<span style="color:#b44">"A"</span> <span style="color:#a2f;font-weight:bold">as</span> <span style=" [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">UNION</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#00f;font-weight:bold">rdfs</span>:<span style="color:#008000;font-weight:bold">label</span> <span style="color:#b44">"Apple"</span><span style="color:#666">@</span><span style="color:#00a000">en</span> . <span style="color:#a2f;font-weight:bold">BIND</span> (<span style="color:#b44">"B"</span> <span style="color:#a2f;font-weight:bold">as</span> <span style="colo [...]
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>You could use a WhereBuilder to construct the union queries and add them to a Select or other query builder.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>WhereBuilder whereBuilder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> WhereBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"rdfs"</span><span style="color:#666">,</span> <span style="color:#b44">"http://www.w3.org/2000/01/rdf-schema#"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> addWhere<span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"rdfs:label"</span><span style="color:#666">,</span> <span style="color:#b44">"'Microsoft'@en"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addBind</span><span style="color:#666">(</span> <span style="color:#b44">"'A'"</span><span style="color:#666">,</span> <span style="color:#b44">"?type"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addUnion</span><span style="color:#666">(</span> <span style="color:#a2f;font-weight:bold">new</span> WhereBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"rdfs"</span><span style="color:#666">,</span> <span style="color:#b44">"http://www.w3.org/2000/01/rdf-schema#"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"rdfs:label"</span><span style="color:#666">,</span> <span style="color:#b44">"'Apple'@en"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addBind</span><span style="color:#666">(</span> <span style="color:#b44">"'B'"</span><span style="color:#666">,</span> <span style="color:#b44">"?type"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>SelectBuilder builder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"rdfs"</span><span style="color:#666">,</span> <span style="color:#b44">"http://www.w3.org/2000/01/rdf-schema#"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"foaf"</span><span style="color:#666">,</span> <span style="color:#b44">"http://xmlns.com/foaf/0.1/"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"?page"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"?type"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"foaf:page"</span><span style="color:#666">,</span> <span style="color:#b44">"?page"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> whereBuilder <span style="color:#666">);</span>
+</span></span></code></pre></div><p>The where clauses could be built inline as:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder builder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefixs</span><span style="color:#666">(</span> PrefixMapping<span style="color:#666">.</span><span style="color:#b44">Standard</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"foaf"</span><span style="color:#666">,</span> <span style="color:#b44">"http://xmlns.com/foaf/0.1/"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"?page"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"?type"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"foaf:page"</span><span style="color:#666">,</span> <span style="color:#b44">"?page"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#a2f;font-weight:bold">new</span> WhereBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"rdfs"</span><span style="color:#666">,</span> <span style="color:#b44">"http://www.w3.org/2000/01/rdf-schema#"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"rdfs:label"</span><span style="color:#666">,</span> <span style="color:#b44">"'Microsoft'@en"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addBind</span><span style="color:#666">(</span> <span style="color:#b44">"'A'"</span><span style="color:#666">,</span> <span style="color:#b44">"?type"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addUnion</span><span style="color:#666">(</span> <span style="color:#a2f;font-weight:bold">new</span> WhereBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"rdfs"</span><span style="color:#666">,</span> <span style="color:#b44">"http://www.w3.org/2000/01/rdf-schema#"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"rdfs:label"</span><span style="color:#666">,</span> <span style="color:#b44">"'Apple'@en"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addBind</span><span style="color:#666">(</span> <span style="color:#b44">"'B'"</span><span style="color:#666">,</span> <span style="color:#b44">"?type"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">);</span>
+</span></span></code></pre></div><h2 id="template-usage">Template Usage</h2>
<p>In addition to making it easier to build valid queries the QueryBuilder has a clone method.
Using this a developer can create as “Template” query and add to it as necessary.</p>
<p>For example using the above query as the “template” with this code:</p>
-<pre><code>SelectBuilder sb2 = sb.clone();
-sb2.addPrefix( "foaf", "http://xmlns.com/foaf/0.1/" )
- .addWhere( ?s, RDF.type, "foaf:Person") ;
-</code></pre>
-<p>produces</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-SELECT *
-WHERE
- { ?s ?p ?o .
- ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:person .
- }
-</code></pre>
-<h2 id="prepared-statement-usage">Prepared Statement Usage</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder sb2 <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">clone</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>sb2<span style="color:#666">.</span><span style="color:#b44">addPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"foaf"</span><span style="color:#666">,</span> <span style="color:#b44">"http://xmlns.com/foaf/0.1/"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#666">?</span>s<span style="color:#666">,</span> RDF<span style="color:#666">.</span><span style="color:#b44">type</span><span style="color:#666">,</span> <span style="color:#b44">"foaf:Person"</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>produces</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?s</span> <span style="color:#a0a000"><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">person</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><h2 id="prepared-statement-usage">Prepared Statement Usage</h2>
<p>The query builders have the ability to replace variables with other values. This can be</p>
-<pre><code>SelectBuilder sb = new SelectBuilder()
- .addVar( "*" )
- .addWhere( "?s", "?p", "?o" );
-
-sb.setVar( Var.alloc( "?o" ), NodeFactory.createURI( "http://xmlns.com/foaf/0.1/Person" ) ) ;
-Query q = sb.build();
-</code></pre>
-<p>produces</p>
-<pre><code>SELECT *
-WHERE
- { ?s ?p <http://xmlns.com/foaf/0.1/Person> }
-</code></pre>
-
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>SelectBuilder sb <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SelectBuilder<span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addVar</span><span style="color:#666">(</span> <span style="color:#b44">"*"</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addWhere</span><span style="color:#666">(</span> <span style="color:#b44">"?s"</span><span style="color:#666">,</span> <span style="color:#b44">"?p"</span><span style="color:#666">,</span> <span style="color:#b44">"?o"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>sb<span style="color:#666">.</span><span style="color:#b44">setVar</span><span style="color:#666">(</span> Var<span style="color:#666">.</span><span style="color:#b44">alloc</span><span style="color:#666">(</span> <span style="color:#b44">"?o"</span> <span style="color:#666">),</span> NodeFactory<span style="color:#666">.</span><span style="color:#b44">createURI</span><span style="color:#666">(</span> <span style="color:#b44">"h [...]
+</span></span><span style="display:flex;"><span>Query q <span style="color:#666">=</span> sb<span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">();</span>
+</span></span></code></pre></div><p>produces</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/Person></span> }
+</span></span></code></pre></div>
</article>
<aside class="text-muted align-self-start mb-3 mb-xl-5 p-0 d-none d-xl-flex flex-column sticky-top">
diff --git a/content/documentation/fuseki2/fuseki-data-access-control.html b/content/documentation/fuseki2/fuseki-data-access-control.html
index 1df7d2bee..bbcf163ec 100644
--- a/content/documentation/fuseki2/fuseki-data-access-control.html
+++ b/content/documentation/fuseki2/fuseki-data-access-control.html
@@ -252,10 +252,8 @@ for configuring security over the whole of the Fuseki UI.</p>
the certificate file and password for the certificate.</p>
<h3 id="https-details">HTTPS certificate details file</h3>
<p>The file is a simple JSON file:</p>
-<pre>
- { "cert": <i>KEYSTORE</i> , "passwd": <i>SECRET</i> }
-</pre>
-<p>This file must be protected by file access settings so that it can only
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{ <span style="color:#008000;font-weight:bold">"cert"</span>: <span style="">KEYSTORE</span>, <span style="color:#008000;font-weight:bold">"passwd"</span>: <span style="">SECRET</span> }
+</span></span></code></pre></div><p>This file must be protected by file access settings so that it can only
be read by the userid running the server. One way is to put the
keystore certificate and the certificate details file in the same
directory, then make the directory secure.</p>
@@ -264,10 +262,8 @@ directory, then make the directory secure.</p>
stops some attacks. What it does not do is guarantee the identity of the
host name of the Fuseki server to the client system. A signed certificate provides that through the chain of trust. A self-signed certificate does protect data in HTTP responses.</p>
<p>A self-signed certificate can be generated with:</p>
-<pre>
- keytool -keystore <i>keystore</i> -alias <i>jetty</i> -genkey -keyalg RSA
-</pre>
-<p>For information on creating a certificate, see the Jetty documentation
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ keytool -keystore <span style="color:#b8860b">$keystore</span> -alias jetty -genkey -keyalg RSA
+</span></span></code></pre></div><p>For information on creating a certificate, see the Jetty documentation
for <a href="http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html#generating-key-pairs-and-certificates">generating certificates</a>.</p>
<h2 id="authentication">Authentication</h2>
<p><a href="https://en.wikipedia.org/wiki/Authentication">Authentication</a>,
@@ -298,16 +294,13 @@ system. Fuseki Main provides users/password setup and HTTP authentication,
</tbody>
</table>
<p>These can also be given in the server configuration file:</p>
-<pre>
- <#server> rdf:type fuseki:Server ;
- fuseki:passwd "<i>password_file</i>" ;
- fuseki:auth "<i>digest</i>" ;
- ...
-</pre>
-<p>The format of the password file is:</p>
-<pre><code>username: password
-</code></pre>
-<p>and passwords can be stored in hash or obfuscated form.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#server></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">passwd</span><span style="color:#bbb"> </span><span style="color:#b44">"<i>password_file</i>"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">auth</span><span style="color:#bbb"> </span><span style="color:#b44">"<i>digest</i>"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span></code></pre></div><p>The format of the password file is:</p>
+<pre tabindex="0"><code>username: password
+</code></pre><p>and passwords can be stored in hash or obfuscated form.</p>
<p>Documentation of the <a href="http://www.eclipse.org/jetty/documentation/current/configuring-security.html#hash-login-service">Eclipse Jetty Password file format</a>.</p>
<p>If different authentication is required, the full facilities of
<a href="http://www.eclipse.org/jetty/documentation/current/configuring-security.html">Eclipse Jetty configuration</a>
@@ -395,139 +388,125 @@ details. This section is a brief summary of some relevant options:</p>
graphs within a dataset. This section covers server, dataset and endpoint access control
lists. Graph-level access control is <a href="#graph-acl">covered below</a>.</p>
<p>Access control lists (ACL) as part of the server configuration file.</p>
-<pre>
- fuseki --conf <i>configFile.ttl</i>
-</pre>
-<p>ACLs are provided by the <code>fuseki:allowedUsers</code> property</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ fuseki --conf configFile.ttl
+</span></span></code></pre></div><p>ACLs are provided by the <code>fuseki:allowedUsers</code> property</p>
<h3 id="alloweduser">Format of <code>fuseki:allowedUsers</code></h3>
<p>The list of users allowed access can be an RDF list or repeated use of
the property or a mixture. The different settings are combined into one ACL.</p>
-<pre><code> fuseki:allowedUsers "user1", "user2", "user3";
- fuseki:allowedUsers "user3";
- fuseki:allowedUsers ( "user1" "user2" "user3") ;
-</code></pre>
-<p>There is a special user name “*” which means “any authenticated user”.</p>
-<pre><code>fuseki:allowedUsers "*" ;
-</code></pre>
-<h3 id="server-acl">Server Level ACLs</h3>
-<pre>
- <#server> rdf:type fuseki:Server ;
- <b>fuseki:allowedUsers "user1", "user2", "user3";</b>
- ...
- fuseki:services ( ... ) ;
- ...
- .
-</pre>
-<p>A useful pattern is:</p>
-<pre>
- <#server> rdf:type fuseki:Server ;
- <b>fuseki:allowedUsers "*";</b>
- ...
- fuseki:services ( ... ) ;
- ...
- .
-</pre>
-<p>which requires all access to to be authenticated and the allowed users are
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user1"</span>,<span style="color:#bbb"> </span><span style="color:#b44">"user2"</span>,<span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user3"</span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span><span style="color:#b44">"user1"</span><span style="color:#bbb"> </span><span style="color:#b44">"user2"</span><span style="color:#bbb"> </span><span style="color:#b44">"user3"</span>)<span s [...]
+</span></span></span></code></pre></div><p>There is a special user name “*” which means “any authenticated user”.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"*"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="server-acl">Server Level ACLs</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#server></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user1"</span>,<span style="color:#bbb"> </span><span style="color:#b44">"user2"</span>,<span style="color:#bbb"> </span><span style="color:#b44">"user3" [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">services</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span>...<span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>A useful pattern is:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#server></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"*"</span>;<span style="color:#b8860b"></b></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">services</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span>...<span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>...<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>which requires all access to to be authenticated and the allowed users are
those in the password file.</p>
<h3 id="dataset-acl">Dataset Level ACLs</h3>
<p>When there is an access control list on the <code>fuseki:Service</code>, it applies
to all requests to the endpoints of the dataset.</p>
<p>Any server-wide “allowedUsers” configuration also applies and both
levels must allow the user access.</p>
-<pre>
- <#service_auth> rdf:type fuseki:Service ;
- rdfs:label "ACL controlled dataset" ;
- fuseki:name "db-acl" ;
-
- <b>fuseki:allowedUsers "user1", "user3";</b>
-
- ## Choice of operations.
-
- fuseki:endpoint [
- fuseki:operation fuseki:query ;
- fuseki:name "sparql"
- ];
- fuseki:endpoint [
- fuseki:operation fuseki:update ;
- fuseki:name "sparql"
- ] ;
- fuseki:endpoint [
- fuseki:operation fuseki:gsp-r ;
- fuseki:name "get"
- ] ;
- fuseki:dataset <#base_dataset>;
- .
-</pre>
-<h3 id="endpoint-acl">Endpoint Level ACLs</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#service_auth></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">label</span><span style="color:#bbb"> </span><span style="color:#b44">"ACL controlled dataset"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"db-acl"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># ACL here.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user1"</span>,<span style="color:#bbb"> </span><span style="color:#b44">"user3"</span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## Choice of operations.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">query</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"sparql"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>];<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">update</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"sparql"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">gsp-r</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"get"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#base_dataset></span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="endpoint-acl">Endpoint Level ACLs</h3>
<p>An access control list can be applied to an individual endpoint.
Again, any other “allowedUsers” configuration, service-wide, or
server-wide) also applies.</p>
-<pre><code> fuseki:endpoint [
- fuseki:operation fuseki:query ;
- fuseki:name "query" ;
- fuseki:allowedUsers "user1", "user2" ;
- ];
- fuseki:endpoint [
- fuseki:operation fuseki:update ;
- fuseki:name "update" ;
- fuseki:allowedUsers "user1"
- ] ;
-</code></pre>
-<p>Only <em>user1</em> can use SPARQL update; both <em>user1</em> and
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">query</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"query"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user1"</span>,<span style="color:#bbb"> </span><span style="color:#b44">"user2"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>];<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">update</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"update"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">allowedUsers</span><span style="color:#bbb"> </span><span style="color:#b44">"user1"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>]<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span></code></pre></div><p>Only <em>user1</em> can use SPARQL update; both <em>user1</em> and
<em>user2</em> can use SPARQL query.</p>
<h2 id="graph-acl">Graph Access Control Lists</h2>
<p>Graph level access control is defined using a specific dataset
implementation for the service.</p>
-<pre><code><#access_dataset> rdf:type access:AccessControlledDataset ;
- access:registry ... ;
- access:dataset ... ;
- .
-</code></pre>
-<p>Graph ACLs are defined in a <a href="#graph-security-registry">Graph Security Registry</a> which lists the users and graph URIs.</p>
-<pre>
- <#service_tdb2> rdf:type fuseki:Service ;
- rdfs:label "Graph-level access controlled dataset" ;
- fuseki:name "db-graph-acl" ;
- ## Read-only operations on the dataset URL.
- fuseki:endpoint [ fuseki:operation fuseki:query ] ;
- fuseki:endpoint [ fuseki:operation fuseki:gsp_r ] ;
- fuseki:dataset <b><#access_dataset></b> ;
- .
-
- # Define access on the dataset.
- <#access_dataset> rdf:type access:AccessControlledDataset ;
- access:registry <#securityRegistry> ;
- access:dataset <#tdb_dataset_shared> ;
- .
-
- <#securityRegistry>rdf:type access:SecurityRegistry ;
- . . .
-
- <#tdb_dataset_shared> rdf:type tdb:DatasetTDB ;
- . . .
-</pre>
-<p>All dataset storage types are supported. TDB1 and TDB2 have special implementations for handling graph access control.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#access_dataset></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">registry</span><span style="color:#bbb"> </span>...<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span>...<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>Graph ACLs are defined in a <a href="#graph-security-registry">Graph Security Registry</a> which lists the users and graph URIs.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#service_tdb2></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">label</span><span style="color:#bbb"> </span><span style="color:#b44">"Graph-level access controlled dataset"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"db-graph-acl"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## Read-only operations on the dataset URL.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">endpoint</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">operation</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><b><#access_dataset></b></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#080;font-style:italic"># Define access on the dataset.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#access_dataset></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">AccessControlledDataset</span><span style="color:#bbb"> </span>;<span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">registry</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#securityRegistry></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#tdb_dataset_shared></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#securityRegistry></span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">SecurityRegistry</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb"> </span>.<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#tdb_dataset_shared></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">tdb:</span><span style="color:#008000;font-weight:bold">DatasetTDB</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb"> </span>.<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>All dataset storage types are supported. TDB1 and TDB2 have special implementations for handling graph access control.</p>
<h3 id="graph-security-registry">Graph Security Registry</h3>
<p>The Graph Security Registry is defined as a number of access entries in
either a list format “(user graph1 graph2 …)” or as RDF properties
<code>access:user</code> and <code>access:graphs</code>. The property <code>access:graphs</code> has graph URI or a
list of URIs as its object.</p>
-<pre><code><#securityRegistry> rdf:type access:SecurityRegistry ;
- access:entry ( "user1" <http://host/graphname1> <http://host/graphname2> ) ;
- access:entry ( "user1" <http://host/graphname3> ) ;
-
- access:entry ( "user1" <urn:x-arq:DefaultGraph> ) ;
-
- access:entry ( "user2" <http://host/graphname9> ) ;
- access:entry [ access:user "user3" ; access:graphs ( <http://host/graphname3> <http://host/graphname4> ) ] ;
- access:entry [ access:user "user3" ; access:graphs <http://host/graphname5> ] ;
- access:entry [ access:user "userZ" ; access:graphs <http://host/graphnameZ> ] ;
- .
-</code></pre>
-<h2 id="jetty-configuration">Jetty Configuration</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#securityRegistry></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><s [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span><span style="color:#b44">"user1"</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://host/graphname1></span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://hos [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span><span style="color:#b44">"user1"</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://host/graphname3></span><span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>;<span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span><span style="color:#b44">"user1"</span><span style="color:#bbb"> </span><span style="color:#b8860b"><urn:x-arq:DefaultGraph></span><span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>;<span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>(<span style="color:#bbb"> </span><span style="color:#b44">"user2"</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://host/graphname9></span><span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>;<span st [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">user</span><span style="color:#bbb"> </span><span style="color:#b44">"user3"</span><span style="color:#bbb"> </s [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">user</span><span style="color:#bbb"> </span><span style="color:#b44">"user3"</span><span style="color:#bbb"> </s [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">entry</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">access:</span><span style="color:#008000;font-weight:bold">user</span><span style="color:#bbb"> </span><span style="color:#b44">"userZ"</span><span style="color:#bbb"> </s [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><h2 id="jetty-configuration">Jetty Configuration</h2>
<p>For authentication configuration not covered by Fuseki configuration,
the deployed server can be run using a Jetty configuration.</p>
-<p>Server command line: <tt>–jetty=<i>jetty.xml</i></tt>.</p>
+<p>Server command line: <code>--jetty=jetty.xml</code>.</p>
<p><a href="https://www.eclipse.org/jetty/documentation/current/jetty-xml-config.html">Documentation for <code>jetty.xml</code></a>.</p>
</article>
diff --git a/content/documentation/geosparql/geosparql-assembler.html b/content/documentation/geosparql/geosparql-assembler.html
index e11481352..5bd2c86f3 100644
--- a/content/documentation/geosparql/geosparql-assembler.html
+++ b/content/documentation/geosparql/geosparql-assembler.html
@@ -181,81 +181,80 @@
<nav id="TableOfContents"></nav>
</aside>
<article class="flex-column me-lg-4">
- <p>Details of the GeoSPARQL support are proivded on the <a href="index">GeoSPARQL page</a>.</p>
+ <p>Details of the GeoSPARQL support are provided on the <a href="index">GeoSPARQL page</a>.</p>
<p>The assembler for GeoSPARQL support is part of the <code>jena-geosparql</code> artifact and
must be on the Fuseki server classpath, along with its dependencies.</p>
-<pre><code><dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>jena-geosparql</artifactId>
- <version>...</version>
-</dependency>
-</code></pre>
-<p>or download the binary from the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>jena-geosparql<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>...<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><p>or download the binary from the
<a href="https://repo1.maven.org/maven2/org/apache/jena/jena-geosparql/">Maven central repository org/apache/jena/jena-geosparql</a></p>
<p>The GeoSPARQL assembler can be used in a Fuseki configuration file.</p>
<p>This example is of a read-only:</p>
-<pre tabindex="0"><code>PREFIX fuseki: <http://jena.apache.org/fuseki#>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-PREFIX tdb2: <http://jena.apache.org/2016/tdb#>
-
-PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
-PREFIX geosparql: <http://jena.apache.org/geosparql#>
-
-<#service> rdf:type fuseki:Service;
- fuseki:name "geo";
- fuseki:endpoint [ fuseki:operation fuseki:query; ] ;
- fuseki:dataset <#geo_ds> .
-
-<#geo_ds> rdf:type geosparql:geosparqlDataset ;
- geosparql:spatialIndexFile "DB/spatial.index";
- geosparql:dataset <#baseDataset> ;
- .
-
-<#baseDataset> rdf:type tdb2:DatasetTDB2 ;
- tdb2:location "DB/" ;
- .
-</code></pre><p>It is possible to run with a data file loaded into memory and
-an spatial in-memory index:</p>
-<pre tabindex="0"><code>PREFIX fuseki: <http://jena.apache.org/fuseki#>
-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#>
-PREFIX geosparql: <http://jena.apache.org/geosparql#>
-
-<#service> rdf:type fuseki:Service;
- fuseki:name "ds";
- fuseki:endpoint [ fuseki:operation fuseki:query; ] ;
- fuseki:dataset <#geo_ds> .
-
-# In-memory data and index.
-
-<#geo_ds> rdf:type geosparql:geosparqlDataset ;
- geosparql:dataset <#baseDataset> .
-
-<#baseDataset> rdf:type ja:MemoryDataset ;
- ja:data <file:geosparql_data.ttl> ;
- .
-</code></pre><p>The full assembler properties with the default settings is:</p>
-<pre tabindex="0"><code><#geo_ds> rdf:type geosparql:GeosparqlDataset ;
- # Build in-memory is absent.
- geosparql:spatialIndexFile "spatial.index";
-
- ## Default settings. See documentation for meanings.
- geosparql:inference true ;
- geosparql:queryRewrite true ;
- geosparql:indexEnabled true ;
- geosparql:applyDefaultGeometry false ;
-
- # 3 item lists: [Geometry Literal, Geometry Transform, Query Rewrite]
- geosparql:indexSizes "-1,-1,-1" ; # Default - unlimited.
- geosparql:indexExpires "5000,5000,5000" ; # Default - time in milliseconds.
-
- ## Required setting - data over which GeoSPARQL is applied.
- geosparql:dataset <#baseDataset> ;
- .
-</code></pre>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">fuseki</span>: <span style="color:#a0a000"><http://jena.apache.org/fuseki#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdf</span>: <span style="color:#a0a000"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdfs</span>: <span style="color:#a0a000"><http://www.w3.org/2000/01/rdf-schema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">tdb2</span>: <span style="color:#a0a000"><http://jena.apache.org/2016/tdb#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">ja</span>: <span style="color:#a0a000"><http://jena.hpl.hp.com/2005/11/Assembler#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">geosparql</span>: <span style="color:#a0a000"><http://jena.apache.org/geosparql#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#service></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">Service</span>;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b44">"geo"</span>;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">endpoint</span> [ <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">operation</span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">query</span>; ] ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">dataset</span> <span style="color:#a0a000"><#geo_ds></span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#geo_ds></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">geosparql</span>:<span style="color:#008000;font-weight:bold">geosparqlDataset</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">geosparql</span>:<span style="color:#008000;font-weight:bold">spatialIndexFile</span> <span style="color:#b44">"DB/spatial.index"</span>;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">geosparql</span>:<span style="color:#008000;font-weight:bold">dataset</span> <span style="color:#a0a000"><#baseDataset></span> ;
+</span></span><span style="display:flex;"><span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#baseDataset></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">tdb2</span>:<span style="color:#008000;font-weight:bold">DatasetTDB2</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">tdb2</span>:<span style="color:#008000;font-weight:bold">location</span> <span style="color:#b44">"DB/"</span> ;
+</span></span><span style="display:flex;"><span> .
+</span></span></code></pre></div><p>It is possible to run with a data file loaded into memory and
+a spatial in-memory index:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">fuseki</span>: <span style="color:#a0a000"><http://jena.apache.org/fuseki#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdf</span>: <span style="color:#a0a000"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdfs</span>: <span style="color:#a0a000"><http://www.w3.org/2000/01/rdf-schema#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">ja</span>: <span style="color:#a0a000"><http://jena.hpl.hp.com/2005/11/Assembler#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">geosparql</span>: <span style="color:#a0a000"><http://jena.apache.org/geosparql#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#service></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">Service</span>;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b44">"ds"</span>;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">endpoint</span> [ <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">operation</span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">query</span>; ] ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">fuseki</span>:<span style="color:#008000;font-weight:bold">dataset</span> <span style="color:#a0a000"><#geo_ds></span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"># In-memory data and index.</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#geo_ds></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">geosparql</span>:<span style="color:#008000;font-weight:bold">geosparqlDataset</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">geosparql</span>:<span style="color:#008000;font-weight:bold">dataset</span> <span style="color:#a0a000"><#baseDataset></span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a0a000"><#baseDataset></span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00f;font-weight:bold">ja</span>:<span style="color:#008000;font-weight:bold">MemoryDataset</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">ja</span>:<span style="color:#008000;font-weight:bold">data</span> <span style="color:#a0a000"><file:geosparql_data.ttl></span> ;
+</span></span><span style="display:flex;"><span> .
+</span></span></code></pre></div><p>The full assembler properties with the default settings is:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#b8860b"><#geo_ds></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span sty [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># Build in-memory is absent.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">spatialIndexFile</span><span style="color:#bbb"> </span><span style="color:#b44">"spatial.index"</span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## Default settings. See documentation for meanings.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">inference</span><span style="color:#bbb"> </span>true<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">queryRewrite</span><span style="color:#bbb"> </span>true<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">indexEnabled</span><span style="color:#bbb"> </span>true<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">applyDefaultGeometry</span><span style="color:#bbb"> </span>false<span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># 3 item lists: [Geometry Literal, Geometry Transform, Query Rewrite]</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">indexSizes</span><span style="color:#bbb"> </span><span style="color:#b44">"-1,-1,-1"</span><span style="color:#bbb"> </span>;<span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># Default - unlimited.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">indexExpires</span><span style="color:#bbb"> </span><span style="color:#b44">"5000,5000,5000"</span><span style="color:#bbb"> </span>;<span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># Default - time in milliseconds.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## Required setting - data over which GeoSPARQL is applied.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">geosparql:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#baseDataset></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div>
</article>
<aside class="text-muted align-self-start mb-3 mb-xl-5 p-0 d-none d-xl-flex flex-column sticky-top">
diff --git a/content/documentation/geosparql/geosparql-fuseki.html b/content/documentation/geosparql/geosparql-fuseki.html
index ae209832b..3d702d3f2 100644
--- a/content/documentation/geosparql/geosparql-fuseki.html
+++ b/content/documentation/geosparql/geosparql-fuseki.html
@@ -229,13 +229,12 @@
<p>GeoSPARQL Fuseki can be accessed as an embedded server using Maven etc. from Maven Central or run from the command line.
SPARQL queries directly on Jena Datasets and Models can be done using
the <a href="index.html">GeoSPARQL Jena module</a>.</p>
-<pre><code><dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>jena-fuseki-geosparql</artifactId>
- <version>...</version>
-</dependency>
-</code></pre>
-<p>or download the binary from the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>jena-fuseki-geosparql<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>...<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><p>or download the binary from the
<a href="https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-geosparql/">Maven central repository org/apache/jena/jena-fuseki-geosparql</a></p>
<p>This uses the embedded server Fuseki and provides additional parameters for dataset loading.</p>
<p>The project uses the GeoSPARQL implementation from the <a href="index.html">GeoSPARQL Jena module</a>, which includes a range of functions in addition to those from the GeoSPARQL standard.</p>
@@ -263,7 +262,7 @@ by setting the <code>SIS_DATA</code> environment variable
a dataset (otherwise a standard Fuseki server can be used). A spatial index is
created and new data cannot be added to the index once built. The spatial index
can optionally be stored for future usage and needs to removed from a TDB folder
-if the index is to rebuilt.</p>
+if the index is to be rebuilt.</p>
<h2 id="clarifications-on-geosparql">Clarifications on GeoSPARQL</h2>
<h3 id="geographic-markup-language-gml">Geographic Markup Language (GML)</h3>
<p>GeoSPARQL refers to the Geographic Markup Language (GML) as one format for
@@ -319,23 +318,21 @@ RDFS inferencing is applied using the GeoSPARQL schema to infer additional relat
</li>
</ul>
<p>See <a href="https://github.com/galbiston/rdf-tables">rdf-tables</a> in <em>Output Formats/Serialisations</em> for supported RDF format keywords.</p>
-<p><strong>N.B.</strong> Windows Powershell will strip quotation pairs from arguments and so triple quotation pairs may be required, e.g. “““test.rdf”””. Otherwise, logging output will be sent to a file called “xml”. Also, “The input line is too long” error can mean the path to the exceeds the character limit and needs shortening.</p>
+<p><strong>N.B.</strong> Windows Powershell will strip quotation pairs from arguments and so triple quotation pairs may be required, e.g. <code>"""test.rdf"""</code>. Otherwise, logging output will be sent to a file called “xml”. Also, “The input line is too long” error can mean the path to the exceeds the character limit and needs shortening.</p>
<h3 id="embedded-server">Embedded Server</h3>
<p>Run within a Java application to provide GeoSPARQL support over HTTP to other applications:</p>
-<pre><code>FusekiLogging.setLogging();
-GeosparqlServer server =
- new GeosparqlServer(portNumber, datasetName, isLoopbackOnly, dataset, isUpdate);
-</code></pre>
-<h2 id="sparql-query-example">SPARQL Query Example</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>FusekiLogging<span style="color:#666">.</span><span style="color:#b44">setLogging</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>GeosparqlServer server <span style="color:#666">=</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">new</span> GeosparqlServer<span style="color:#666">(</span>portNumber<span style="color:#666">,</span> datasetName<span style="color:#666">,</span> isLoopbackOnly<span style="color:#666">,</span> dataset<span style="color:#666">,</span> isUpdate<span style="color:#666">);</span>
+</span></span></code></pre></div><h2 id="sparql-query-example">SPARQL Query Example</h2>
<p>Once the default server is running it can be queried using Jena as follows:</p>
-<pre><code>String service = "http://localhost:3030/ds";
-String query = ....;
-try (QueryExecution qe = QueryExecution.service(service).query(query).build()) {
- ResultSet rs = qe.execSelect();
- ResultSetFormatter.outputAsTSV(rs);
-}
-</code></pre>
-<p>The server will respond to any valid SPARQL HTTP so an alternative SPARQL framework can be used.
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>String service <span style="color:#666">=</span> <span style="color:#b44">"http://localhost:3030/ds"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>String query <span style="color:#666">=</span> <span style="color:#666">....;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">(</span>QueryExecution qe <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">service</span><span style="color:#666">(</span>service<span style="color:#666">).</span><span style="color:#b44">query</span><span style="color:#666">(</span>query<span style="color:#666">).</span><span style="color:#b44">build</span> [...]
+</span></span><span style="display:flex;"><span> ResultSet rs <span style="color:#666">=</span> qe<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">outputAsTSV</span><span style="color:#666">(</span>rs<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>The server will respond to any valid SPARQL HTTP so an alternative SPARQL framework can be used.
More information on SPARQL querying using Jena can be found on their website (<a href="https://jena.apache.org/tutorials/sparql.html)">https://jena.apache.org/tutorials/sparql.html)</a>.</p>
<h2 id="sis_data-environment-variable">SIS_DATA Environment Variable</h2>
<p>The Apache SIS library is used to support the recognition and transformation of Coordinate/Spatial Reference Systems.
@@ -352,14 +349,14 @@ implementation “org.apache.sis.non-free:sis-embedded-data:$sisVersion&rdqu
</li>
<li>
<p>Maven dependency in <code>pom.xml</code></p>
- <dependency>
- <groupId>org.apache.sis.non-free</groupId>
- <artifactId>sis-embedded-data</artifactId>
- <version>0.8</version>
- </dependency>
</li>
</ul>
-<h2 id="command-line-arguments">Command Line Arguments</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.sis.non-free<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>sis-embedded-data<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>0.8<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><h2 id="command-line-arguments">Command Line Arguments</h2>
<p>Boolean options that have false defaults only require “–option” to make true in release v1.0.7 or later.
Release v1.0.6 and earlier use the form “–option true”.</p>
<h3 id="1-port">1) Port</h3>
diff --git a/content/documentation/geosparql/index.html b/content/documentation/geosparql/index.html
index f9ef6dee9..96ac20492 100644
--- a/content/documentation/geosparql/index.html
+++ b/content/documentation/geosparql/index.html
@@ -226,13 +226,12 @@
describes the GeoSPARQL supported features.</p>
<h2 id="getting-started">Getting Started</h2>
<p>GeoSPARQL Jena can be accessed as a library using Maven etc. from Maven Central.</p>
-<pre><code><dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>jena-geosparql</artifactId>
- <version>...</version>
-</dependency>
-</code></pre>
-<h2 id="features">Features</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>jena-geosparql<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>...<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><h2 id="features">Features</h2>
<p>This implementation follows the 11-052r4 OGC GeoSPARQL standard
(<a href="https://www.ogc.org/standards/geosparql">https://www.ogc.org/standards/geosparql</a>). The implementation is pure Java
and does not require any set-up or configuration of any third party relational
@@ -321,27 +320,25 @@ The <em>indexes</em> can be configured by size, retention duration and frequency
frequently used but small quantity data is also applied in several <em>registries</em>,
e.g. coordinate reference systems and mathematical transformations.</p>
<p>Example GeoSPARQL query:</p>
-<pre><code>PREFIX geo: <http://www.opengis.net/ont/geosparql#>
-
-SELECT ?obj
-WHERE{
- ?subj geo:sfContains ?obj
-} ORDER by ?obj
-</code></pre>
-<h3 id="querying-datasets--models-with-sparql">Querying Datasets & Models with SPARQL</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">geo</span>: <span style="color:#a0a000"><http://www.opengis.net/ont/geosparql#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?obj</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">sfContains</span> <span style="color:#b8860b">?obj</span>
+</span></span><span style="display:flex;"><span>} <span style="color:#a2f;font-weight:bold">ORDER by</span> <span style="color:#b8860b">?obj</span>
+</span></span></code></pre></div><h3 id="querying-datasets--models-with-sparql">Querying Datasets & Models with SPARQL</h3>
<p>The setup of GeoSPARQL Jena only needs to be performed once in an application.
-After it is setup querying is performed using Jena’s standard query methods.</p>
+After it is set up querying is performed using Jena’s standard query methods.</p>
<p>To query a Model with GeoSPARQL or standard SPARQL:</p>
-<pre><code>GeoSPARQLConfig.setupMemoryIndex();
-Model model = .....;
-String query = ....;
-
-try (QueryExecution qe = QueryExecution.create(query, model)) {
- ResultSet rs = qe.execSelect();
- ResultSetFormatter.outputAsTSV(rs);
-}
-</code></pre>
-<p>If your dataset needs to be separate from your application and accessed over
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>GeoSPARQLConfig<span style="color:#666">.</span><span style="color:#b44">setupMemoryIndex</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>Model model <span style="color:#666">=</span> <span style="color:#666">.....;</span>
+</span></span><span style="display:flex;"><span>String query <span style="color:#666">=</span> <span style="color:#666">....;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">(</span>QueryExecution qe <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query<span style="color:#666">,</span> model<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ResultSet rs <span style="color:#666">=</span> qe<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">outputAsTSV</span><span style="color:#666">(</span>rs<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>If your dataset needs to be separate from your application and accessed over
HTTP then you probably need the <a href="geosparql-assembler">GeoSPARQL Assembler</a> to
integrate with Fuseki. The GeoSPARQL functionality needs to be setup in the
application or Fuseki server where the dataset is located.</p>
@@ -477,18 +474,16 @@ asserted in the dataset. This also means the <code>Geometry Literal</code> does
to be specified in the query. In the case of <code>Features</code> this requires the
<code>hasDefaultGeometry</code> property to be used in the dataset.</p>
<p>This means the query:</p>
-<pre><code> ?subj geo:hasDefaultGeometry ?subjGeom .
- ?subjGeom geo:hasSerialization ?subjLit .
-
- ?obj geo:hasDefaultGeometry ?objGeom .
- ?objGeom geo:hasSerialization ?objLit .
-
- FILTER(geof:sfContains(?subjLit, ?objLit))
-</code></pre>
-<p>becomes:</p>
-<pre><code> ?subj geo:sfContains ?obj .
-</code></pre>
-<p>Methods are available to apply the <code>hasDefaultGeometry</code> property to every
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasDefaultGeometry</span> <span style="color:#b8860b">?subjGeom</span> .
+</span></span><span style="display:flex;"><span><span style="color:#b8860b">?subjGeom</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasSerialization</span> <span style="color:#b8860b">?subjLit</span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#b8860b">?obj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasDefaultGeometry</span> <span style="color:#b8860b">?objGeom</span> .
+</span></span><span style="display:flex;"><span><span style="color:#b8860b">?objGeom</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasSerialization</span> <span style="color:#b8860b">?objLit</span> .
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FILTER</span>(<span style="color:#00f;font-weight:bold">geof</span>:<span style="color:#008000;font-weight:bold">sfContains</span>(<span style="color:#b8860b">?subjLit</span>, <span style="color:#b8860b">?objLit</span>))
+</span></span></code></pre></div><p>becomes:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">sfContains</span> <span style="color:#b8860b">?obj</span> .
+</span></span></code></pre></div><p>Methods are available to apply the <code>hasDefaultGeometry</code> property to every
<code>Geometry</code> with a single <code>hasGeometry</code> property, see
<code>org.apache.jena.geosparql.configuration.GeoSPARQLOperations</code>.</p>
<p>Depending upon the spatial relation, queries may include the specified <code>Feature</code>
@@ -515,9 +510,8 @@ be switched on independently of the indexes, i.e. query rewriting can be
performed but an index is configured to not store the result.</p>
<p>As an extension to the standard, supplying a <code>Geometry Literal</code> is
also permitted. For example:</p>
-<pre><code> ?subj geo:sfContains "POINT(0 0)"^^geo:wktLiteral .
-</code></pre>
-<h3 id="dataset-conversion">Dataset Conversion</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">sfContains</span> <span style="color:#b44">"POINT(0 0)"</span><span style="color:#666">^^</span><span style="color:#00f;font-weight:bold">geo</spa [...]
+</span></span></code></pre></div><h3 id="dataset-conversion">Dataset Conversion</h3>
<p>Methods to convert datasets between serialisations and spatial/coordinate
reference systems are available in:
<code>org.apache.jena.geosparql..configuration.GeoSPARQLOperations</code></p>
@@ -552,7 +546,7 @@ a Jena TDB to remove the need to reprocess.</p>
</ul>
<p>Other operations are available and can be applied to a Dataset containing
multiple Models and in some cases files and folders. These operations do
-<strong>not</strong> configure and setup the GeoSPARQL functions or indexes that are required
+<strong>not</strong> configure and set up the GeoSPARQL functions or indexes that are required
for querying.</p>
<h3 id="spatial-index">Spatial Index</h3>
<p>A Spatial Index can be created to improve searching of a dataset. The Spatial
@@ -561,7 +555,7 @@ datasets. Once built the Spatial Index cannot have additional items added to
it.</p>
<p>A Spatial Index is required for the <code>jena-spatial</code> property functions and is
optional for the GeoSPARQL spatial relations. Only a single SRS can be used for
-a Spatial Index and it is recommended that datasets are converted to a single
+a Spatial Index, and it is recommended that datasets are converted to a single
SRS, see <code>GeoSPARQLOperations</code>.</p>
<p>Setting up a Spatial Index can be done through
<code>org.apache.jena.geosparql.configuration.GeoSPARQLConfig</code>. Additional methods
@@ -574,8 +568,8 @@ URL or URN, with conversion undertaken automatically as required. It should be
noted that there is error inherent in spatial reference systems and some
variation in values may occur between different systems.</p>
<p>The following table gives some examples of units that are supported (additional
-units can be added to the <code>UnitsRegistry</code> using the <code>javax.measure.Unit</code> API.
-These URI are all in the namespace <code>http://www.opengis.net/def/uom/OGC/1.0/</code> and
+units can be added to the <code>UnitsRegistry</code> using the <code>javax.measure.Unit</code> API).
+These URIs are all in the namespace <code>http://www.opengis.net/def/uom/OGC/1.0/</code> and
here use the prefix <code>units</code>.</p>
<table>
<thead>
@@ -677,22 +671,20 @@ convert datasets from Geo predicates to GeoSPARQL structure, see:
However, only certain spatial relations are valid for <code>Point</code> to <code>Point</code> relationships.
Refer to pages 8-10 of 11-052r4 GeoSPARQL standard for more details.</p>
<p>Geo predicates can be converted to Geometry Literals in query and then used with the GeoSPARQL filter functions.</p>
-<pre><code> ?subj wgs:lat ?lat .
- ?subj wgs:long ?lon .
- BIND(spatialF:convertLatLon(?lat, ?lon) as ?point) .
- #Coordinate order is Lon/Lat without stated SRS URI.
- BIND("POLYGON((...))"^^<http://www.opengis.net/ont/geosparql#wktLiteral> AS ?box) .
- FILTER(geof:sfContains(?box, ?point))
-</code></pre>
-<p>Alternatively, utilising more shapes, relations and spatial reference systems
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">wgs</span>:<span style="color:#008000;font-weight:bold">lat</span> <span style="color:#b8860b">?lat</span> .
+</span></span><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">wgs</span>:<span style="color:#008000;font-weight:bold">long</span> <span style="color:#b8860b">?lon</span> .
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">BIND</span>(<span style="color:#00f;font-weight:bold">spatialF</span>:<span style="color:#008000;font-weight:bold">convertLatLon</span>(<span style="color:#b8860b">?lat</span>, <span style="color:#b8860b">?lon</span>) <span style="color:#a2f;font-weight:bold">as</span> <span style="color:#b8860b">?point</span>) .
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">#Coordinate order is Lon/Lat without stated SRS URI.</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">BIND</span>(<span style="color:#b44">"POLYGON((...))"</span><span style="color:#666">^^</span><span style="color:#a0a000"><http://www.opengis.net/ont/geosparql#wktLiteral></span> <span style="color:#a2f;font-weight:bold">AS</span> <span style="color:#b8860b">?box</span>) .
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FILTER</span>(<span style="color:#00f;font-weight:bold">geof</span>:<span style="color:#008000;font-weight:bold">sfContains</span>(<span style="color:#b8860b">?box</span>, <span style="color:#b8860b">?point</span>))
+</span></span></code></pre></div><p>Alternatively, utilising more shapes, relations and spatial reference systems
can be achieved by converting the dataset to the GeoSPARQL structure.</p>
-<pre><code> ?subj geo:hasGeometry ?geom .
- ?geom geo:hasSerialization ?geomLit .
- #Coordinate order is Lon/Lat without stated SRS URI.
- BIND("POLYGON((...))"^^<http://www.opengis.net/ont/geosparql#wktLiteral> AS ?box) .
- FILTER(geof:sfContains(?box, ?geomLit))
-</code></pre>
-<p>Datasets can contain both Geo predicates and Geometry Literals without
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?subj</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasGeometry</span> <span style="color:#b8860b">?geom</span> .
+</span></span><span style="display:flex;"><span><span style="color:#b8860b">?geom</span> <span style="color:#00f;font-weight:bold">geo</span>:<span style="color:#008000;font-weight:bold">hasSerialization</span> <span style="color:#b8860b">?geomLit</span> .
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">#Coordinate order is Lon/Lat without stated SRS URI.</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">BIND</span>(<span style="color:#b44">"POLYGON((...))"</span><span style="color:#666">^^</span><span style="color:#a0a000"><http://www.opengis.net/ont/geosparql#wktLiteral></span> <span style="color:#a2f;font-weight:bold">AS</span> <span style="color:#b8860b">?box</span>) .
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FILTER</span>(<span style="color:#00f;font-weight:bold">geof</span>:<span style="color:#008000;font-weight:bold">sfContains</span>(<span style="color:#b8860b">?box</span>, <span style="color:#b8860b">?geomLit</span>))
+</span></span></code></pre></div><p>Datasets can contain both Geo predicates and Geometry Literals without
interference. However, a dataset containing both types will only examine those
<code>Features</code> which have Geometry Literals for spatial relations, i.e. the check
for Geo predicates is a fallback when Geometry Literals aren’t found.
diff --git a/content/documentation/index.xml b/content/documentation/index.xml
index 3a1f6c051..ff09e765a 100644
--- a/content/documentation/index.xml
+++ b/content/documentation/index.xml
@@ -247,7 +247,7 @@ SERVICE is a feature of SPARQL 1.1 that allows an executing query to make a SPAR
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/programmatic.html</guid>
- <description>It is possible to build queries by building and abstract syntax tree (as the parser does) or by building the algebra expression for the query. It is usually better to work with the algebra form as it is more regular.
+ <description>It is possible to build queries by building and abstract syntax tree (as the parser does) or by building the algebra expression for the query. It is usually better to work with the algebra form as it is more regular.
See the examples such as arq.examples.algrebra.AlgebraExec at jena-examples:arq/examples
See also ARQ - SPARQL Algebra
ARQ documentation index</description>
@@ -387,8 +387,8 @@ A regular join only executes the RHS once, and the variables from the LHS are us
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/logging.html</guid>
- <description>ARQ uses SLF4j as the logging API and the query and RIOT commands use Log4J2 as a deployment system. You can use Java 1.4 logging instead.
-ARQ does not output any logging messages at level INFO in normal operation. The code uses level TRACE and DEBUG. Running with logging set to an application at INFO will cause no output in normal operation. Output below INFO can be very verbose and is intended mainly to help debug ARQ.</description>
+ <description>ARQ uses SLF4j as the logging API and the query and RIOT commands use Log4J2 as a deployment system. You can use Java 1.4 logging instead.
+ARQ does not output any logging messages at level INFO in normal operation. The code uses level TRACE and DEBUG. Running with logging set to an application at INFO will cause no output in normal operation. Output below INFO can be very verbose and is intended mainly to help debug ARQ.</description>
</item>
<item>
@@ -420,7 +420,8 @@ From your application The QueryExecutionHTTP has methods for creating a QueryExe
<guid>https://jena.apache.org/documentation/query/rdf_lists.html</guid>
<description>RDF collections, also called RDF lists, are difficult to query directly.
-ARQ provides a 3 property functions to work with RDF collections. list:member &ndash; members of a list list:index &ndash; index of a member in a list list:length &ndash; length of a list list:member is similar to rdfs:member except for RDF lists. ARQ also provides rdfs:member.
+ARQ provides a 3 property functions to work with RDF collections.
+list:member &ndash; members of a list list:index &ndash; index of a member in a list list:length &ndash; length of a list list:member is similar to rdfs:member except for RDF lists. ARQ also provides rdfs:member.
See the property functions library page.
ARQ documentation index</description>
</item>
@@ -531,7 +532,7 @@ ARQ documentation index</description>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/property_paths.html</guid>
- <description>ARQ - Property Paths A property path is a possible route through a graph between two graph nodes. A trivial case is a property path of length exactly one, which is a triple pattern.
+ <description>ARQ - Property Paths A property path is a possible route through a graph between two graph nodes. A trivial case is a property path of length exactly one, which is a triple pattern.
Most property paths are now legal SPARQL 1.1 syntax, there are some advanced property paths which are syntactic extensions and are only available if the query is parsed with language Syntax.syntaxARQ.
Path Language A property path expression (or just &lsquo;path&rsquo;) is similar to a string regular expression but over properties, not characters.</description>
</item>
@@ -708,7 +709,7 @@ The original source code is available. Documentation index The brief guide. The
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/library-function.html</guid>
- <description>The regular expressions for fan:localname and afn:namespace were incorrect. SPARQL allows custom functions in expressions so that queries can be used on domain-specific data. SPARQL defines a function by URI (or prefixed name) in FILTER expressions. ARQ provides a function library and supports application-provided functions. Functions and property functions can be registered or dynamically loaded.
+ <description>The regular expressions for fan:localname and afn:namespace were incorrect. SPARQL allows custom functions in expressions so that queries can be used on domain-specific data. SPARQL defines a function by URI (or prefixed name) in FILTER expressions. ARQ provides a function library and supports application-provided functions. Functions and property functions can be registered or dynamically loaded.
Applications can also provide their own functions.
ARQ also provides an implementation the Leviathan Function Library.</description>
</item>
@@ -886,7 +887,7 @@ RDF 1.1 Turtle RDF 1.1 Trig RDF 1.1 N-Triples RDF 1.1 N-Quads JSON-LD </descript
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/geosparql/geosparql-assembler.html</guid>
- <description>Details of the GeoSPARQL support are proivded on the GeoSPARQL page.
+ <description>Details of the GeoSPARQL support are provided on the GeoSPARQL page.
The assembler for GeoSPARQL support is part of the jena-geosparql artifact and must be on the Fuseki server classpath, along with its dependencies.
&lt;dependency&gt; &lt;groupId&gt;org.apache.jena&lt;/groupId&gt; &lt;artifactId&gt;jena-geosparql&lt;/artifactId&gt; &lt;version&gt;...&lt;/version&gt; &lt;/dependency&gt; or download the binary from the Maven central repository org/apache/jena/jena-geosparql
The GeoSPARQL assembler can be used in a Fuseki configuration file.
@@ -1105,7 +1106,7 @@ NOTE The permissions system caches intermediate results and will only call the e
<guid>https://jena.apache.org/documentation/extras/querybuilder/</guid>
<description>Overview Query Builder provides implementations of Ask, Construct, Select and Update builders that allow developers to create queries without resorting to StringBuilders or similar solutions. The Query Builder module is an extra package and is found in the jena-querybuilder jar.
Each of the builders has a series of methods to define the query. Each method returns the builder for easy chaining. The example:
-SelectBuilder sb = new SelectBuilder() .addVar( &quot;*&quot; ) .</description>
+SelectBuilder sb = new SelectBuilder() .addVar( &#34;*&#34; ) .</description>
</item>
<item>
@@ -1261,7 +1262,7 @@ Generating query/update strings in code without lots of error prone and messy st
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/notes/rdf-frames.html</guid>
- <description>The origins of RDF as a representation language include frame languages, in which an object, or frame, was the main unit of structuring data. Frames have slots, for example a Person frame might have an age slot, a heightslot etc. RDF, however, has taken a step beyond frame languages by making rdf:Property a first class value, not an element of a frame or resource per se. In RDF, for example, an age property can be defined: &lt;rdf:Property rdf:ID=&quot;age& [...]
+ <description>The origins of RDF as a representation language include frame languages, in which an object, or frame, was the main unit of structuring data. Frames have slots, for example a Person frame might have an age slot, a heightslot etc. RDF, however, has taken a step beyond frame languages by making rdf:Property a first class value, not an element of a frame or resource per se. In RDF, for example, an age property can be defined: &lt;rdf:Property rdf:ID=&quot;age& [...]
</item>
<item>
@@ -1975,7 +1976,7 @@ import org.apache.jena.tdb2.TDB2Factory; ... public static void main(String[] ar
<guid>https://jena.apache.org/documentation/tdb2/tdb2_fuseki.html</guid>
<description>TDB2 is incorporated into Fuseki2, both in the full server, with UI, and embeddable Fuseki2 main server.
The TDB2 database can be in a configuration file, either a complete server configuration (see below) or as an entry in the FUSEKI_BASE/configuration/ area of the full server.
-The command line start-up for Fuseki (both full and basic versions) uses the the --tdb2 flag to modify the --loc argument to work with a TDB2 dataset.</description>
+The command line start-up for Fuseki (both full and basic versions) uses the --tdb2 flag to modify the --loc argument to work with a TDB2 dataset.</description>
</item>
<item>
diff --git a/content/documentation/inference/index.html b/content/documentation/inference/index.html
index ca0fd087c..72c876d7a 100644
--- a/content/documentation/inference/index.html
+++ b/content/documentation/inference/index.html
@@ -401,7 +401,7 @@
RDF data to create an inference model. This can either be done by putting all
the RDF data into one Model or by separating into two components - schema and
instance data. For some external reasoners a hard separation may be required.
- For all of the built in reasoners the separation is arbitrary. The prime value
+ For all of the built-in reasoners the separation is arbitrary. The prime value
of this separation is to allow some deductions from one set of data (typically
some schema definitions) to be efficiently applied to several subsidiary sets
of data (typically sets of instance data).</p>
@@ -432,69 +432,61 @@
have a resource "a" with value "foo" for "p".
This could be done by writing an RDF/XML or N3 file and reading that in but
we have chosen to use the RDF API:</p>
-<pre><code>String NS = "urn:x-hp-jena:eg/";
-
-// Build a trivial example data set
-Model rdfsExample = ModelFactory.createDefaultModel();
-Property p = rdfsExample.createProperty(NS, "p");
-Property q = rdfsExample.createProperty(NS, "q");
-rdfsExample.add(p, RDFS.subPropertyOf, q);
-rdfsExample.createResource(NS+"a").addProperty(p, "foo");
-</code></pre>
-<p>Now we can create an inference model which performs RDFS inference over this
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>String NS <span style="color:#666">=</span> <span style="color:#b44">"urn:x-hp-jena:eg/"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Build a trivial example data set
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model rdfsExample <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>Property p <span style="color:#666">=</span> rdfsExample<span style="color:#666">.</span><span style="color:#b44">createProperty</span><span style="color:#666">(</span>NS<span style="color:#666">,</span> <span style="color:#b44">"p"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Property q <span style="color:#666">=</span> rdfsExample<span style="color:#666">.</span><span style="color:#b44">createProperty</span><span style="color:#666">(</span>NS<span style="color:#666">,</span> <span style="color:#b44">"q"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>rdfsExample<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span>p<span style="color:#666">,</span> RDFS<span style="color:#666">.</span><span style="color:#b44">subPropertyOf</span><span style="color:#666">,</span> q<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>rdfsExample<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span>NS<span style="color:#666">+</span><span style="color:#b44">"a"</span><span style="color:#666">).</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>p<span style="color:#666">,</span> <span style="color:#b44">"foo"</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>Now we can create an inference model which performs RDFS inference over this
data by using:</p>
-<pre><code>InfModel inf = ModelFactory.createRDFSModel(rdfsExample); // [1]
-</code></pre>
-<p>We can then check that resulting model shows that "a" also has property
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createRDFSModel</span><span style="color:#666">(</span>rdfsExample<span style="color:#666">);</span> <span style="color:#080;font-style:italic">// [1]
+</span></span></span></code></pre></div><p>We can then check that resulting model shows that "a" also has property
"q" of value "foo" by virtue of the subPropertyOf entailment:</p>
-<pre><code>Resource a = inf.getResource(NS+"a");
-System.out.println("Statement: " + a.getProperty(q));
-</code></pre>
-<p>Which prints the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource a <span style="color:#666">=</span> inf<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span>NS<span style="color:#666">+</span><span style="color:#b44">"a"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"Statement: "</span> <span style="color:#666">+</span> a<span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>q<span style="color:#666">));</span>
+</span></span></code></pre></div><p>Which prints the output:</p>
<pre> <i> Statement: [urn:x-hp-jena:eg/a, urn:x-hp-jena:eg/q, Literal<foo>]</i>
</pre>
<p>Alternatively we could have created an empty inference model and then added
in the statements directly to that model.</p>
<p>If we wanted to use a different reasoner which is not available as a convenience
method or wanted to configure one we would change line [1]. For example, to
- create the same set up manually we could replace \[1\] by:</p>
-<pre><code>Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
-InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</code></pre>
-<p>or even more manually by</p>
-<pre><code>Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null);
-InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</code></pre>
-<p>The purpose of creating a new reasoner instance like this variant would be
+ create the same setup manually we could replace \[1\] by:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> ReasonerRegistry<span style="color:#666">.</span><span style="color:#b44">getRDFSReasoner</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rdfsExample<span style="color:#666">);</span>
+</span></span></code></pre></div><p>or even more manually by</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> RDFSRuleReasonerFactory<span style="color:#666">.</span><span style="color:#b44">theInstance</span><span style="color:#666">().</span><span style="color:#b44">create</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold [...]
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rdfsExample<span style="color:#666">);</span>
+</span></span></code></pre></div><p>The purpose of creating a new reasoner instance like this variant would be
to enable configuration parameters to be set. For example, if we were to listStatements
on inf Model we would see that it also "includes" all the RDFS axioms,
of which there are quite a lot. It is sometimes useful to suppress these and
only see the "interesting" entailments. This can be done by setting
the processing level parameter by creating a description of a new reasoner configuration
and passing that to the factory method:</p>
-<pre><code>Resource config = ModelFactory.createDefaultModel()
- .createResource()
- .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "simple");
-Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(config);
-InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</code></pre>
-<p>This is a rather long winded way of setting a single parameter, though it can
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource config <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPsetRDFSLevel</span><span style="color:#666">,</span> <span style="color:#b44">"simple"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> RDFSRuleReasonerFactory<span style="color:#666">.</span><span style="color:#b44">theInstance</span><span style="color:#666">().</span><span style="color:#b44">create</span><span style="color:#666">(</span>config<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rdfsExample<span style="color:#666">);</span>
+</span></span></code></pre></div><p>This is a rather long winded way of setting a single parameter, though it can
be useful in the cases where you want to store this sort of configuration information
in a separate (RDF) configuration file. For hardwired cases the following alternative
is often simpler:</p>
-<pre><code>Reasoner reasoner = RDFSRuleReasonerFactory.theInstance()Create(null);
-reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel,
- ReasonerVocabulary.RDFS_SIMPLE);
-InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</code></pre>
-<p>Finally, supposing you have a more complex set of schema information, defined
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> RDFSRuleReasonerFactory<span style="color:#666">.</span><span style="color:#b44">theInstance</span><span style="color:#666">()</span>Create<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:# [...]
+</span></span><span style="display:flex;"><span>reasoner<span style="color:#666">.</span><span style="color:#b44">setParameter</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPsetRDFSLevel</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">RDFS_SIMPLE</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rdfsExample<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Finally, supposing you have a more complex set of schema information, defined
in a Model called <i>schema,</i> and you want to apply this schema to several
sets of instance data without redoing too many of the same intermediate deductions.
This can be done by using the SPI level methods: </p>
-<pre><code>Reasoner boundReasoner = reasoner.bindSchema(schema);
-InfModel inf = ModelFactory.createInfModel(boundReasoner, data);
-</code></pre>
-<p>This creates a new reasoner, independent from the original, which contains
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Reasoner boundReasoner <span style="color:#666">=</span> reasoner<span style="color:#666">.</span><span style="color:#b44">bindSchema</span><span style="color:#666">(</span>schema<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>boundReasoner<span style="color:#666">,</span> data<span style="color:#666">);</span>
+</span></span></code></pre></div><p>This creates a new reasoner, independent from the original, which contains
the schema data. Any queries to an InfModel created using the boundReasoner
will see the schema statements, the data statements and any statements entailed
from the combination of the two. Any updates to the InfModel will be reflected
@@ -527,19 +519,18 @@ InfModel inf = ModelFactory.createInfModel(boundReasoner, data);
which can be used for programmatic handling of the violations.</p>
<p>For example, to check a data set and list any problems one could do something
like:</p>
-<pre><code>Model data = RDFDataMgr.loadModel(fname);
-InfModel infmodel = ModelFactory.createRDFSModel(data);
-ValidityReport validity = infmodel.validate();
-if (validity.isValid()) {
- System.out.println("OK");
-} else {
- System.out.println("Conflicts");
- for (Iterator i = validity.getReports(); i.hasNext(); ) {
- System.out.println(" - " + i.next());
- }
-}
-</code></pre>
-<p>The file <code>testing/reasoners/rdfs/dttest2.nt</code> declares a property
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model data <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span>fname<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel infmodel <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createRDFSModel</span><span style="color:#666">(</span>data<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>ValidityReport validity <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">validate</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>validity<span style="color:#666">.</span><span style="color:#b44">isValid</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"OK"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"Conflicts"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>Iterator i <span style="color:#666">=</span> validity<span style="color:#666">.</span><span style="color:#b44">getReports</span><span style="color:#666">();</span> i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">();</span> <span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> i<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>The file <code>testing/reasoners/rdfs/dttest2.nt</code> declares a property
<code>bar</code> with range <code>xsd:integer</code> and attaches a <code>bar</code>
value to some resource with the value <code>"25.5"^^xsd:decimal</code>.
If we run the above sample code on this file we see:</p>
@@ -608,7 +599,7 @@ if (validity.isValid()) {
reasoners this functionality is available for <code>rdfs:subClassOf</code> and
<code>rdfs:subPropertyOf</code> and the direct aliases for these are defined
in <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/vocabulary/ReasonerVocabulary.html"><code>ReasonerVocabulary</code></a>.</p>
-<p>Typically the easiest way to work with such indirect and direct relations is
+<p>Typically, the easiest way to work with such indirect and direct relations is
to use the <a href="../ontology/index.html">Ontology API</a> which hides the
grubby details of these property aliases.</p>
<h4 id="derivations">Derivations</h4>
@@ -628,31 +619,28 @@ if (validity.isValid()) {
any queries are made to the inference model.</p>
<p>As an illustration suppose that we have a raw data model which asserts three
triples:</p>
-<pre><code>eg:A eg:p eg:B .
-eg:B eg:p eg:C .
-eg:C eg:p eg:D .
-</code></pre>
-<p>and suppose that we have a trivial rule set which computes the transitive closure
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">A</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">p</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;fo [...]
+</span></span><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">B</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">p</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">C</span> .
+</span></span><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">C</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">p</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">D</span> .
+</span></span></code></pre></div><p>and suppose that we have a trivial rule set which computes the transitive closure
over relation eg:p</p>
-<pre><code>String rules = "[rule1: (?a eg:p ?b) (?b eg:p ?c) -&gt; (?a eg:p ?c)]";
-Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
-reasoner.setDerivationLogging(true);
-InfModel inf = ModelFactory.createInfModel(reasoner, rawData);
-</code></pre>
-<p>Then we can query whether eg:A is related through eg:p to eg:D and list the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>String rules <span style="color:#666">=</span> <span style="color:#b44">"[rule1: (?a eg:p ?b) (?b eg:p ?c) -&gt; (?a eg:p ?c)]"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> GenericRuleReasoner<span style="color:#666">(</span>Rule<span style="color:#666">.</span><span style="color:#b44">parseRules</span><span style="color:#666">(</span>rules<span style="color:#666">));</span>
+</span></span><span style="display:flex;"><span>reasoner<span style="color:#666">.</span><span style="color:#b44">setDerivationLogging</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rawData<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Then we can query whether eg:A is related through eg:p to eg:D and list the
derivation route using the following code fragment: </p>
-<pre><code>PrintWriter out = new PrintWriter(System.out);
-for (StmtIterator i = inf.listStatements(A, p, D); i.hasNext(); ) {
- Statement s = i.nextStatement();
- System.out.println("Statement is " + s);
- for (Iterator id = inf.getDerivation(s); id.hasNext(); ) {
- Derivation deriv = (Derivation) id.next();
- deriv.printTrace(out, true);
- }
-}
-out.flush();
-</code></pre>
-<p>Which generates the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>PrintWriter out <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> PrintWriter<span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>StmtIterator i <span style="color:#666">=</span> inf<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>A<span style="color:#666">,</span> p<span style="color:#666">,</span> D<span style="color:#666">);</span> i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="co [...]
+</span></span><span style="display:flex;"><span> Statement s <span style="color:#666">=</span> i<span style="color:#666">.</span><span style="color:#b44">nextStatement</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"Statement is "</span> <span style="color:#666">+</span> s<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>Iterator id <span style="color:#666">=</span> inf<span style="color:#666">.</span><span style="color:#b44">getDerivation</span><span style="color:#666">(</span>s<span style="color:#666">);</span> id<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">();</span> <span style="color:#666">)</span> <span style="c [...]
+</span></span><span style="display:flex;"><span> Derivation deriv <span style="color:#666">=</span> <span style="color:#666">(</span>Derivation<span style="color:#666">)</span> id<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> deriv<span style="color:#666">.</span><span style="color:#b44">printTrace</span><span style="color:#666">(</span>out<span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span>out<span style="color:#666">.</span><span style="color:#b44">flush</span><span style="color:#666">();</span>
+</span></span></code></pre></div><p>Which generates the output:</p>
<pre><i>Statement is [urn:x-hp:eg/A, urn:x-hp:eg/p, urn:x-hp:eg/D]
Rule rule1 concluded (eg:A eg:p eg:D) <-
Fact (eg:A eg:p eg:B)
@@ -729,13 +717,11 @@ out.flush();
then the RDFS reasoner implements all RDFS entailments except for the bNode
closure rules. These closure rules imply, for example, that for all triples
of the form:</p>
-<pre><code>eg:a eg:p nnn^^datatype .
-</code></pre>
-<p>we should introduce the corresponding blank nodes:</p>
-<pre><code>eg:a eg:p _:anon1 .
-_:anon1 rdf:type datatype .
-</code></pre>
-<p>Whilst such rules are both correct and necessary to reduce RDF datatype entailment
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">p</span> <span style="">nnn</span>^^<span style="color:#00a000">datatype</span> .
+</span></span></code></pre></div><p>we should introduce the corresponding blank nodes:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">eg</span>:<span style="color:#008000;font-weight:bold">p</span> <span style="color:#a0a000">_:anon1</span> .
+</span></span><span style="display:flex;"><span><span style="color:#a0a000">_:anon1</span> <span style="color:#00f;font-weight:bold">rdf</span>:<span style="color:#008000;font-weight:bold">type</span> <span style="color:#00a000">datatype</span> .
+</span></span></code></pre></div><p>Whilst such rules are both correct and necessary to reduce RDF datatype entailment
down to simple entailment they are not useful in implementation terms. In Jena
simple entailment can be implemented by translating a graph containing bNodes
to an equivalent query containing variables in place of the bNodes. Such a query
@@ -772,17 +758,15 @@ _:anon1 rdf:type datatype .
the standard. </dd>
</dl>
<p>The level can be set using the <code>setParameter</code> call, e.g.</p>
-<pre><code>reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel,
- ReasonerVocabulary.RDFS_SIMPLE);
-</code></pre>
-<p>or by constructing an RDF configuration description and passing that to the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>reasoner<span style="color:#666">.</span><span style="color:#b44">setParameter</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPsetRDFSLevel</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">RDFS_SIMPLE</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>or by constructing an RDF configuration description and passing that to the
RDFSRuleReasonerFactory e.g.</p>
-<pre><code>Resource config = ModelFactory.createDefaultModel()
- .createResource()
- .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "simple");
-Reasoner reasoner = RDFSRuleReasonerFactory.theInstance()Create(config);
-</code></pre>
-<h4 id="summary-of-parameters">Summary of parameters</h4>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource config <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPsetRDFSLevel</span><span style="color:#666">,</span> <span style="color:#b44">"simple"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> RDFSRuleReasonerFactory<span style="color:#666">.</span><span style="color:#b44">theInstance</span><span style="color:#666">()</span>Create<span style="color:#666">(</span>config<span style="color:#666">);</span>
+</span></span></code></pre></div><h4 id="summary-of-parameters">Summary of parameters</h4>
<table width="90%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="22%"><b>Parameter</b></td>
@@ -836,56 +820,52 @@ Reasoner reasoner = RDFSRuleReasonerFactory.theInstance()Create(config);
<p>As a complete worked example let us create a simple RDFS schema, some instance
data and use an instance of the RDFS reasoner to query the two.</p>
<p>We shall use a trivial schema:</p>
-<pre><code> <rdf:Description rdf:about="eg:mum">
- <rdfs:subPropertyOf rdf:resource="eg:parent"/>
- </rdf:Description>
-
- <rdf:Description rdf:about="eg:parent">
- <rdfs:range rdf:resource="eg:Person"/>
- <rdfs:domain rdf:resource="eg:Person"/>
- </rdf:Description>
-
- <rdf:Description rdf:about="eg:age">
- <rdfs:range rdf:resource="xsd:integer" />
- </rdf:Description>
-</code></pre>
-<p>This defines a property <code>parent</code> from <code>Person</code> to <code>Person</code>,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"eg:mum"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:subPropertyOf</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"eg:parent"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"eg:parent"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:range</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"eg:Person"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:domain</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"eg:Person"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"eg:age"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:range</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"xsd:integer"</span> <span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span></code></pre></div><p>This defines a property <code>parent</code> from <code>Person</code> to <code>Person</code>,
a sub-property <code>mum</code> of <code>parent</code> and an integer-valued
property <code>age</code>.</p>
<p>We shall also use the even simpler instance file:</p>
-<pre><code> <Teenager rdf:about="eg:colin">
- <mum rdf:resource="eg:rosy" />
- <age>13</age>
- </Teenager>
-</code></pre>
-<p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><Teenager</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"eg:colin"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><mum</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"eg:rosy"</span> <span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><age></span>13<span style="color:#008000;font-weight:bold"></age></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></Teenager></span>
+</span></span></code></pre></div><p>
Which defines a <code>Teenager</code> called <code>colin</code> who has a <code>mum</code>
<code>rosy</code> and an <code>age</code> of 13.</p>
<p>Then the following code fragment can be used to read files containing these
definitions, create an inference model and query it for information on the <code>rdf:type</code>
of <code>colin</code> and the <code>rdf:type</code> of <code>Person</code>:</p>
-<pre><code>Model schema = RDFDataMgr.loadModel("file:data/rdfsDemoSchema.rdf");
-Model data = RDFDataMgr.loadModel("file:data/rdfsDemoData.rdf");
-InfModel infmodel = ModelFactory.createRDFSModel(schema, data);
-
-Resource colin = infmodel.getResource("urn:x-hp:eg/colin");
-System.out.println("colin has types:");
-printStatements(infmodel, colin, RDF.type, null);
-
-Resource Person = infmodel.getResource("urn:x-hp:eg/Person");
-System.out.println("\nPerson has types:");
-printStatements(infmodel, Person, RDF.type, null);
-</code></pre>
-<p>This produces the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model schema <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data/rdfsDemoSchema.rdf"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Model data <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data/rdfsDemoData.rdf"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel infmodel <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createRDFSModel</span><span style="color:#666">(</span>schema<span style="color:#666">,</span> data<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Resource colin <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span><span style="color:#b44">"urn:x-hp:eg/colin"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"colin has types:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>printStatements<span style="color:#666">(</span>infmodel<span style="color:#666">,</span> colin<span style="color:#666">,</span> RDF<span style="color:#666">.</span><span style="color:#b44">type</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>Resource Person <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span><span style="color:#b44">"urn:x-hp:eg/Person"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"\nPerson has types:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>printStatements<span style="color:#666">(</span>infmodel<span style="color:#666">,</span> Person<span style="color:#666">,</span> RDF<span style="color:#666">.</span><span style="color:#b44">type</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>This produces the output:</p>
<pre><i>colin has types:
- (eg:colin rdf:type eg:Teenager)
- (eg:colin rdf:type rdfs:Resource)
- (eg:colin rdf:type eg:Person)
-<p>Person has types:</p>
-<ul>
-<li>(eg:Person rdf:type rdfs:Class)</li>
-<li>(eg:Person rdf:type rdfs:Resource)</i></pre></li>
-</ul>
+
+Person has types:
+ - (eg:Person rdf:type rdfs:Class)
+ - (eg:Person rdf:type rdfs:Resource)</i></pre>
<p>This says that <code>colin</code> is both a <code>Teenager</code> (by direct
definition), a <code>Person</code> (because he has a <code>mum</code> which
means he has a <code>parent</code> and the domain of <code>parent</code> is
@@ -893,17 +873,17 @@ printStatements(infmodel, Person, RDF.type, null);
is an <code>rdfs:Class</code>, even though that wasn't explicitly in the schema,
because it is used as object of range and domain statements.</p>
<p>If we add the additional code:</p>
-<pre>ValidityReport validity = infmodel.validate();
-if (validity.isValid()) {
- System.out.println("\nOK");
-} else {
- System.out.println("\nConflicts");
- for (Iterator i = validity.getReports(); i.hasNext(); ) {
- ValidityReport.Report report = (ValidityReport.Report)i.next();
- System.out.println(" - " + report);
- }
-}</pre>
-<p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>ValidityReport validity <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">validate</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>validity<span style="color:#666">.</span><span style="color:#b44">isValid</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"\nOK"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"\nConflicts"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>Iterator i <span style="color:#666">=</span> validity<span style="color:#666">.</span><span style="color:#b44">getReports</span><span style="color:#666">();</span> i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">();</span> <span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ValidityReport<span style="color:#666">.</span><span style="color:#b44">Report</span> report <span style="color:#666">=</span> <span style="color:#666">(</span>ValidityReport<span style="color:#666">.</span><span style="color:#b44">Report</span><span style="color:#666">)</span>i<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> report<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>
Then we get the additional output:</p>
<pre><i>Conflicts
- Error (dtRange): Property urn:x-hp:eg/age has a typed range
@@ -1255,27 +1235,25 @@ configuration still leaves something to be desired and will the subject of futur
and "<code>bigName42</code>".</p>
<p>We can create an instance of the OWL reasoner, specialized to the demo schema
and then apply that to the demo data to obtain an inference model, as follows:</p>
-<pre><code>Model schema = RDFDataMgr.loadModel("file:data/owlDemoSchema.rdf");
-Model data = RDFDataMgr.loadModel("file:data/owlDemoData.rdf");
-Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
-reasoner = reasoner.bindSchema(schema);
-InfModel infmodel = ModelFactory.createInfModel(reasoner, data);
-</code></pre>
-<p>A typical example operation on such a model would be to find out all we know
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model schema <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data/owlDemoSchema.rdf"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Model data <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data/owlDemoData.rdf"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> ReasonerRegistry<span style="color:#666">.</span><span style="color:#b44">getOWLReasoner</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>reasoner <span style="color:#666">=</span> reasoner<span style="color:#666">.</span><span style="color:#b44">bindSchema</span><span style="color:#666">(</span>schema<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel infmodel <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> data<span style="color:#666">);</span>
+</span></span></code></pre></div><p>A typical example operation on such a model would be to find out all we know
about a specific instance, for example the <code>nForce</code> mother board.
This can be done using:</p>
-<pre><code>Resource nForce = infmodel.getResource("urn:x-hp:eg/nForce");
-System.out.println("nForce *:");
-printStatements(infmodel, nForce, null, null);
-</code></pre>
-<p> where <code>printStatements</code> is defined by: </p>
- public void printStatements(Model m, Resource s, Property p, Resource o) {
- for (StmtIterator i = m.listStatements(s,p,o); i.hasNext(); ) {
- Statement stmt = i.nextStatement();
- System.out.println(" - " + PrintUtil.print(stmt));
- }
- }
-<p>This produces the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource nForce <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span><span style="color:#b44">"urn:x-hp:eg/nForce"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"nForce *:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>printStatements<span style="color:#666">(</span>infmodel<span style="color:#666">,</span> nForce<span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p> where <code>printStatements</code> is defined by: </p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">void</span> <span style="color:#00a000">printStatements</span><span style="color:#666">(</span>Model m<span style="color:#666">,</span> Resource s<span style="color:#666">,</span> Property p<span sty [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>StmtIterator i <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>s<span style="color:#666">,</span>p<span style="color:#666">,</span>o<span style="color:#666">);</span> i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="co [...]
+</span></span><span style="display:flex;"><span> Statement stmt <span style="color:#666">=</span> i<span style="color:#666">.</span><span style="color:#b44">nextStatement</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> PrintUtil<span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span>stmt<span style="color:#666">));</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>This produces the output:</p>
<pre><i>nForce *:
- (eg:nForce rdf:type owl:Thing)
- (eg:nForce owl:sameAs eg:unknownMB)
@@ -1301,30 +1279,28 @@ printStatements(infmodel, nForce, null, null);
have a <code>gamingGraphics</code> component from the combination of the <code>nForce</code>
inferences we've already seen and the transitivity of <code>hasComponent</code>.
We can test this using:</p>
-<pre><code>Resource gamingComputer = infmodel.getResource("urn:x-hp:eg/GamingComputer");
-Resource whiteBox = infmodel.getResource("urn:x-hp:eg/whiteBoxZX");
-if (infmodel.contains(whiteBox, RDF.type, gamingComputer)) {
- System.out.println("White box recognized as gaming computer");
-} else {
- System.out.println("Failed to recognize white box correctly");
-}
-</code></pre>
-<p> Which generates the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource gamingComputer <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span><span style="color:#b44">"urn:x-hp:eg/GamingComputer"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource whiteBox <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span><span style="color:#b44">"urn:x-hp:eg/whiteBoxZX"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>infmodel<span style="color:#666">.</span><span style="color:#b44">contains</span><span style="color:#666">(</span>whiteBox<span style="color:#666">,</span> RDF<span style="color:#666">.</span><span style="color:#b44">type</span><span style="color:#666">,</span> gamingComputer<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"White box recognized as gaming computer"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"Failed to recognize white box correctly"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p> Which generates the output:</p>
<pre> <i>White box recognized as gaming computer</i></pre>
<p>Finally, we can check for inconsistencies within the data by using the validation
interface:</p>
-<pre><code>ValidityReport validity = infmodel.validate();
-if (validity.isValid()) {
- System.out.println("OK");
-} else {
- System.out.println("Conflicts");
- for (Iterator i = validity.getReports(); i.hasNext(); ) {
- ValidityReport.Report report = (ValidityReport.Report)i.next();
- System.out.println(" - " + report);
- }
-}
-</code></pre>
-<p>Which generates the output:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>ValidityReport validity <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">validate</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>validity<span style="color:#666">.</span><span style="color:#b44">isValid</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"OK"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"Conflicts"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>Iterator i <span style="color:#666">=</span> validity<span style="color:#666">.</span><span style="color:#b44">getReports</span><span style="color:#666">();</span> i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">();</span> <span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ValidityReport<span style="color:#666">.</span><span style="color:#b44">Report</span> report <span style="color:#666">=</span> <span style="color:#666">(</span>ValidityReport<span style="color:#666">.</span><span style="color:#b44">Report</span><span style="color:#666">)</span>i<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> report<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Which generates the output:</p>
<pre><i>Conflicts
- Error (conflict): Two individuals both same and different, may be
due to disjoint classes or functional properties
@@ -1343,9 +1319,9 @@ Implicated node: eg:bigNameSpecialMB</i>
class expressions.</p>
<p>For example, given a model containing the RDF assertions corresponding to the
two OWL axioms:</p>
-<pre>class A = intersectionOf (minCardinality(P, 1), maxCardinality(P,1))
-class B = cardinality(P,1)</pre>
-<p>Then the reasoner can demonstrate that classes A and B are equivalent, in particular
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">class</span> <span style="color:#00f">A</span> <span style="color:#666">=</span> intersectionOf <span style="color:#666">(</span>minCardinality<span style="color:#666">(</span>P<span style="color:#666">,</span> <span style="color:#666">1</span><span style [...]
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">class</span> <span style="color:#00f">B</span> <span style="color:#666">=</span> cardinality<span style="color:#666">(</span>P<span style="color:#666">,</span><span style="color:#666">1</span><span style="color:#666">)</span>
+</span></span></code></pre></div><p>Then the reasoner can demonstrate that classes A and B are equivalent, in particular
that any instance of A is an instance of B and vice versa. However, given a
model just containing the first set of assertions you cannot directly query
the inference model for the individual triples that make up <i>cardinality(P,1)</i>.
@@ -1516,22 +1492,16 @@ or number // e.g. 42 or 25.5</pre></p>
</p>
<p>
Rule files may be loaded and parsed using:
-<pre>
-List rules = Rule.rulesFromURL("file:myfile.rules");
-</pre>
-or
-<pre>
-BufferedReader br = /* open reader */ ;
-List rules = Rule.parseRules( Rule.rulesParserFromReader(br) );
-</pre>
-or
-<pre>
-String ruleSrc = /* list of rules in line */
-List rules = Rule.parseRules( rulesSrc );
-</pre>
-In the first two cases (reading from a URL or a BufferedReader) the rule file is
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>List rules <span style="color:#666">=</span> Rule<span style="color:#666">.</span><span style="color:#b44">rulesFromURL</span><span style="color:#666">(</span><span style="color:#b44">"file:myfile.rules"</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>or</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>BufferedReader br <span style="color:#666">=</span> <span style="color:#080;font-style:italic">/* open reader */</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>List rules <span style="color:#666">=</span> Rule<span style="color:#666">.</span><span style="color:#b44">parseRules</span><span style="color:#666">(</span> Rule<span style="color:#666">.</span><span style="color:#b44">rulesParserFromReader</span><span style="color:#666">(</span>br<span style="color:#666">)</span> <span style="color:#666">);</span>
+</span></span></code></pre></div><p>or</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>String ruleSrc <span style="color:#666">=</span> <span style="color:#080;font-style:italic">/* list of rules in line */</span>
+</span></span><span style="display:flex;"><span>List rules <span style="color:#666">=</span> Rule<span style="color:#666">.</span><span style="color:#b44">parseRules</span><span style="color:#666">(</span> rulesSrc <span style="color:#666">);</span>
+</span></span></code></pre></div><p>In the first two cases (reading from a URL or a BufferedReader) the rule file is
preprocessed by a simple processor which strips comments and supports some additional
-macro commands:
+macro commands:</p>
<dl>
<dt><code># ...</code></dt>
<dd>A comment line.</dd>
@@ -1552,17 +1522,14 @@ URL for a rule file use one of the keywords
<code>OWLMini</code> (case insensitive).
</dd>
</dl>
-<p>
-So an example complete rule file which includes the RDFS rules and defines
-a single extra rule is:
-<pre><code># Example rule file
-@prefix pre: <http://jena.hpl.hp.com/prefix#>.
-@include <RDFS>.
-
-[rule1: (?f pre:father ?a) (?u pre:brother ?f) -> (?u pre:uncle ?a)]
-</code></pre>
-</p>
-<p>[<a href="#rules">Rule Index</a>] [<a href="#index">Main Index</a>]</p>
+<p>So an example complete rule file which includes the RDFS rules and defines
+a single extra rule is:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#080;font-style:italic"># Example rule file</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">pre:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/prefix#></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">@include</span><span style="color:#bbb"> </span><span style="color:#b8860b"><RDFS></span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[<span style="">rul</span><span style="color:#666">e1</span>:<span style="color:#bbb"> </span>(<span style="">?f</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">pre:</span><span style="color:#008000;font-weight:bold">father</span><span style="color:#bbb"> </span><span style="">?a</span>)<span style="color:#bbb"> </span>(<span style="">?u</span><span style="color:#bbb"> [...]
+</span></span></span></code></pre></div><p>[<a href="#rules">Rule Index</a>] [<a href="#index">Main Index</a>]</p>
<h3 id="RULEforward">Forward chaining engine</h3>
<p>If the rule reasoner is configured to run in forward mode then only the forward
chaining engine will be used. The first time the inference Model is queried
@@ -1646,10 +1613,9 @@ triple(s1, p1, o1) :- triple(sb1, pb1, ob1), ...
property is tabled then goals such as <code>(A, ?P, ?X)</code> will all be tabled
because the property variable might match one of the tabled properties.</p>
<p>Thus the rule set:</p>
-<pre>
--> table(rdfs:subClassOf).
-[r1: (?A rdfs:subClassOf ?C) <- (?A rdfs:subClassOf ?B) (?B rdfs:subClassOf ?C)]</pre>
-<p>will successfully compute the transitive closure of the subClassOf relation.
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-></span><span style="color:#bbb"> </span><span style="">table</span>(<span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span>).<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[<span style="">r</span><span style="color:#666">1</span>:<span style="color:#bbb"> </span>(<span style="">?A</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">subClassOf</span><span style="color:#bbb"> </span><span style="">?C</span>)<span style="color:#bbb"> </span><span style=""><-</span><span style="color:#bb [...]
+</span></span></span></code></pre></div><p>will successfully compute the transitive closure of the subClassOf relation.
Any query of the form (*, rdfs:subClassOf, *) will be satisfied by a mixture
of ground facts and resolution of rule r1. Without the first line this rule
would be an infinite loop. </p>
@@ -1714,11 +1680,11 @@ might be run in either backward or forward mode then they should be limited to a
into the Reasoner factory in an RDF Model.</p>
<p>The primary parameter required to instantiate a useful <code>GenericRuleReasoner</code>
is a rule set which can be passed into the constructor, for example:</p>
-<pre>String ruleSrc = "[rule1: (?a eg:p ?b) (?b eg:p ?c) -> (?a eg:p ?c)]";
+<pre tabindex="0"><code class="language-javas" data-lang="javas">String ruleSrc = "[rule1: (?a eg:p ?b) (?b eg:p ?c) -&gt; (?a eg:p ?c)]";
List rules = Rule.parseRules(ruleSrc);
...
-Reasoner reasoner = new GenericRuleReasoner(rules);</pre>
-<p>A short cut, useful when the rules are defined in local text files using the
+Reasoner reasoner = new GenericRuleReasoner(rules);</pre>
+</code></pre><p>A short cut, useful when the rules are defined in local text files using the
syntax described earlier, is the <code>ruleSet</code> parameter which gives
a file name which should be loadable from either the classpath or relative to
the current working directory.<br>
@@ -2035,27 +2001,27 @@ do not "pollute" the inference results.</div>
and to build a rule reasoner to implement this.</p>
<p>As a simple design we define two properties eg:concatFirst, eg:concatSecond
which declare the first and second properties in a concatenation. Thus the triples:</p>
-<pre>eg:r eg:concatFirst eg:p .
-eg:r eg:concatSecond eg:q . </pre>
-<p>mean that the property r = p o q.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">r</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">concatFirst</span><span style="color:#bbb"> </span><span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">r</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">concatSecond</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">q</span><span style=" [...]
+</span></span></span></code></pre></div><p>mean that the property r = p o q.</p>
<p>Suppose we have a Jena Model rawModel which contains the above assertions together
with the additional facts:</p>
-<pre>eg:A eg:p eg:B .
-eg:B eg:q eg:C .</pre>
-<p>Then we want to be able to conclude that A is related to C through the composite
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">A</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">p</span><span style="color:#bbb"> </span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">B</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">q</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">eg:</span><span style="color:#008000;font-weight:bold">C</span><span style="color:#bbb" [...]
+</span></span></span></code></pre></div><p>Then we want to be able to conclude that A is related to C through the composite
relation r. The following code fragment constructs and runs a rule reasoner
instance to implement this:</p>
-<pre>String rules =
- "[r1: (?c eg:concatFirst ?p), (?c eg:concatSecond ?q) -> " +
- " [r1b: (?x ?c ?y) <- (?x ?p ?z) (?z ?q ?y)] ]";
-Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
-InfModel inf = ModelFactory.createInfModel(reasoner, rawData);
-System.out.println("A * * =>");
-Iterator list = inf.listStatements(A, null, (RDFNode)null);
-while (list.hasNext()) {
- System.out.println(" - " + list.next());
-}</pre>
-<p>When run on a rawData model contain the above four triples this generates the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>String rules <span style="color:#666">=</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"[r1: (?c eg:concatFirst ?p), (?c eg:concatSecond ?q) -&gt; "</span> <span style="color:#666">+</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">" [r1b: (?x ?c ?y) &lt;- (?x ?p ?z) (?z ?q ?y)] ]"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Reasoner reasoner <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> GenericRuleReasoner<span style="color:#666">(</span>Rule<span style="color:#666">.</span><span style="color:#b44">parseRules</span><span style="color:#666">(</span>rules<span style="color:#666">));</span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> rawData<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"A * * =&gt;"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Iterator list <span style="color:#666">=</span> inf<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>A<span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#666">(</span>RDFNode<span style="color:#666">)</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>list<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> list<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>When run on a rawData model contain the above four triples this generates the
(correct) output:</p>
<pre><i>A * * =>
- [urn:x-hp:eg/A, urn:x-hp:eg/p, urn:x-hp:eg/B]
@@ -2068,28 +2034,32 @@ while (list.hasNext()) {
<p>This time we'll put the rules in a separate file to simplify editing them and
we'll use the machinery for configuring a reasoner using an RDF specification.
The code then looks something like this:</p>
-<pre>// Register a namespace for use in the demo
-String demoURI = "http://jena.hpl.hp.com/demo#";
-PrintUtil.registerPrefix("demo", demoURI);
-<p>// Create an (RDF) specification of a hybrid reasoner which
-// loads its data from an external file.
-Model m = ModelFactory.createDefaultModel();
-Resource configuration = m.createResource();
-configuration.addProperty(ReasonerVocabulary.PROPruleMode, “hybrid”);
-configuration.addProperty(ReasonerVocabulary.PROPruleSet, “data/demo.rules”);</p>
-<p>// Create an instance of such a reasoner
-Reasoner reasoner = GenericRuleReasonerFactory.theInstance().create(configuration);</p>
-<p>// Load test data
-Model data = RDFDataMgr.loadModel(“file:data/demoData.rdf”);
-InfModel infmodel = ModelFactory.createInfModel(reasoner, data);</p>
-<p>// Query for all things related to “a” by “p”
-Property p = data.getProperty(demoURI, “p”);
-Resource a = data.getResource(demoURI + “a”);
-StmtIterator i = infmodel.listStatements(a, p, (RDFNode)null);
-while (i.hasNext()) {
-System.out.println(" - " + PrintUtil.print(i.nextStatement()));
-}</pre></p>
-<p>Here is file <code>data/demo.rules</code> which defines property <code>demo:p</code>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Register a namespace for use in the demo
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>String demoURI <span style="color:#666">=</span> <span style="color:#b44">"http://jena.hpl.hp.com/demo#"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>PrintUtil<span style="color:#666">.</span><span style="color:#b44">registerPrefix</span><span style="color:#666">(</span><span style="color:#b44">"demo"</span><span style="color:#666">,</span> demoURI<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Create an (RDF) specification of a hybrid reasoner which
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// loads its data from an external file.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model m <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>Resource configuration <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>configuration<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPruleMode</span><span style="color:#666">,</span> <span style="color:#b44">"hybrid"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>configuration<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>ReasonerVocabulary<span style="color:#666">.</span><span style="color:#b44">PROPruleSet</span><span style="color:#666">,</span> <span style="color:#b44">"data/demo.rules"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Create an instance of such a reasoner
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Reasoner reasoner <span style="color:#666">=</span> GenericRuleReasonerFactory<span style="color:#666">.</span><span style="color:#b44">theInstance</span><span style="color:#666">().</span><span style="color:#b44">create</span><span style="color:#666">(</span>configuration<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Load test data
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model data <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data/demoData.rdf"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>InfModel infmodel <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> data<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Query for all things related to "a" by "p"
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Property p <span style="color:#666">=</span> data<span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>demoURI<span style="color:#666">,</span> <span style="color:#b44">"p"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource a <span style="color:#666">=</span> data<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span>demoURI <span style="color:#666">+</span> <span style="color:#b44">"a"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>StmtIterator i <span style="color:#666">=</span> infmodel<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>a<span style="color:#666">,</span> p<span style="color:#666">,</span> <span style="color:#666">(</span>RDFNode<span style="color:#666">)</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>i<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" - "</span> <span style="color:#666">+</span> PrintUtil<span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span>i<span style="color:#666">.</span><span style="color:#b44">nextStatem [...]
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Here is file <code>data/demo.rules</code> which defines property <code>demo:p</code>
as being both symmetric and transitive using pure forward rules:</p>
<pre>[transitiveRule: (?A demo:p ?B), (?B demo:p ?C) -> (?A > demo:p ?C) ]
[symmetricRule: (?Y demo:p ?X) -> (?X demo:p ?Y) ] </pre>
@@ -2151,16 +2121,15 @@ System.out.println(" - " + PrintUtil.print(i.nextStatement()));
should be forward, all the inferences which need all of the results of the RDFS/OWL rules
should be backward. Note that the RDFS and OWL rulesets assume certain settings
for the GenericRuleReasoner so a typical configuration is:</p>
-<pre><code>Model data = RDFDataMgr.loadModel("file:data.n3");
-List rules = Rule.rulesFromURL("myrules.rules");
-
-GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
-reasoner.setOWLTranslation(true); // not needed in RDFS case
-reasoner.setTransitiveClosureCaching(true);
-
-InfModel inf = ModelFactory.createInfModel(reasoner, data);
-</code></pre>
-<p>Where the <code>myrules.rules</code> file will use <code>@include</code> to include
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model data <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">loadModel</span><span style="color:#666">(</span><span style="color:#b44">"file:data.n3"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>List rules <span style="color:#666">=</span> Rule<span style="color:#666">.</span><span style="color:#b44">rulesFromURL</span><span style="color:#666">(</span><span style="color:#b44">"myrules.rules"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>GenericRuleReasoner reasoner <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> GenericRuleReasoner<span style="color:#666">(</span>rules<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>reasoner<span style="color:#666">.</span><span style="color:#b44">setOWLTranslation</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">);</span> <span style="color:#080;font-style:italic">// not needed in RDFS case
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>reasoner<span style="color:#666">.</span><span style="color:#b44">setTransitiveClosureCaching</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span>InfModel inf <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createInfModel</span><span style="color:#666">(</span>reasoner<span style="color:#666">,</span> data<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Where the <code>myrules.rules</code> file will use <code>@include</code> to include
one of the RDFS or OWL rule sets.</p>
<p>One useful variant on this option, at least in simple cases, is
to manually include a pure (non-hybrid) ruleset for the RDFS/OWL fragment
@@ -2191,14 +2160,14 @@ InfModel inf = ModelFactory.createInfModel(reasoner, data);
[ (?X rb:violation error('summary', 'description', args)) <- ...) ] .</pre>
<p>The validation calls can be "switched on" by inserting an
additional triple into the graph of the form:</p>
-<pre>_:anon rb:validation on() .</pre>
-<p>This makes it possible to build rules, such as the template above, which are
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a0a000">_:anon</span> <span style="color:#00f;font-weight:bold">rb</span>:<span style="color:#008000;font-weight:bold">validation</span> <span style="">on</span>() .
+</span></span></code></pre></div><p>This makes it possible to build rules, such as the template above, which are
ignored unless validation has been switched on - thus avoiding potential overhead
in normal operation. This is optional and the "validation on()" guard
can be omitted.</p>
<p>Then the validate call queries the inference graph for all triples of the form:</p>
-<pre>?x rb:violation f(summary, description, args) .</pre>
-<p>The subject resource is the "prime suspect" implicated in the inconsistency,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">rb</span>:<span style="color:#008000;font-weight:bold">violation</span> <span style="">f</span>(<span style="">summary</span>, <span style="">description</span>, <span style="">args</span>) .
+</span></span></code></pre></div><p>The subject resource is the "prime suspect" implicated in the inconsistency,
the relation<code> rb:violation</code> is a reserved property used to communicate
validation reports from the rules to the reasoner, the object is a structured
(functor-valued) literal. The name of the functor indicates the type of violation
diff --git a/content/documentation/io/json-ld-11.html b/content/documentation/io/json-ld-11.html
index 305741089..0603addc0 100644
--- a/content/documentation/io/json-ld-11.html
+++ b/content/documentation/io/json-ld-11.html
@@ -214,15 +214,15 @@ licensed under the
force the language choice to be JSON-LD 1.1 with
<a href="https://jena.apache.org/documentation/javadoc/arq/org.apache.jena.arq/org/apache/jena/riot/RDFParser.html"><code>RDFParser</code></a>
using <code>forceLang(Lang.JSONLD11)</code>:</p>
-<pre tabindex="0"><code>RDFParser.source(...)
- .forceLang(Lang.JSONLD11)
- ...
- .build()
-</code></pre><p>or short-cut form:</p>
-<pre tabindex="0"><code>RDFParser.source(URL or InputStream)
- .forceLang(Lang.JSONLD11)
- .parse(dataset);
-</code></pre>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>RDFParser<span style="color:#666">.</span><span style="color:#b44">source</span><span style="color:#666">(...)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">forceLang</span><span style="color:#666">(</span>Lang<span style="color:#666">.</span><span style="color:#b44">JSONLD11</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">build</span><span style="color:#666">()</span>
+</span></span></code></pre></div><p>or short-cut form:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>RDFParser<span style="color:#666">.</span><span style="color:#b44">source</span><span style="color:#666">(</span>URL or InputStream<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">forceLang</span><span style="color:#666">(</span>Lang<span style="color:#666">.</span><span style="color:#b44">JSONLD11</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">parse</span><span style="color:#666">(</span>dataset<span style="color:#666">);</span>
+</span></span></code></pre></div>
</article>
<aside class="text-muted align-self-start mb-3 mb-xl-5 p-0 d-none d-xl-flex flex-column sticky-top">
diff --git a/content/documentation/io/rdfxml-input.html b/content/documentation/io/rdfxml-input.html
index 43cbe306f..64c9d0048 100644
--- a/content/documentation/io/rdfxml-input.html
+++ b/content/documentation/io/rdfxml-input.html
@@ -231,7 +231,7 @@ of errors, IRI resolution, and treatment of base IRIs as other RIOT readers.</p>
object that is an instance of an ARP parser, by using the
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReaderF.html#getReader()"><code>getReader</code></a><code>()</code>
method on any <code>Model</code>. It is then configured using the
-[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput0/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput0/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
method. This changes the properties for parsing RDF/XML. Many of
the properties change the RDF parser, some change the XML parser.
(The Jena RDF/XML parser, ARP, implements the
@@ -239,7 +239,7 @@ the properties change the RDF parser, some change the XML parser.
over a <a href="http://xml.apache.org/xerces2-j/index.html">Xerces2-J</a> XML
parser). However, changing the features and properties of the XML
parser is not likely to be useful, but was easy to implement.</p>
-<p>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput0/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+<p>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput0/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
can be used to set and get:</p>
<ul>
<li>ARP properties
diff --git a/content/documentation/io/rdfxml-output.html b/content/documentation/io/rdfxml-output.html
index 26887dd88..f977083ce 100644
--- a/content/documentation/io/rdfxml-output.html
+++ b/content/documentation/io/rdfxml-output.html
@@ -321,7 +321,7 @@ that writer.</p>
<td><tt>Resource[]</tt> or <tt>String</tt></td>
<td></td>
</tr>
-<tr>
+<tr>
<td><tt>prettyTypes</tt></td>
<td>
Only for the RDF/XML-ABBREV writer. This is a list of the types of
diff --git a/content/documentation/io/rdfxml_howto.html b/content/documentation/io/rdfxml_howto.html
index 7ad3d27fb..9a6ce6df2 100644
--- a/content/documentation/io/rdfxml_howto.html
+++ b/content/documentation/io/rdfxml_howto.html
@@ -226,17 +226,17 @@ This is import to correctly handle character sets.</p>
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> interface.
These are:</p>
<ul>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.InputStream, java.lang.String))<code>(java.io.InputStream in, java.lang.String base)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.InputStream, java.lang.String))<code>(java.io.InputStream in, java.lang.String base)</code>
<br />Add statements from an RDF/XML serialization</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.InputStream, java.lang.String, java.lang.String))<code>(java.io.InputStream in, java.lang.String base, java.lang.String lang)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.InputStream, java.lang.String, java.lang.String))<code>(java.io.InputStream in, java.lang.String base, java.lang.String lang)</code>
<br /> Add RDF statements represented in language <code>lang</code> to the model.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.lang.String)"><code>read</code></a><code>(java.lang.String url)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.lang.String)"><code>read</code></a><code>(java.lang.String url)</code>
<br />Add the RDF statements from an XML document.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream)"><code>write</code></a><code>(java.io.OutputStream out)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream)"><code>write</code></a><code>(java.io.OutputStream out)</code>
<br /> Write the model as an XML document.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream, java.lang.String))<code>(java.io.OutputStream out, java.lang.String lang)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream, java.lang.String))<code>(java.io.OutputStream out, java.lang.String lang)</code>
<br />Write a serialized representation of a model in a specified language.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream, java.lang.String, java.lang.String))<code>(java.io.OutputStream out, java.lang.String lang, java.lang.String base)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.OutputStream, java.lang.String, java.lang.String))<code>(java.io.OutputStream out, java.lang.String lang, java.lang.String base)</code>
<br />Write a serialized representation of a model in a specified language.</li>
</ul>
<p>The built-in languages are <code>"RDF/XML"</code>, <code>"RDF/XML-ABBREV"</code> as well as
@@ -254,7 +254,7 @@ errors. Most incorrect usage of <code>Reader</code>s for RDF/XML input will
result in such errors. Most incorrect usage of <code>Writer</code>s for RDF/XML
output will produce correct XML by using an appropriate XML
declaration giving the encoding - e.g.</p>
-<pre><code><?xml version='1.0' encoding='ISO-8859-15'?>
+<pre><code><?xml version='1.0' encoding='ISO-8859-15'?>
</code></pre>
<p>However, such XML is less portable than XML in UTF-8. Using the
<code>Model.write(OutputStream …)</code> methods allows the Jena system
@@ -343,21 +343,21 @@ These do not need to be encoded and decoded so a character encoding
does not need to be specified. Other examples are when an advanced
user explicitly wishes to correctly control the encoding.</p>
<ul>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.Reader, java.lang.String))<code>(java.io.Reader reader, java.lang.String base)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.Reader, java.lang.String))<code>(java.io.Reader reader, java.lang.String base)</code>
<br />Using this method is often a mistake.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.Reader, java.lang.String, java.lang.String))<code>(java.io.Reader reader, java.lang.String base, java.lang.String lang)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>read</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#read(java.io.Reader, java.lang.String, java.lang.String))<code>(java.io.Reader reader, java.lang.String base, java.lang.String lang)</code>
<br />Using this method is often a mistake.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer)"><code>write</code></a><code>(java.io.Writer writer)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer)"><code>write</code></a><code>(java.io.Writer writer)</code>
<br />Caution! Write the model as an XML document.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer, java.lang.String))<code>(java.io.Writer writer, java.lang.String lang)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer, java.lang.String))<code>(java.io.Writer writer, java.lang.String lang)</code>
<br /> Caution! Write a serialized representation of a model in a specified language.</li>
-<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer, java.lang.String, java.lang.String))<code>(java.io.Writer writer, java.lang.String lang, java.lang.String base)</code>
+<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html"><code>Model</code></a> [<code>write</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#write(java.io.Writer, java.lang.String, java.lang.String))<code>(java.io.Writer writer, java.lang.String lang, java.lang.String base)</code>
<br /> Caution! Write a serialized representation of a model in a specified language.</li>
</ul>
-<p>Incorrect use of these <code>read(Reader, …)</code> methods results in
+<p>Incorrect use of these <code>read(Reader, …)</code> methods results in
warnings and errors with RDF/XML and RDF/XML-ABBREV (except in a
few cases where the incorrect use cannot be automatically
-detected). Incorrect use of the <code>write(Writer, …)</code> methods
+detected). Incorrect use of the <code>write(Writer, …)</code> methods
results in peculiar XML declarations such as
<code><?xml version="1.0" encoding="WINDOWS-1252"?></code>. This would reflect
that the character encoding you used (probably without realizing)
@@ -389,13 +389,13 @@ above.</p>
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReaderF.html#getReader()"><code>getReader</code></a><code>()</code>
<br />Return an RDFReader instance for the default serialization language.</li>
<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html"><code>RDFReader</code></a>
-<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReaderF.html#getReader(java.lang.String)"><code>getReader</code></a><code>(java.lang.String lang)</code>
+<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReaderF.html#getReader(java.lang.String)"><code>getReader</code></a><code>(java.lang.String lang)</code>
<br />Return an RDFReader instance for the specified serialization language.</li>
<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html"><code>RDFReader</code></a>
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFWriterF.html#getWriter()"><code>getWriter</code></a><code>()</code>
<br />Return an RDFWriter instance for the default serialization language.</li>
<li><a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html"><code>RDFReader</code></a>
-<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFWriterF.html#getWriter(java.lang.String)"><code>getWriter</code></a><code>(java.lang.String lang)</code>
+<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFWriterF.html#getWriter(java.lang.String)"><code>getWriter</code></a><code>(java.lang.String lang)</code>
<br />An RDFWriter instance for the specified serialization language.</li>
</ul>
<p>Each of these calls returns an <code>RDFReader</code> or <code>RDFWriter</code> that can be
@@ -410,7 +410,7 @@ methods, these interfaces provide:</p>
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html#setErrorHandler(org.apache.jena.rdf.model.RDFErrorHandler)"><code>setErrorHandler</code></a><code>(</code> <a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFErrorHandler.html">RDFErrorHandler</a> <code>errHandler )</code>
<br />Set an error handler for the reader</li>
<li><code>java.lang.Object</code>
-[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html#setProperty(java.lang.String, java.lang.Object))<code>(java.lang.String propName, java.lang.Object propValue)</code>
+[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReader.html#setProperty(java.lang.String, java.lang.Object))<code>(java.lang.String propName, java.lang.Object propValue)</code>
<br />Set the value of a reader property.</li>
</ul>
<p>Setting properties, or the error handler, on an <code>RDFReader</code> or an
@@ -452,15 +452,15 @@ prove easier.</p>
<code>RDFReader</code> and the <code>RDFWriter</code>. N3 has options on the <code>RDFWriter</code>. These
options are detailed below. For RDF/XML they are also found in the
JavaDoc for
-<code>JenaReader.</code>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+<code>JenaReader.</code>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
and
-<code>RDFXMLWriterI.</code>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/xmloutput/RDFXMLWriterI.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>.</p>
+<code>RDFXMLWriterI.</code>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/xmloutput/RDFXMLWriterI.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>.</p>
<h2 id="advanced-rdfxml-input">Advanced RDF/XML Input</h2>
<p>For access to these advanced features, first get an <code>RDFReader</code>
object that is an instance of an ARP parser, by using the
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFReaderF.html#getReader()"><code>getReader</code></a><code>()</code>
method on any <code>Model</code>. It is then configured using the
-[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
method. This changes the properties for parsing RDF/XML. Many of
the properties change the RDF parser, some change the XML parser.
(The Jena RDF/XML parser, ARP, implements the
@@ -468,7 +468,7 @@ the properties change the RDF parser, some change the XML parser.
over a <a href="http://xml.apache.org/xerces2-j/index.html">Xerces2-J</a> XML
parser). However, changing the features and properties of the XML
parser is not likely to be useful, but was easy to implement.</p>
-<p>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+<p>[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
can be used to set and get:</p>
<ul>
<li>ARP properties
@@ -617,7 +617,7 @@ the appropriate language, by using
or
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFWriterF.html#getWriter(java.lang.String)"><code>getWriter</code></a><code>("RDF/XML-ABBREV")</code>
on any <code>Model</code>. It is then configured using the
-[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
+[<code>setProperty</code>](/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdfxml/xmlinput/JenaReader.html#setProperty(java.lang.String, java.lang.Object))<code>(String, Object)</code>
method. This changes the properties for writing RDF/XML.</p>
<h3 id="properties-to-control-rdfxml-output">Properties to Control RDF/XML Output</h3>
<table>
@@ -743,7 +743,7 @@ that writer.</p>
<td><tt>Resource[]</tt> or <tt>String</tt></td>
<td></td>
</tr>
-<tr>
+<tr>
<td><tt>prettyTypes</tt></td>
<td>
Only for the RDF/XML-ABBREV writer. This is a list of the types of
diff --git a/content/documentation/notes/rdf-frames.html b/content/documentation/notes/rdf-frames.html
index 7c21fc690..7a9916571 100644
--- a/content/documentation/notes/rdf-frames.html
+++ b/content/documentation/notes/rdf-frames.html
@@ -197,7 +197,7 @@ frame might have an <code>age</code> slot, a <code>height</code>slot etc. RDF, h
has taken a step beyond frame languages by making <code>rdf:Property</code> a
first class value, not an element of a frame or resource <em>per se</em>.
In RDF, for example, an age property can be defined:
-<code><rdf:Property rdf:ID="age"></code>, and then applied to any resource,
+<code><rdf:Property rdf:ID="age"></code>, and then applied to any resource,
including, but not limited to a <code>Person</code> resource.</p>
<p>While this introduces an extra element of modelling flexibility in
RDF, it is often the case that users want to treat some components
@@ -290,19 +290,19 @@ false, would entail the additional <code>rdf:type</code> statement that the
<code>LivingThing</code> is also an <code>Animal</code>.</p>
<p>For more complex class expressions in the domain, we look to see
what simple domain constraints are entailed. For example, a domain
-constraint <code>A ∩ B</code> (i.e. “A intersection B”) for property <code>p</code>
-entails that both <code>p rdfs:domain A</code> and <code>p rdfs:domain B</code> are true.
+constraint <code>A ∩ B</code> (i.e. “A intersection B”) for property <code>p</code>
+entails that both <code>p rdfs:domain A</code> and <code>p rdfs:domain B</code> are true.
However, the properties of neither <code>A</code> nor <code>B</code> will include <code>p</code>. To
see this, suppose we have a resource <code>x</code> that we already know is of
-type <code>A</code>, and a statement <code>x p y</code>. This entails <code>x rdf:type A</code>
-which we already know, but also <code>x rdf:type B</code>. So information is
+type <code>A</code>, and a statement <code>x p y</code>. This entails <code>x rdf:type A</code>
+which we already know, but also <code>x rdf:type B</code>. So information is
added, even if we know that <code>x</code> is an instance <code>A</code>, so <code>p</code> is not a
property of <code>A</code>. The symmetrical argument holds for <code>p</code> not being a
property of <code>B</code>.</p>
-<p>However, if the domain of <code>p</code> is <code>A ∪ B</code> (i.e. “A union B”), then
+<p>However, if the domain of <code>p</code> is <code>A ∪ B</code> (i.e. “A union B”), then
both <code>A</code> and <code>B</code> will have <code>p</code> as a property, since an occurrence
-of, say <code>x p y</code> does not allow us to conclude that either
-<code>x rdf:type A</code> or <code>x rdf:type B</code>.</p>
+of, say <code>x p y</code> does not allow us to conclude that either
+<code>x rdf:type A</code> or <code>x rdf:type B</code>.</p>
<h2 id="property-hierarchies">Property hierarchies</h2>
<p>Since sub-properties inherit the domain constraints of their parent
property, the properties of a class will include the closure over
@@ -423,12 +423,12 @@ The old version of <code>listDeclaredProperties</code> attempted to simulate
the entailed associations between classes and properties. Users are
now advised to attach a reasoner to their models to do this.</li>
<li>Change in parameter semantics
-The old version of <code>listDeclaredProperties(boolean all)</code> took one
+The old version of <code>listDeclaredProperties(boolean all)</code> took one
parameter, a Boolean flag to indicate whether additional declared
(implied) properties should be listed. Since this is now covered by
the use, or otherwise, of a reasoner attached to the model, the new
-method signature is <code>listDeclaredProperties(boolean direct)</code>, where
-calling the method with <code>direct = true</code> will compress the returned
+method signature is <code>listDeclaredProperties(boolean direct)</code>, where
+calling the method with <code>direct = true</code> will compress the returned
results to use only the
<a href="../ontology/index.html#direct_relationships">direct</a>
associations.</li>
diff --git a/content/documentation/ontology/index.html b/content/documentation/ontology/index.html
index c27bb5a79..0b08695f3 100644
--- a/content/documentation/ontology/index.html
+++ b/content/documentation/ontology/index.html
@@ -540,7 +540,7 @@ allow us to dynamically change the Java class of the object
representing this resource. The resource has not changed: it still
has URI <code>#DigitalCamera</code>. But the appropriate Java class Jena might
choose to encapsulate it has changed from <code>OntClass</code> to <code>Restriction</code>.
-Conversely, if we subsequently remove the <code>rdf:type owl:Restriction</code>
+Conversely, if we subsequently remove the <code>rdf:type owl:Restriction</code>
from the model, using the <code>Restriction</code> Java class is no longer
appropriate.</p>
<p>Even worse, OWL Full allows us to state the following (rather
@@ -968,12 +968,12 @@ you are extending Jena’s internal structures, you should think of
<h3 id="controlling-imports-processing">Controlling imports processing</h3>
<p>By default, loading imports during the <code>read()</code> call is automatic. To
<code>read()</code> an ontology without building the imports closure, call the
-method <code>setProcessImports( false )</code> on the document manager object
+method <code>setProcessImports( false )</code> on the document manager object
before calling <code>read()</code>. Alternatively, you can set the
<code>processImports</code> property in the policy file. You can also be more
selective, and ignore only certain URI’s when loading the imported
documents. To selectively skip certain named imports, call the
-method <code>addIgnoreImport( String uri )</code> on the document manager
+method <code>addIgnoreImport( String uri )</code> on the document manager
object, or set the <code>ignoreImport</code> property in the policy.</p>
<h3 id="managing-file-references">Managing file references</h3>
<p>An advantage of working with ontologies is that we can reuse work
@@ -1055,7 +1055,7 @@ reading a fresh copy of C from C’s source URL, saving both time and
storage space.</p>
<p>Caching of import models is switched on by default. To turn it off,
use the policy property <code>cacheModels</code>, or call the method
-<code>setCacheModels( boolean caching )</code> with <code>caching = false</code>. The
+<code>setCacheModels( boolean caching )</code> with <code>caching = false</code>. The
document manager’s current model cache can be cleared at any time
by calling <code>clearCache()</code>.</p>
<h2 id="the-generic-ontology-type-ontresource">The generic ontology type: OntResource</h2>
@@ -1147,18 +1147,18 @@ available methods:</p>
</tr>
</tbody>
</table>
-<p>For example: <code>addSameAs( Resource r )</code>, or
-<code>isSameAs( Resource r )</code>. For full details of the individual
+<p>For example: <code>addSameAs( Resource r )</code>, or
+<code>isSameAs( Resource r )</code>. For full details of the individual
methods, please consult the Javadoc.</p>
<p><code>OntResource</code> defines some other general utility methods. For
example, to find out how many values a resource has for a given
-property, you can call <code>getCardinality( Property p )</code>. To delete
+property, you can call <code>getCardinality( Property p )</code>. To delete
the resource from the ontology altogether, you can call <code>remove()</code>.
The effect of this is to remove every statement that mentions this
resource as a subject or object of a statement.</p>
<p>To get the value of a given property, use
-<code>getPropertyValue( Property p )</code>. To set it,
-<code>setPropertyValue( Property p, RDFNode value )</code>. Continuing the
+<code>getPropertyValue( Property p )</code>. To set it,
+<code>setPropertyValue( Property p, RDFNode value )</code>. Continuing the
naming pattern, the values of a named property can be listed (with
<code>listPropertyValues</code>), removed (with <code>removeProperty</code>) or added
(with <code>addProperty</code>).</p>
@@ -1180,7 +1180,7 @@ also infer that <code>x</code> has <code>rdf:type</code> <code>owl:Thing</code>
resource is exactly what is needed. For other tasks, this is not
the case. If you are developing an ontology editor, for example,
you may want to distinguish in its display between inferred and
-asserted types. In the above example, only <code>x rdf:type B</code> is
+asserted types. In the above example, only <code>x rdf:type B</code> is
asserted, everything else is inferred. One way to make this
distinction is to make use of the base model (see Figure 4).
Getting the resource from the base model and listing the type
@@ -1388,7 +1388,7 @@ methods, we can access the following attributes of an
<tbody>
<tr>
<td>subProperty</td>
-<td>A sub property of this property; i.e. a property which is declared to be a <code>subPropertyOf</code> this property. If p is a sub property of q, and we know that <code>A p B</code> is true, we can infer that <code>A q B</code> is also true.</td>
+<td>A sub property of this property; i.e. a property which is declared to be a <code>subPropertyOf</code> this property. If p is a sub property of q, and we know that <code>A p B</code> is true, we can infer that <code>A q B</code> is also true.</td>
</tr>
<tr>
<td>superProperty</td>
@@ -1480,8 +1480,8 @@ property in a model, it will have the effect of asserting different
<p>OWL permits object and datatype properties to be <em>functional</em> –
that is, for a given individual in the domain, the range value will
always be the same. In particular, if <code>father</code> is a functional
-property, and individual <code>:jane</code> has <code>father :jim</code> and
-<code>father :james</code>, a reasoner is entitled to conclude that <code>:jim</code> and
+property, and individual <code>:jane</code> has <code>father :jim</code> and
+<code>father :james</code>, a reasoner is entitled to conclude that <code>:jim</code> and
<code>:james</code> denote the same individual. A functional property is
equivalent to stating that the property has a maximum cardinality
of one.</p>
@@ -1498,11 +1498,11 @@ parameter to the <code>createObjectProperty()</code> method on <code>OntModel</c
<p>There are several additional sub-types of ObjectProperty that
represent additional capabilities of ontology properties. A
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/ontology/TransitiveProperty.html"><code>TransitiveProperty</code></a>
-means that if p is transitive, and we know <code>:a p :b</code> and also
-<code>b p :c</code>, we can infer that <code>:a p :c</code>. A
+means that if p is transitive, and we know <code>:a p :b</code> and also
+<code>b p :c</code>, we can infer that <code>:a p :c</code>. A
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/ontology/SymmetricProperty.html"><code>SymmetricProperty</code></a>
-means that if p is symmetric, and we know <code>:a p :b</code>, we can infer
-<code>:b p :a</code>. An
+means that if p is symmetric, and we know <code>:a p :b</code>, we can infer
+<code>:b p :a</code>. An
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/ontology/InverseFunctionalProperty.html"><code>InverseFunctionalProperty</code></a>
means that for any given range element, the domain value is unique.</p>
<p>Given that all properties are <code>RDFNode</code> objects, and therefore
@@ -1780,7 +1780,7 @@ the front of the list. Thus the second list will run <code>c2</code> to <code>c0
the ontology operations we are discussing here, the order of values
in the list is not considered significant.</p>
<p>Finally, a resource which is a cell in a list sequence will accept
-<code>.as( RDFList.class )</code></p>
+<code>.as( RDFList.class )</code></p>
<p>Once the list has been created or obtained from the model,
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/RDFList.html"><code>RDFList</code></a>
methods may be used to access members of the list, iterate over the
@@ -1974,7 +1974,7 @@ Individual ind1 = c.createIndividual( NS + "ind1" );
second way will create the individual in the same model that the
class is attached to (see the <code>getModel()</code> method). In both of the
above examples the individual is named, but this is not necessary.
-The method <code>OntModel.createIndividual( Resource cls )</code> creates an
+The method <code>OntModel.createIndividual( Resource cls )</code> creates an
anonymous individual belonging to the given class. Note that the
type of the class parameter is only <code>Resource</code>. You are not
required to use <code>as()</code> to present a <code>Resource</code> to an <code>OntClass</code>
diff --git a/content/documentation/query/algebra.html b/content/documentation/query/algebra.html
index 04c869cc0..a1baf8868 100644
--- a/content/documentation/query/algebra.html
+++ b/content/documentation/query/algebra.html
@@ -205,7 +205,7 @@ found in the SPARQL specification in
of the algebra form to access different graph storage
implementations.</p>
<p>The classes for the datastructures for the algebra resize in the
-package <code>org.apache.jena.sparql.algebra</code> in the <code>op</code> subpackage.
+package <code>org.apache.jena.sparql.algebra</code> in the <code>op</code> subpackage.
All the classes are names “<code>Op...</code>”; the interface that they all
offer is “<code>Op</code>”.</p>
<h2 id="viewing-the-algebra-expression-for-a-query">Viewing the algebra expression for a Query</h2>
@@ -230,10 +230,10 @@ Op op = Algebra.compile(query) ;
System.out.println(query.serialize()) ;
</code></pre>
<p>This reverse translation can handle any algebra expression
-originally from a SPARQL Query, but not any algebra expression. It
+originally from a SPARQL Query, but not any algebra expression. It
is possible to create programmatically useful algebra expressions
that can not be turned into a query, especially if they involve
-algebra. Also, the query produced may not be exactly the same but
+algebra. Also, the query produced may not be exactly the same but
will yield the same results (for example, filters may be moved
because the SPARQL query algebra translation in the SPARQL
specification moves filter expressions around).</p>
@@ -248,13 +248,13 @@ Op op = SSE.readOp("filename.sse") ; // Read a file
<p>The SSE class simply calls the appropriate builder operation from
the <code>org.apache.jena.sparql.sse.builder</code> package.</p>
<p>To go with this, there is a collection of writers for many of the
-Java structures in ARQ. </p>
+Java structures in ARQ.</p>
<pre><code>Op op = ... ;
SSE.write(op) ; // Write to stdout
</code></pre>
<p>Writers default to writing to <code>System.out</code> but support calls to any
output stream (it manages the conversion to UTF-8) and ARQ own
-<code>IndentedWriter</code>s form for embedding in structured output. Again,
+<code>IndentedWriter</code>s form for embedding in structured output. Again,
SSE is simply passing the calls to the writer operation from the
<code>org.apache.jena.sparql.sse.writer</code> package.</p>
<h2 id="creating-an-algebra-expression-programmatically">Creating an algebra expression programmatically</h2>
diff --git a/content/documentation/query/app_api.html b/content/documentation/query/app_api.html
index cd46de3e8..aec398d62 100644
--- a/content/documentation/query/app_api.html
+++ b/content/documentation/query/app_api.html
@@ -333,7 +333,7 @@ Model resultModel = qexec.execConstruct() ;
qexec.close() ;
</code></pre>
<h2 id="describe-queries">DESCRIBE Queries</h2>
-<p><code>DESCRIBE</code> queries return a single RDF graph.
+<p><code>DESCRIBE</code> queries return a single RDF graph.
<a href="extension.html#describeHandlers">Different handlers</a> for the
<code>DESCRIBE</code> operation can be loaded by added by the application.</p>
<pre><code>Query query = QueryFactory.create(queryString) ;
@@ -354,7 +354,7 @@ qexec.close() ;
<a href="http://www.w3.org/TR/rdf-sparql-XMLres/">SPARQL Query Results XML Format</a>.
See ResultSetFormatter.outputAsXML method.</p>
<h2 id="datasets">Datasets</h2>
-<p>The examples above are all queries on a single model. A SPARQL
+<p>The examples above are all queries on a single model. A SPARQL
query is made on a dataset, which is a default graph and zero or
more named graphs. Datasets can be constructed using the
<code>DatasetFactory</code>:</p>
diff --git a/content/documentation/query/arq-query-eval.html b/content/documentation/query/arq-query-eval.html
index 6bdf2d4bb..044f313b2 100644
--- a/content/documentation/query/arq-query-eval.html
+++ b/content/documentation/query/arq-query-eval.html
@@ -224,7 +224,7 @@ specialised storage and also for wrapping non-RDF sources to look
like RDF. There is a common implementation framework provided by
<code>GraphBase</code> so only one operation, the <code>find</code> method, needs to be
written for a read-only data source. Basic find works well in many
-cases, and the whole Jena API will be able to use the extension.
+cases, and the whole Jena API will be able to use the extension.
For higher SPARQL performance, ARQ can be extended at the
<a href="#graph-matching-and-a-custom-stagegenerator">basic graph matching</a> or
<a href="#opexecutor">algebra level</a>.</p>
@@ -325,7 +325,7 @@ transformation is performed by a call to <code>Algebra.toQuadForm</code>.</p>
<p>Transformations proceed from the bottom of the expression tree to
the top. Algebra expressions are best treated as immutable so a
change made in one part of the tree should result in a copy of the
-tree above it. This is automated by the <code>TransformCopy</code> class
+tree above it. This is automated by the <code>TransformCopy</code> class
which is the commonly used base class for writing transforms. The
other helper base class is <code>TransformBase,</code> which provides the
identify operation (returns the node supplied) for each transform
@@ -438,13 +438,13 @@ reusing the rest of the engine.</li>
match a basic graph pattern.</p>
<h2 id="graph-matching-and-a-custom-stagegenerator">Graph matching and a custom StageGenerator</h2>
<p>The correct point to hook into ARQ for just extending basic graph
-pattern matching (BGPs) is to provide a custom <code>StageGenerator</code>.
+pattern matching (BGPs) is to provide a custom <code>StageGenerator</code>.
(To hook into filtered basic graph patterns, the extension will
need to provide its own <code>OpExecutor</code> factory). The advantage of
the <code>StageGenerator</code> mechanism, as compared to the more general
<code>OpExecutor</code> described below, is that it more self-contained and
requires less detail about the internal evaluation of the other
-SPARQL algebra operators. This extension point corresponds to
+SPARQL algebra operators. This extension point corresponds to
section 12.6
“<a href="http://www.w3.org/TR/sparql11-query/#sparqlBGPExtend">Extending SPARQL Basic Graph Matching</a>”.</p>
<p>Below is the default code to match a BGP from
@@ -452,7 +452,7 @@ section 12.6
code in the <code>StageBuilder</code> class.The input is a stream of results
from earlier stages. The execution must return a query iterator
that is all the possible ways to match the basic graph pattern for
-each of the inputs in turn. Order of results does not matter. </p>
+each of the inputs in turn. Order of results does not matter.</p>
<pre><code>protected QueryIterator execute(OpBGP opBGP, QueryIterator input)
{
BasicPattern pattern = opBGP.getPattern() ;
@@ -531,24 +531,24 @@ WHERE
FILTER regex(?title, "Paddington")
}
</code></pre>
-<p> results in the algebra expression for the pattern:</p>
+<p>results in the algebra expression for the pattern:</p>
<pre><code> (filter (regex ?title "Paddington")
(bgp (triple ?book dc:title ?title)
))
</code></pre>
<p>showing that the filter is being applied to the results of a basic
graph pattern matching.</p>
-<p>Note: this is not the way to provide custom filter operations. See
+<p>Note: this is not the way to provide custom filter operations. See
the documentation for
<a href="extension.html#filter-functions">application-provided filter functions</a>.</p>
<p>Each step of evaluation in the main query engine is performed by a
-<code>OpExecutor</code> and a new one is created from a factory at each step.
+<code>OpExecutor</code> and a new one is created from a factory at each step.
The factory is registered in the execution context. The
implementation of a specialized <code>OpExecutor</code> can inherit from the
standard one and override only those algebra operators it wishes to
deal with, including inspecting the execution and choosing to
pass up to the super-class based on the details of the
-operation. From the query above, only regex filters might be
+operation. From the query above, only regex filters might be
specially handled.</p>
<p>Registering an <code>OpExecutorFactory</code>:</p>
<pre><code>OpExecutorFactory customExecutorFactory = new MyOpExecutorFactory(...) ;
@@ -629,7 +629,7 @@ evaluation to the custom query engine.</p>
<p>New operators can be added to the algebra using the <code>OpExt</code> class
as the super-class of the new operator. They can be inserted into
the expression to be evaluated using a custom query engine to
-intercept evaluation initialization. When evaluation of a query
+intercept evaluation initialization. When evaluation of a query
requires the evaluation of a sub-class of <code>OpExt</code>, the <code>eval</code>
method is called.</p>
diff --git a/content/documentation/query/assignment.html b/content/documentation/query/assignment.html
index 22f2ce097..d13d74e09 100644
--- a/content/documentation/query/assignment.html
+++ b/content/documentation/query/assignment.html
@@ -241,7 +241,7 @@ WHERE
<h2 id="use-with-bound">Use with !BOUND</h2>
<p>The OPTIONAL/!BOUND/FILTER idiom for performing limited negation of
a pattern in SPARQL can be inconvenient because it requires a
-variable in the OPTIONAL to be assigned by pattern matching. Using
+variable in the OPTIONAL to be assigned by pattern matching. Using
a LET can make that easier; here, we assign to ?z (any value will
do) to mark when the matching pattern included the OPTIONAL
pattern.</p>
diff --git a/content/documentation/query/explain.html b/content/documentation/query/explain.html
index 3f789ed56..39851bb73 100644
--- a/content/documentation/query/explain.html
+++ b/content/documentation/query/explain.html
@@ -238,7 +238,7 @@ which applies all optimizations.</p>
<p>Examples:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>arq.qparse --explain --query Q.rq
</span></span><span style="display:flex;"><span>
-</span></span><span style="display:flex;"><span>arq.qparse --explain <span style="color:#b44">'SELECT * { ?s ?p ?o }'</span>
+</span></span><span style="display:flex;"><span>arq.qparse --explain <span style="color:#b44">'SELECT * { ?s ?p ?o }'</span>
</span></span></code></pre></div><h2 id="execution-logging">Execution Logging</h2>
<p>ARQ can log query and update execution details globally or for an
individual operations. This adds another level of control on top of the
@@ -257,7 +257,7 @@ at level “info”. So for log4j2, the following can be set in the
</span></span><span style="display:flex;"><span><span style="color:#b44">logger.arq-exec.level</span> <span style="color:#666">=</span> <span style="color:#b44">INFO</span>
</span></span></code></pre></div><p>The context setting is for key (Java constant) <code>ARQ.symLogExec</code>. To set
globally:</p>
-<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>ARQ<span style="color:#666">.</span><span style="color:#b44">setExecutionLogging</span><span style="color:#666">(</span>Explain<span style="color:#666">.</span><span style="color:#b44">InfoLevel</span><span style="color:#666">.</span><span style="color:#b44">ALL</span><span style="color:#666">)</ [...]
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>ARQ<span style="color:#666">.</span><span style="color:#b44">setExecutionLogging</span><span style="color:#666">(</span>Explain<span style="color:#666">.</span><span style="color:#b44">InfoLevel</span><span style="color:#666">.</span><span style="color:#b44">ALL</span><span style="color:#666">);</span>
</span></span></code></pre></div><p>and it may also be set on an individual query execution using its local
context.</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">()</span> <span style="color:#666">...</span> < [...]
diff --git a/content/documentation/query/extension.html b/content/documentation/query/extension.html
index f621aae38..4e6996ad4 100644
--- a/content/documentation/query/extension.html
+++ b/content/documentation/query/extension.html
@@ -223,7 +223,7 @@ property functions.</p>
<h2 id="filter-functions">Filter Functions</h2>
<p>A SPARQL custom function is implementation dependent. Most details
of the ARQ query engine do not have to be understood to write a
-function; it is a matter of implementing one interface. This is
+function; it is a matter of implementing one interface. This is
made simpler for many cases by a number of base classes that
provide much of the machinery needed.</p>
<h3 id="function-registry">Function Registry</h3>
@@ -234,7 +234,7 @@ query, a new instance is created) and there is an auto-factory
class so just registering a Java class will work. A function can
access the queried dataset.</p>
<h3 id="dynamically-loaded-functions">Dynamically Loaded Functions</h3>
-<p>The ARQ function library uses this mechanism. The namespace of the
+<p>The ARQ function library uses this mechanism. The namespace of the
ARQ function library is <code><http://jena.apache.org/ARQ/function#></code>.</p>
<pre><code>PREFIX afn: <http://jena.apache.org/ARQ/function#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
diff --git a/content/documentation/query/group-by.html b/content/documentation/query/group-by.html
index 89c22cb12..b77d7b895 100644
--- a/content/documentation/query/group-by.html
+++ b/content/documentation/query/group-by.html
@@ -215,7 +215,6 @@ clause.</p>
}
GROUP BY ?productId (?num * ?price AS ?cost)
</code></pre>
-<p> </p>
<h2 id="having">HAVING</h2>
<p>A query may specify a HAVING clause to apply a filter to the result
set after grouping. The filter may involve variables from the
@@ -262,7 +261,7 @@ HAVING (count(distinct *) > 1)
RDF terms, that is names. It is not a count of individuals because
two names can refer to the same individual.</p>
<p>If there was no explicit <code>GROUP BY</code> clause, then it is as if the
-whole of the result set forms a single group element.
+whole of the result set forms a single group element.
Equivalently, it is <code>GROUP BY</code> of no variables. Only aggregation
expressions make sense in the SELECT clause as there are no
variables from the query pattern to project out.</p>
diff --git a/content/documentation/query/library-function.html b/content/documentation/query/library-function.html
index 7bc4cf4f5..06f09e43e 100644
--- a/content/documentation/query/library-function.html
+++ b/content/documentation/query/library-function.html
@@ -195,9 +195,9 @@
<p>The regular expressions for fan:localname and afn:namespace were incorrect.
SPARQL allows custom functions in expressions so that
queries can be used on domain-specific data. SPARQL defines a
-function by URI (or prefixed name) in FILTER expressions. ARQ
+function by URI (or prefixed name) in FILTER expressions. ARQ
provides a function library and supports application-provided
-functions. Functions and property functions can be
+functions. Functions and property functions can be
<a href="extension.html">registered or dynamically loaded</a>.</p>
<p>Applications can also
<a href="writing_functions.html">provide their own functions</a>.</p>
diff --git a/content/documentation/query/library-propfunc.html b/content/documentation/query/library-propfunc.html
index 4320ddb0c..b4d5334fe 100644
--- a/content/documentation/query/library-propfunc.html
+++ b/content/documentation/query/library-propfunc.html
@@ -234,9 +234,9 @@ or bound to the length of the list.
</td><td>
Membership of an RDF Container (rdf:Bag, rdf:Seq, rdf:Alt).
Pre-registered URI. If this infers with queries running over a Jena
-inference model which also provides <code>rdfs:member</code>, then remove this
+inference model which also provides <code>rdfs:member</code>, then remove this
from the global registry.
-<code> PropertyFunctionRegistry.get().<br> remove(RDFS.member.getURI()) ;</code>
+<code> PropertyFunctionRegistry.get().<br> remove(RDFS.member.getURI()) ;</code>
</td></tr>
<tr><td>
<code>apf:textMatch</code>
@@ -273,13 +273,13 @@ see if a member of the list.
<tr><td>
<i><code>varOrTerm</code></i><code>apf:assign</code><i><code>varOrTerm</code></i>
</td><td>
-Assign an RDF term from one side to the other. If both are fixed
+Assign an RDF term from one side to the other. If both are fixed
RDF terms or bound variables, it becomes a boolean test that the
subject is the same RDF term as the object.
</td><tr>
<tr><td>
-<i><code>iri</code></i><code>apf:splitIRI (<i>namespace</i> <i> localname</i>)</code><br />
-<i><code>iri</code></i><code>apf:splitURI (<i>namespace</i> <i> localname</i>)</code>
+<i><code>iri</code></i><code>apf:splitIRI (<i>namespace</i> <i>localname</i>)</code><br />
+<i><code>iri</code></i><code>apf:splitURI (<i>namespace</i> <i>localname</i>)</code>
</td><td>
Split the IRI or URI into namespace (an IRI) and local name (a
string). Compare if given values or bound variables, otherwise set
@@ -305,7 +305,7 @@ blank node label as a plain string. Argument mismatch causes no
match. Use with care.
</td><tr>
<tr><td>
-<code><i>subject</i> apf:versionARQ <i>version</i><br> <br> </code>
+<code><i>subject</i> apf:versionARQ <i>version</i><br> <br> </code>
</td><td>
Set the <i>subject</i> to the IRI for ARQ and set the object to the
version string (format "N.N.N" where N is a number). If any of the
diff --git a/content/documentation/query/logging.html b/content/documentation/query/logging.html
index c2e00d24b..7c0bc0e87 100644
--- a/content/documentation/query/logging.html
+++ b/content/documentation/query/logging.html
@@ -189,15 +189,15 @@
<a href="http://slf4j.org/">SLF4j</a>
as the logging API and the query and RIOT commands use
<a href="http://logging.apache.org/log4j/2.x/">Log4J2</a> as a deployment
-system. You can use Java 1.4 logging instead.</p>
+system. You can use Java 1.4 logging instead.</p>
<p>ARQ does not output any logging messages at level INFO in normal
-operation. The code uses level TRACE and DEBUG. Running with
+operation. The code uses level TRACE and DEBUG. Running with
logging set to an application at INFO will cause no output in
normal operation. Output below INFO can be very verbose and is
intended mainly to help debug ARQ. WARN and FATAL messages are only
used when something is wrong.</p>
<p>The root of all the loggers is <code>org.apache.jena</code>.
-<code>org.apache.jena.query</code> is the application API.
+<code>org.apache.jena.query</code> is the application API.
<code>org.apache.jena.sparql</code> is the implementation and extensions
points.</p>
<p>If using in Tomcat, or other system that provides complex class
@@ -281,7 +281,7 @@ logger.arq-exec.level = INFO
</code></pre>
<p>The context setting is for key (Java constant) <code>ARQ.symLogExec</code>. To set
globally:</p>
-<pre><code>ARQ.setExecutionLogging(Explain.InfoLevel.ALL) ;
+<pre><code>ARQ.setExecutionLogging(Explain.InfoLevel.ALL);
</code></pre>
<p>and it may also be set on an individual query execution using its local
context.</p>
@@ -322,7 +322,7 @@ context.</p>
</table>
<p>These can be specified as string, to the command line tools, or using
the constants in <code>Explain.InfoLevel</code>.</p>
-<pre><code> qExec.getContext().set(ARQ.symLogExec, Explain.InfoLevel.FINE) ;
+<pre><code> qExec.getContext().set(ARQ.symLogExec, Explain.InfoLevel.FINE);
arq.query --set arq:logExec=FINE --data data file --query=queryfile
</code></pre>
diff --git a/content/documentation/query/manipulating_sparql_using_arq.html b/content/documentation/query/manipulating_sparql_using_arq.html
index 5080c2289..6582d59c3 100644
--- a/content/documentation/query/manipulating_sparql_using_arq.html
+++ b/content/documentation/query/manipulating_sparql_using_arq.html
@@ -201,7 +201,7 @@ blog</a></em></p>
<h2 id="inserting-values-simple-prepared-statements">Inserting values (simple prepared statements)</h2>
<p>Let’s begin with something simple. Suppose we wanted to restrict the
following query to a particular person:</p>
-<pre><code> select * { ?person <http://xmlns.com/foaf/0.1/name> ?name }
+<pre><code> select * { ?person <http://xmlns.com/foaf/0.1/name> ?name }
</code></pre>
<p><code>String#replaceAll</code> would work, but there is a safer way.
<code>QueryExecutionFactory</code> in most cases lets you supply a <code>QuerySolution</code>
@@ -221,29 +221,29 @@ query. So what how do we really alter queries?</p>
<p>ARQ provides two ways to work with queries: at the syntax level (<code>Query</code>
and <code>Element</code>), or the algebra level (<code>Op</code>). The distinction is clear in
filters:</p>
-<pre><code> SELECT ?s { ?s <http://example.com/val> ?val . FILTER ( ?val < 20 ) }
+<pre><code> SELECT ?s { ?s <http://example.com/val> ?val . FILTER ( ?val < 20 ) }
</code></pre>
<p>If you work at the syntax level you’ll find that this looks (in pseudo
code) like:</p>
-<pre><code> (GROUP (PATTERN ( ?s <http://example.com/val> ?val )) (FILTER ( < ?val 20 ) ))
+<pre><code> (GROUP (PATTERN ( ?s <http://example.com/val> ?val )) (FILTER ( < ?val 20 ) ))
</code></pre>
<p>That is there’s a group containing a triple pattern and a filter, just
as you see in the query. The algebra is different, and we can see it
using <code>arq.qparse --print op</code></p>
-<pre><code> $ java arq.qparse --print op 'SELECT ?s { ?s <http://example.com/val> ?val . FILTER ( ?val < 20 ) }'
+<pre><code> $ java arq.qparse --print op 'SELECT ?s { ?s <http://example.com/val> ?val . FILTER ( ?val < 20 ) }'
(base <file:///...>
(project (?s)
- (filter (< ?val 20)
- (bgp (triple ?s <http://example.com/val> ?val)))))
+ (filter (< ?val 20)
+ (bgp (triple ?s <http://example.com/val> ?val)))))
</code></pre>
<p>Here the filter contains the pattern, rather than sitting next to it.
This form makes it clear that the expression is filtering the pattern.</p>
<p>Let’s create that query from scratch using ARQ. We begin with some
common pieces: the triple to match, and the expression for the filter.</p>
-<pre><code> // ?s ?p ?o .
+<pre><code> // ?s ?p ?o .
Triple pattern =
Triple.create(Var.alloc("s"), Var.alloc("p"), Var.alloc("o"));
- // ( ?s < 20 )
+ // ( ?s < 20 )
Expr e = new E_LessThan(new ExprVar("s"), new NodeValueInteger(20));
</code></pre>
<p><code>Triple</code> should be familiar from jena. <code>Var</code> is an extension of <code>Node</code>
@@ -260,7 +260,7 @@ things that appear in <code>FILTER</code> and <code>LET</code>.</p>
Query q = QueryFactory.make();
q.setQueryPattern(body); // Set the body of the query to our group
q.setQuerySelectType(); // Make it a select query
- q.addResultVar("s"); // Select ?s
+ q.addResultVar("s"); // Select ?s
</code></pre>
<p>Now the algebra:</p>
<pre><code> Op op;
@@ -268,7 +268,7 @@ things that appear in <code>FILTER</code> and <code>LET</code>.</p>
pat.add(pattern); // Add our pattern match
op = new OpBGP(pat); // Make a BGP from this pattern
op = OpFilter.filter(e, op); // Filter that pattern with our expression
- op = new OpProject(op, Arrays.asList(Var.alloc("s"))); // Reduce to just ?s
+ op = new OpProject(op, Arrays.asList(Var.alloc("s"))); // Reduce to just ?s
Query q = OpAsQuery.asQuery(op); // Convert to a query
q.setQuerySelectType(); // Make is a select query
</code></pre>
@@ -302,9 +302,9 @@ I found was to generate ops from each constraint and join the results:</p>
with just three conditions:</p>
<pre><code> (join
(join
- (filter (< ?o0 20) (bgp (triple ?s <urn:ex:prop0> ?o0)))
- (filter (< ?o1 20) (bgp (triple ?s <urn:ex:prop1> ?o1))))
- (filter (< ?o2 20) (bgp (triple ?s <urn:ex:prop2> ?o2))))
+ (filter (< ?o0 20) (bgp (triple ?s <urn:ex:prop0> ?o0)))
+ (filter (< ?o1 20) (bgp (triple ?s <urn:ex:prop1> ?o1))))
+ (filter (< ?o2 20) (bgp (triple ?s <urn:ex:prop2> ?o2))))
</code></pre>
<p>Each of the constraints is a filter on a bgp. This can be made much more
readable by moving the filters out, and merging the triple patterns. We
@@ -338,11 +338,11 @@ can do this with the following <code>Transform</code>:</p>
</code></pre>
<p>As we go through the original query all joins are removed, and the
result is:</p>
-<pre><code> (filter (exprlist (< ?o0 20) (< ?o1 20) (< ?o2 20))
+<pre><code> (filter (exprlist (< ?o0 20) (< ?o1 20) (< ?o2 20))
(bgp
- (triple ?s <urn:ex:prop0> ?o0)
- (triple ?s <urn:ex:prop1> ?o1)
- (triple ?s <urn:ex:prop2> ?o2)
+ (triple ?s <urn:ex:prop0> ?o0)
+ (triple ?s <urn:ex:prop1> ?o1)
+ (triple ?s <urn:ex:prop2> ?o2)
))
</code></pre>
<p>That completes this brief introduction. There is much more to ARQ, of
diff --git a/content/documentation/query/programmatic.html b/content/documentation/query/programmatic.html
index 3bafd7359..2c6e3594b 100644
--- a/content/documentation/query/programmatic.html
+++ b/content/documentation/query/programmatic.html
@@ -183,7 +183,7 @@
<article class="flex-column me-lg-4">
<p>It is possible to build queries by building and abstract syntax
tree (as the parser does) or by building the algebra expression for
-the query. It is usually better to work with the algebra form as
+the query. It is usually better to work with the algebra form as
it is more regular.</p>
<p>See the examples such as <code>arq.examples.algrebra.AlgebraExec</code> at
<a href="https://github.com/apache/jena/tree/main/jena-examples/src/main/java/arq/examples/">jena-examples:arq/examples</a></p>
diff --git a/content/documentation/query/property_paths.html b/content/documentation/query/property_paths.html
index d796276d1..35a2590d3 100644
--- a/content/documentation/query/property_paths.html
+++ b/content/documentation/query/property_paths.html
@@ -196,7 +196,7 @@
<article class="flex-column me-lg-4">
<h1 id="arq---property-paths">ARQ - Property Paths</h1>
<p>A property path is a possible route through a graph between two
-graph nodes. A trivial case is a property path of length exactly
+graph nodes. A trivial case is a property path of length exactly
one, which is a triple pattern.</p>
<p>Most property paths are now legal SPARQL 1.1 syntax, there are some advanced property
paths which are syntactic extensions and are only available if the query is parsed with language <code>Syntax.syntaxARQ</code>.</p>
@@ -331,7 +331,7 @@ integer <em>n</em>. Such paths are fixed length. They are translated to
triple patterns by the query compiler and do not require special
path-evaluation at runtime.</p>
<p>A path of just a URI is still a single triple pattern.</p>
-<p>A path is “complex” if it involves one or more of the operators
+<p>A path is “complex” if it involves one or more of the operators
*,?, + and {}. Such paths require special evaluation and provide
expressivity outside of strict SPARQL because paths can be of
variable length. When used with models backed by SQL databases,
diff --git a/content/documentation/query/rdf_lists.html b/content/documentation/query/rdf_lists.html
index 3ed3358a7..c0c503b7a 100644
--- a/content/documentation/query/rdf_lists.html
+++ b/content/documentation/query/rdf_lists.html
@@ -183,13 +183,13 @@
<article class="flex-column me-lg-4">
<p>RDF collections, also called RDF lists, are difficult to query
directly.</p>
-<p>ARQ provides a 3 property functions to work with RDF collections. </p>
+<p>ARQ provides a 3 property functions to work with RDF collections.</p>
<ul>
<li><code>list:member</code> – members of a list</li>
<li><code>list:index</code> – index of a member in a list</li>
<li><code>list:length</code> – length of a list</li>
</ul>
-<p><code>list:member</code> is similar to <code>rdfs:member</code> except for RDF lists.
+<p><code>list:member</code> is similar to <code>rdfs:member</code> except for RDF lists.
ARQ also provides <code>rdfs:member</code>.</p>
<p>See the <a href="library-propfunc.html">property functions</a> library page.</p>
<p><a href="index.html">ARQ documentation index</a></p>
diff --git a/content/documentation/query/select_expr.html b/content/documentation/query/select_expr.html
index 2ce76980e..7d00b4518 100644
--- a/content/documentation/query/select_expr.html
+++ b/content/documentation/query/select_expr.html
@@ -192,7 +192,7 @@ the application must specify the name so using <code>AS</code> is strongly
encouraged.</p>
<p>Expressions can involve <a href="group-by.html">group aggregations</a>.</p>
<p>Expressions that do not correctly evaluate result in an unbound
-variable in the results. That is, the illegal expression is
+variable in the results. That is, the illegal expression is
silently skipped.</p>
<p>Examples:</p>
<pre><code>PREFIX : <http://example/>
@@ -201,9 +201,10 @@ SELECT (?p+1 AS ?q)
{
:x :p ?p
}
-</code></pre>
-<p> </p>
-<pre><code>PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+
+
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example/>
SELECT (count(*) AS ?count)
diff --git a/content/documentation/query/support_request.html b/content/documentation/query/support_request.html
index 3f2c1f5f5..f9ec0a042 100644
--- a/content/documentation/query/support_request.html
+++ b/content/documentation/query/support_request.html
@@ -218,7 +218,7 @@ which is your code.</p>
as well as what you actually get.</p>
<p>If you are getting no results, or less than you expected, try
cutting parts out of the query until something changes.</p>
-<p>There are various formatters for result sets included in ARQ.
+<p>There are various formatters for result sets included in ARQ.
Print your results in text form if possible. There is a
<a href="http://www.w3.org/2001/sw/DataAccess/tests/README.html">testing format</a>
used by the Data Access Working Group and that is used for the
@@ -228,7 +228,7 @@ scripted tests in the distribution.</p>
<strong>minimal</strong>. It helps you to develop a concise description of the
problem - often, you will discover the solution yourself.</p>
<p><em>Complete</em> means that any query included should include prefixes
-and the whole syntax string, not a fragment. Any program code
+and the whole syntax string, not a fragment. Any program code
should be ready to run, not a fragment of a large program.</p>
<p><em>Minimal</em> means that the data sent should be an abbreviated
selection to illustrate the point.</p>
diff --git a/content/documentation/query/text-query.html b/content/documentation/query/text-query.html
index 8b082de5f..0a59333a5 100644
--- a/content/documentation/query/text-query.html
+++ b/content/documentation/query/text-query.html
@@ -350,17 +350,16 @@ in <code>FILTER</code>s which is a test on a value retrieved earlier in the quer
so its use <em>is not indexed</em>. For example, if you’re
searching for occurrences of <code>"printer"</code> in the <code>rdfs:label</code> of a bunch
of products:</p>
-<pre><code>PREFIX ex: <http://www.example.org/resources#>
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-SELECT ?s ?lbl
-WHERE {
- ?s a ex:Product ;
- rdfs:label ?lbl
- FILTER regex(?lbl, "printer", "i")
-}
-</code></pre>
-<p>then the search will need to examine <em>all</em> selected <code>rdfs:label</code>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">ex</span>: <span style="color:#a0a000"><http://www.example.org/resources#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">rdfs</span>: <span style="color:#a0a000"><http://www.w3.org/2000/01/rdf-schema#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?lbl</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span> {
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?s</span> <span style="color:#a2f;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">ex</span>:<span style="color:#008000;font-weight:bold">Product</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">rdfs</span>:<span style="color:#008000;font-weight:bold">label</span> <span style="color:#b8860b">?lbl</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> <span style="color:#00a000">regex</span>(<span style="color:#b8860b">?lbl</span>, <span style="color:#b44">"printer"</span>, <span style="color:#b44">"i"</span>)
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>then the search will need to examine <em>all</em> selected <code>rdfs:label</code>
statements and apply the regular expression to each label in turn. If
there are many such statements and many such uses of <code>regex</code>, then it
may be appropriate to consider using this extension to take advantage of
@@ -1699,7 +1698,7 @@ indexing and search.</p>
<li>Search with queries entered in a lossy, e.g., phonetic, encoding and retrieve results entered with accurate encoding. For example, searching via Pinyin without diacritics and retrieving all possible Hans and Hant triples.</li>
</ul>
<p>The first situation arises when entering triples that include languages with multiple encodings that for various reasons are not normalized to a single encoding. In this situation it is helpful to be able to retrieve appropriate result sets without regard for the encodings used at the time that the triples were inserted into the dataset.</p>
-<p>There are several such languages of interest: Chinese, Tibetan, Sanskrit, Japanese and Korean. There are various Romanizations and ideographic variants.</p>
+<p>There are several suchlanguages of interest: Chinese, Tibetan, Sanskrit, Japanese and Korean. There are various Romanizations and ideographic variants.</p>
<p>Encodings may not be normalized when inserting triples for a variety of reasons. A principle one is that the <code>rdf:langString</code> object often must be entered in the same encoding that it occurs in some physical text that is being catalogued. Another is that metadata may be imported from sources that use different encoding conventions and it is desirable to preserve the original form.</p>
<p>The second situation arises to provide simple support for phonetic or other forms of lossy search at the time that triples are indexed directly in the Lucene system.</p>
<p>To handle the first situation a <code>text</code> assembler predicate, <code>text:searchFor</code>, is introduced that specifies a list of language tags that provides a list of language variants that should be searched whenever a query string of a given encoding (language tag) is used. For example, the following <code>text:defineAnalyzers</code> fragment :</p>
@@ -1724,11 +1723,11 @@ indexing and search.</p>
]
</code></pre>
<p>indicates that when using a search string such as “རྡོ་རྗེ་སྙིང་"@bo the Lucene index should also be searched for matches tagged as <code>bo-x-ewts</code> and <code>bo-alalc97</code>.</p>
-<p>This is made possible by a Tibetan <code>Analyzer</code> that tokenizes strings in all three encodings into Tibetan Unicode. This is feasible since the <code>bo-x-ewts</code> and <code>bo-alalc97</code> encodings are one-to-one with Unicode Tibetan. Since all fields with these language tags will have a common set of indexed terms, i.e., Tibetan Unicode, it suffices to arrange for the query analyzer to have access to the language tag for the query string along with the various fields t [...]
+<p>This is made possible by a Tibetan <code>Analyzer</code> that tokenizes strings in all three encodings into Tibetan Unicode. This is feasible since the <code>bo-x-ewts</code> and <code>bo-alalc97</code> encodings are one-to-one with Unicode Tibetan. Since all fields with these language tags will have a common set of indexed terms, i.e., Tibetan Unicode, it suffices to arrange for the query analyzer to have access to the language tag for the query string along with the various fields t [...]
<p>Supposing that the query is:</p>
-<pre><code>(?s ?sc ?lit) text:query ("rje"@bo-x-ewts)
+<pre><code>(?s ?sc ?lit) text:query ("rje"@bo-x-ewts)
</code></pre>
-<p>Then the query formed in <code>TextIndexLucene</code> will be:</p>
+<p>Then the query formed in <code>TextIndexLucene</code> will be:</p>
<pre><code>label_bo:rje label_bo-x-ewts:rje label_bo-alalc97:rje
</code></pre>
<p>which is translated using a suitable <code>Analyzer</code>, <code>QueryMultilingualAnalyzer</code>, via Lucene’s <code>QueryParser</code> to:</p>
@@ -1736,7 +1735,7 @@ indexing and search.</p>
</code></pre>
<p>which reflects the underlying Tibetan Unicode term encoding. During <code>IndexSearcher.search</code> all documents with one of the three fields in the index for term, “རྗེ”, will be returned even though the value in the fields <code>label_bo-x-ewts</code> and <code>label_bo-alalc97</code> for the returned documents will be the original value “rje”.</p>
<p>This support simplifies applications by permitting encoding independent retrieval without additional layers of transcoding and so on. It’s all done under the covers in Lucene.</p>
-<p>Solving the second situation simplifies applications by adding appropriate fields and indexing via configuration in the <code>text:defineAnalyzers</code>. For example, the following fragment:</p>
+<p>Solving the second situation simplifies applications by adding appropriate fields and indexing via configuration in the <code>text:defineAnalyzers</code>. For example, the following fragment:</p>
<pre><code> [ text:defineAnalyzer :hanzAnalyzer ;
text:analyzer [
a text:GenericAnalyzer ;
diff --git a/content/documentation/query/writing_functions.html b/content/documentation/query/writing_functions.html
index 5969629df..d3a6776e1 100644
--- a/content/documentation/query/writing_functions.html
+++ b/content/documentation/query/writing_functions.html
@@ -204,7 +204,7 @@ arguments.</p>
<p>The abstract class <code>FunctionBase</code>, the superclass of
<code>FunctionBase1</code> to <code>FunctionBase4</code>, evaluates its arguments and
calls the implementation code with argument values (if a variable
-was unbound, an error will have been generated) </p>
+was unbound, an error will have been generated)</p>
<p>It is possible to get unevaluated arguments but care must be taken
not to violate the rules of function evaluation. The standard
functions that access unevaluated arguments are the logical ‘or’
@@ -261,7 +261,7 @@ not a URI.</p>
<p>The standard library, in package
<code>org.apache.jena.sparql.function.library</code>, contains many examples.</p>
<h2 id="registering-functions">Registering Functions</h2>
-<p>The query compiler finds functions based on the functions URI.
+<p>The query compiler finds functions based on the functions URI.
There is a global registry of known functions, but any query
execution can have its own function registry.</p>
<p>For each function, there is a function factory associated with the
@@ -291,7 +291,6 @@ with the command line tools can load custom functions.</p>
FILTER (?x + f:myIntToXSD(?y))
...
</code></pre>
-<p> </p>
<p><a href="index.html">ARQ documentation index</a></p>
</article>
diff --git a/content/documentation/tdb/assembler.html b/content/documentation/tdb/assembler.html
index a9fc8760c..4ea2ab2c6 100644
--- a/content/documentation/tdb/assembler.html
+++ b/content/documentation/tdb/assembler.html
@@ -211,8 +211,8 @@ 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#>
-<#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
+<#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
.
</code></pre>
<p>Only one dataset can be stored in a location (filing system
@@ -224,8 +224,8 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
</code></pre>
<p>then there is the description of the TDB dataset itself:</p>
-<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
+<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
</code></pre>
<p>The property <code>tdb:location</code> gives the file name as a string. It is
relative to the applications current working directory, not where
@@ -238,9 +238,9 @@ description it wishes to use.</p>
<p>An assembler can specify that the default graph for query is the
union of the named graphs. This is done by adding
<em>tdb:unionDefaultGraph</em>.</p>
-<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
- tdb:unionDefaultGraph true ;
+<pre><code><#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
+ tdb:unionDefaultGraph true ;
.
</code></pre>
<h2 id="graph">Graph</h2>
@@ -253,17 +253,17 @@ 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#>
-<#dataset> rdf:type tdb:DatasetTDB ;
- tdb:location "DB" ;
+<#dataset> rdf:type tdb:DatasetTDB ;
+ tdb:location "DB" ;
-<#graph> rdf:type tdb:GraphTDB ;
+<#graph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dataset> .
</code></pre>
<p>A particular named graph in the dataset at a location can be
assembled with:</p>
-<pre><code><#graphNamed> rdf:type tdb:GraphTDB ;
+<pre><code><#graphNamed> rdf:type tdb:GraphTDB ;
tdb:dataset <#dataset> ;
- tdb:graphName <http://example/graph1> ;
+ tdb:graphName <http://example/graph1> ;
.
</code></pre>
<h2 id="mixed-datasets">Mixed Datasets</h2>
@@ -279,19 +279,19 @@ PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
# 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> ;
+<#dataset> rdf:type ja:RDFDataset ;
+ ja:defaultGraph <#graph> ;
ja:namedGraph
- [ ja:graphName <http://example.org/name1> ;
- ja:graph <#graph2> ] ;
+ [ ja:graphName <http://example.org/name1> ;
+ ja:graph <#graph2> ] ;
.
-<#graph> rdf:type tdb:GraphTDB ;
- tdb:location "DB" ;
+<#graph> rdf:type tdb:GraphTDB ;
+ tdb:location "DB" ;
.
-<#graph2> rdf:type ja:MemoryModel ;
- ja:content [ja:externalContent <file:Data/books.n3> ] ;
+<#graph2> rdf:type ja:MemoryModel ;
+ ja:content [ja:externalContent <file:Data/books.n3> ] ;
.
</code></pre>
<p>Note here we added:</p>
@@ -312,18 +312,18 @@ tdb:GraphTDB a rdfs:Class .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
-tdb:location a rdf:Property ;
+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 ;
+tdb:unionDefaultGraph a rdf:Property ;
+ rdfs:domain tdb:Dataset ;
# The range is xsd:boolean
.
-tdb:graphName a rdf:Property ;
- rdfs:domain tdb:GraphTDB ;
+tdb:graphName a rdf:Property ;
+ rdfs:domain tdb:GraphTDB ;
# range is a URI
.
</code></pre>
diff --git a/content/documentation/tdb/configuration.html b/content/documentation/tdb/configuration.html
index 8585d0d2e..7c5979d49 100644
--- a/content/documentation/tdb/configuration.html
+++ b/content/documentation/tdb/configuration.html
@@ -216,7 +216,7 @@ internal to ARQ and TDB and accessed via Java constants. Values are
any Java object, together with the values <code>true</code> and <code>false</code>, which
are short for the constants of class <code>java.lang.Boolean</code>.</p>
<p>Setting globally:</p>
-<pre><code> TDB.getContext().set(symbol, value) ;
+<pre><code> TDB.getContext().set(symbol, value) ;
</code></pre>
<p>Per query execution:</p>
<pre><code>try(QueryExecution qExec = QueryExecution.dataset(dataset)
diff --git a/content/documentation/tdb/datasets.html b/content/documentation/tdb/datasets.html
index 06a04db86..1e6f0b889 100644
--- a/content/documentation/tdb/datasets.html
+++ b/content/documentation/tdb/datasets.html
@@ -220,7 +220,7 @@ not part of the data of the union graph although it is
accessible by the special name <code><urn:x-arq:DefaultGraph\></code> in a GRAPH
pattern.</p>
<p>Set globally:</p>
-<pre><code>TDB.getContext().set(TDB.symUnionDefaultGraph, true) ;
+<pre><code>TDB.getContext().set(TDB.symUnionDefaultGraph, true) ;
</code></pre>
<p>or set on a per query basis:</p>
<pre><code>try(QueryExecution qExec = QueryExecution.dataset(dataset)
diff --git a/content/documentation/tdb/dynamic_datasets.html b/content/documentation/tdb/dynamic_datasets.html
index 48b939596..e0523eadd 100644
--- a/content/documentation/tdb/dynamic_datasets.html
+++ b/content/documentation/tdb/dynamic_datasets.html
@@ -213,13 +213,13 @@ graphs (FROM NAMED).</li>
#where the data is in the datastore as named graphs.
BASE <http://example>
-SELECT ?zName
+SELECT ?zName
FROM <alice-foaf>
FROM <bob-foaf>
{
- <http://example/Alice#me> foaf:knows ?y .
- ?y foaf:knows ?z .
- ?z foaf:name ?zName .
+ <http://example/Alice#me> foaf:knows ?y .
+ ?y foaf:knows ?z .
+ ?z foaf:name ?zName .
}
</code></pre>
diff --git a/content/documentation/tdb/faqs.html b/content/documentation/tdb/faqs.html
index 6fb13cd4b..dba02f205 100644
--- a/content/documentation/tdb/faqs.html
+++ b/content/documentation/tdb/faqs.html
@@ -306,12 +306,12 @@ eventually causing out of memory errors in Fuseki. You can see if you are exper
contains a <code>.jrnl</code> file that is non-empty then Fuseki/TDB is having to hold the journal in-memory.</p>
<p><strong>However</strong>, because this relates to transactional use and the journal is also stored on disk no data will be lost, by stopping and restarting
Fuseki the journal will be flushed to disk. When using the <a href="java_api.html">TDB Java API</a>, the journal can be flushed by closing any datasets and releasing the TDB resources.</p>
-<pre><code> Dataset dataset = TDBFactory.createDataset(directory) ;
+<pre><code> Dataset dataset = TDBFactory.createDataset(directory) ;
try{
...
- dataset.begin(ReadWrite.READ) ;
+ dataset.begin(ReadWrite.READ) ;
// Perform operations
- dataset.end() ;
+ dataset.end() ;
...
}finally{
dataset.close();
diff --git a/content/documentation/tdb/java_api.html b/content/documentation/tdb/java_api.html
index e02c05370..1a87c0c13 100644
--- a/content/documentation/tdb/java_api.html
+++ b/content/documentation/tdb/java_api.html
@@ -215,17 +215,17 @@ application run, TDB connects to the data already there.</p>
forced to disk if they have not been written already.</p>
<h3 id="using-a-directory-name">Using a directory name</h3>
<pre><code> // Make a TDB-backed dataset
- String directory = "MyDatabases/Dataset1" ;
- Dataset dataset = TDBFactory.createDataset(directory) ;
+ String directory = "MyDatabases/Dataset1" ;
+ Dataset dataset = TDBFactory.createDataset(directory) ;
...
- dataset.begin(ReadWrite.READ) ;
+ dataset.begin(ReadWrite.READ) ;
// Get model inside the transaction
- Model model = dataset.getDefaultModel() ;
- dataset.end() ;
+ Model model = dataset.getDefaultModel() ;
+ dataset.end() ;
...
- dataset.begin(ReadWrite.WRITE) ;
- model = dataset.getDefaultModel() ;
- dataset.end() ;
+ dataset.begin(ReadWrite.WRITE) ;
+ model = dataset.getDefaultModel() ;
+ dataset.end() ;
...
</code></pre>
<h3 id="using-an-assembler-file">Using an assembler file</h3>
@@ -233,13 +233,13 @@ forced to disk if they have not been written already.</p>
// This way, you can change the model being used without changing the code.
// The assembler file is a configuration file.
// The same assembler description will work in Fuseki.
- String assemblerFile = "Store/tdb-assembler.ttl" ;
- Dataset dataset = TDBFactory.assembleDataset(assemblerFile) ;
+ String assemblerFile = "Store/tdb-assembler.ttl" ;
+ Dataset dataset = TDBFactory.assembleDataset(assemblerFile) ;
...
- dataset.begin(ReadWrite.READ) ;
+ dataset.begin(ReadWrite.READ) ;
// Get model inside the transaction
- Model model = dataset.getDefaultModel() ;
- dataset.end() ;
+ Model model = dataset.getDefaultModel() ;
+ dataset.end() ;
...
</code></pre>
<p>See
@@ -267,8 +267,8 @@ consistent with the cached states because some caches are
write-behind so unwritten changes may be held in-memory.</p>
<p>TDB provides an explicit call dataset objects for
synchronization with disk:</p>
-<pre><code> Dataset dataset = ... ;
- TDB.sync(dataset ) ;
+<pre><code> Dataset dataset = ... ;
+ TDB.sync(dataset );
</code></pre>
<p>Any dataset or model can be passed to these functions - if they are
not backed by TDB then no action is taken and the call merely
diff --git a/content/documentation/tdb/optimizer.html b/content/documentation/tdb/optimizer.html
index 90af43634..0ffd9765b 100644
--- a/content/documentation/tdb/optimizer.html
+++ b/content/documentation/tdb/optimizer.html
@@ -295,7 +295,7 @@ logger.arq-info.level = INFO
</code></pre>
<p>The context setting is for key (Java constant) <code>ARQ.symLogExec</code>. To
set globally:</p>
-<pre><code>ARQ.getContext().set(ARQ.symLogExec,true) ;
+<pre><code>ARQ.getContext().set(ARQ.symLogExec,true) ;
</code></pre>
<p>and it may also be set on an individual query execution using its
local context.</p>
@@ -342,7 +342,7 @@ on the server, dataset, or endpoint:</p>
</table>
<p>These can be specified as string, to the command line tools, or
using the constants in <code>Explain.InfoLevel</code>.</p>
-<pre><code> qExec.getContext().set(ARQ.symLogExec,Explain.InfoLevel.FINE) ;
+<pre><code> qExec.getContext().set(ARQ.symLogExec,Explain.InfoLevel.FINE) ;
</code></pre>
<h2 id="tdbquery---explain">tdbquery –explain</h2>
<p>The <code>--explain</code> parameter can be used for understanding the query execution.
@@ -441,12 +441,12 @@ does have to be exact, only an indication.</p>
to RDF terms by the time a triplepatetrn is reached in the
execution plan being considered. For example, in the basic graph
pattern:</p>
-<pre><code>{ ?x :identifier 1234 .
- ?x :name ?name .
+<pre><code>{ ?x :identifier 1234 .
+ ?x :name ?name .
}
</code></pre>
-<p>then ?x will be bound in pattern ?x :name ?name to an RDF term if
-executed after the pattern ?x :identifier 1234.</p>
+<p>then ?x will be bound in pattern ?x :name ?name to an RDF term if
+executed after the pattern ?x :identifier 1234.</p>
<p>A rule is of the form:</p>
<pre><code>( (subj pred obj) count)
</code></pre>
@@ -460,9 +460,9 @@ URI | Matches a URI
LITERAL | Matches an RDF literal
BNODE | Matches an RDF blank node (in the data)
ANY |Matches anything - a term or variable</p>
-<p>From the example above, <code>(VAR :identifier TERM)</code> will match
-<code>?x :identifier 1234</code>.</p>
-<p><code>(TERM :name VAR)</code> will match <code>?x :name ?name</code> when in a potential plan
+<p>From the example above, <code>(VAR :identifier TERM)</code> will match
+<code>?x :identifier 1234</code>.</p>
+<p><code>(TERM :name VAR)</code> will match <code>?x :name ?name</code> when in a potential plan
where the <code>:identifier</code> triple pattern is first because <code>?x</code> will be a
bound term at that point but not if this triple pattern is
considered first.</p>
@@ -533,7 +533,7 @@ union graph. This can be achieved using the <code>--graph</code> option as follo
<p>The <code>graph</code> parameter uses a built-in TDB <a href="/documentation/tdb/datasets.html#special-graph-names">special graph name</a></p>
<h2 id="writing-rules">Writing Rules</h2>
<p>Rule for an inverse functional property:</p>
-<pre><code>((VAR :ifp TERM) 1 )
+<pre><code>((VAR :ifp TERM) 1 )
</code></pre>
<p>and even if a property is only approximately identifying for
resources (e.g. date of birth in a small dataset of people), it is
@@ -547,7 +547,7 @@ a particular class is common or not. In some datasets</p>
</code></pre>
<p>may help little because a property whose domain is that class, or a
subclass, may be more elective. SO a rule like:</p>
-<pre><code>((VAR :property VAR) ...)
+<pre><code>((VAR :property VAR) ...)
</code></pre>
<p>is more selective.</p>
<p>In other datasets, there may be many classes, each with a small
diff --git a/content/documentation/tdb/store-parameters.html b/content/documentation/tdb/store-parameters.html
index 6b3766cc4..2d94db1bd 100644
--- a/content/documentation/tdb/store-parameters.html
+++ b/content/documentation/tdb/store-parameters.html
@@ -210,21 +210,19 @@ persistent storage.</p>
before any other access to the disk area occurs. It is not possible to have
different setups for the same dataset on disk.</p>
<p><code>StoreParams</code> are set by populating the internal state with the setup
-before a application level dataset is created.</p>
-<pre><code>TDBFactory.setup(Location location, StoreParams params)
-</code></pre>
-<p>This must be called before any application calls to get a <code>Dataset</code> (or
+before an application level dataset is created.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>TDBFactory<span style="color:#666">.</span><span style="color:#b44">setup</span><span style="color:#666">(</span>Location location<span style="color:#666">,</span> StoreParams params<span style="color:#666">)</span>
+</span></span></code></pre></div><p>This must be called before any application calls to get a <code>Dataset</code> (or
<code>DatasetGraph</code>) object otherwise <code>IllegalStateException</code> is thrown by this
function.</p>
-<pre><code>Location location = ... ;
+<pre tabindex="0"><code class="language-hava" data-lang="hava">Location location = ... ;
StoreParams customParams = ... ;
TDBFactory.setup(location, customParams) ;
Dataset ds = TDBFactory.createDataset(location) ;
...
-</code></pre>
-<p>It is only possible to change store parameters by expelling the managed
+</code></pre><p>It is only possible to change store parameters by expelling the managed
storage by calling <code>TDBFactory.release(Location)</code>. This drops all caching.
Access to the dataset is then a cold start.</p>
<h2 id="per-connect-options">Per-connect Options</h2>
@@ -320,29 +318,27 @@ database.</p>
<p>JSON is used for the on-disk record of store parameters, see the example
below. Unspecified options defaults to the for the running setup.</p>
<p>These are default settings for a 64 bit Java:</p>
-<pre>
-{
- "tdb.file_mode" : "mapped" ,
- "tdb.block_size" : 8192 ,
- "tdb.block_read_cache_size" : 10000 ,
- "tdb.block_write_cache_size" : 2000 ,
- "tdb.node2nodeid_cache_size" : 100000 ,
- "tdb.nodeid2node_cache_size" : 500000 ,
- "tdb.node_miss_cache_size" : 100 ,
- "tdb.index_node2id" : "node2id" ,
- "tdb.index_id2node" : "nodes" ,
- "tdb.triple_index_primary" : "SPO" ,
- "tdb.triple_indexes" : [ "SPO" , "POS" , "OSP" ] ,
- "tdb.quad_index_primary" : "GSPO" ,
- "tdb.quad_indexes" : [ "GSPO" , "GPOS" , "GOSP" , "POSG" , "OSPG" , "SPOG" ] ,
- "tdb.prefix_index_primary" : "GPU" ,
- "tdb.prefix_indexes" : [ "GPU" ] ,
- "tdb.file_prefix_index" : "prefixIdx" ,
- "tdb.file_prefix_nodeid" : "prefix2id" ,
- "tdb.file_prefix_id2node" : "prefixes"
-}
-</pre>
-<h2 id="choosing-the-store-parameters">Choosing the store parameters</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.file_mode"</span> : <span style="color:#b44">"mapped"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.block_size"</span> : <span style="color:#666">8192</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.block_read_cache_size"</span> : <span style="color:#666">10000</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.block_write_cache_size"</span> : <span style="color:#666">2000</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.node2nodeid_cache_size"</span> : <span style="color:#666">100000</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.nodeid2node_cache_size"</span> : <span style="color:#666">500000</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.node_miss_cache_size"</span> : <span style="color:#666">100</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.index_node2id"</span> : <span style="color:#b44">"node2id"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.index_id2node"</span> : <span style="color:#b44">"nodes"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.triple_index_primary"</span> : <span style="color:#b44">"SPO"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.triple_indexes"</span> : [ <span style="color:#b44">"SPO"</span> , <span style="color:#b44">"POS"</span> , <span style="color:#b44">"OSP"</span> ] ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.quad_index_primary"</span> : <span style="color:#b44">"GSPO"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.quad_indexes"</span> : [ <span style="color:#b44">"GSPO"</span> , <span style="color:#b44">"GPOS"</span> , <span style="color:#b44">"GOSP"</span> , <span style="color:#b44">"POSG"</span> , <span style="color:#b44">"OSPG"</span> , <span style="color:#b44">"SPOG"</span> ] ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.prefix_index_primary"</span> : <span style="color:#b44">"GPU"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.prefix_indexes"</span> : [ <span style="color:#b44">"GPU"</span> ] ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.file_prefix_index"</span> : <span style="color:#b44">"prefixIdx"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.file_prefix_nodeid"</span> : <span style="color:#b44">"prefix2id"</span> ,
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">"tdb.file_prefix_id2node"</span> : <span style="color:#b44">"prefixes"</span>
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><h2 id="choosing-the-store-parameters">Choosing the store parameters</h2>
<p>This is the policy applied when creating or reattaching to a database.</p>
<p>If the database location has a parameter file, <code>tdb.cfg</code> then use that.
This is modified by any dynamic options supplied by the application. So to
diff --git a/content/documentation/tdb/tdb_transactions.html b/content/documentation/tdb/tdb_transactions.html
index f0fea1507..0ddc65d89 100644
--- a/content/documentation/tdb/tdb_transactions.html
+++ b/content/documentation/tdb/tdb_transactions.html
@@ -305,7 +305,7 @@ dataset.</p>
// A SPARQL query will see the new statement added.
try (QueryExecution qExec = QueryExecution.dataset(dataset)
- .query("SELECT (count(*) AS ?count) { ?s ?p ?o} LIMIT 10")
+ .query("SELECT (count(*) AS ?count) { ?s ?p ?o} LIMIT 10")
.build() ) {
ResultSet rs = qExec.execSelect() ;
ResultSetFormatter.out(rs) ;
diff --git a/content/documentation/tdb2/tdb2_admin.html b/content/documentation/tdb2/tdb2_admin.html
index cb9d20b4d..6315058ee 100644
--- a/content/documentation/tdb2/tdb2_admin.html
+++ b/content/documentation/tdb2/tdb2_admin.html
@@ -189,13 +189,12 @@
<article class="flex-column me-lg-4">
<h2 id="tdb2-directory-layout">TDB2 directory layout</h2>
<p>A TDB2 database is contained in a directory location <code>DIR</code> as:</p>
-<pre><code>DIR/
- Backups/
- Data-0001/
- Data-0002/
- tdb.lock
-</code></pre>
-<p>where <code>Data-NNNN</code> are the compacted generations of the database. The
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>DIR/
+</span></span><span style="display:flex;"><span> Backups/
+</span></span><span style="display:flex;"><span> Data-0001/
+</span></span><span style="display:flex;"><span> Data-0002/
+</span></span><span style="display:flex;"><span> tdb.lock
+</span></span></code></pre></div><p>where <code>Data-NNNN</code> are the compacted generations of the database. The
highest number is the currently live database. The others are not used
and not touched by the TDB2 subsystem. They can be deleted, moved
elsewhere, or compressed as required. Each is a valid database in it own
@@ -206,9 +205,8 @@ the same time by different JVM processes. (If you wish to share a database
between processes, or machines, consider using <a href="tdb2_fuseki.html">Fuseki2 with TDB2</a>.</p>
<h2 id="compaction">Compaction</h2>
<p>TDB2 databases grow over time as updates occur. They can be compacted by calling:</p>
-<pre><code>DatabaseMgr.compact(dataset.asDatasetGraph());
-</code></pre>
-<p>Compaction can be done on a live database. Read requests will continue to be
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>DatabaseMgr<span style="color:#666">.</span><span style="color:#b44">compact</span><span style="color:#666">(</span>dataset<span style="color:#666">.</span><span style="color:#b44">asDatasetGraph</span><span style="color:#666">());</span>
+</span></span></code></pre></div><p>Compaction can be done on a live database. Read requests will continue to be
serviced; write request are held up until compaction has finished. This
can be a long time for large databases.</p>
<p>Compaction creates a new <code>Data-NNNN</code> subdirectory and copied over the
@@ -221,9 +219,8 @@ option <code>--deleteOld</code> removes the last database after compaction.</p>
for live <a href="/documentation/fuseki2/fuseki-webapp.html">Fuseki webapps</a>.</p>
<h2 id="backup">Backup</h2>
<p>A TDB2 database can be backed up by calling:</p>
-<pre><code>DatabaseMgr.backup(dataset.asDatasetGraph());
-</code></pre>
-<p>which will create a dump file including a timestamp:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>DatabaseMgr<span style="color:#666">.</span><span style="color:#b44">backup</span><span style="color:#666">(</span>dataset<span style="color:#666">.</span><span style="color:#b44">asDatasetGraph</span><span style="color:#666">());</span>
+</span></span></code></pre></div><p>which will create a dump file including a timestamp:</p>
<pre>
<i>location</i>/Backups/backup-<i>yyyy-MM-dd_HH:mm:ss</i>.nq.gz
</pre>
diff --git a/content/documentation/tdb2/tdb2_fuseki.html b/content/documentation/tdb2/tdb2_fuseki.html
index 49b6fcdaf..c312fa2e1 100644
--- a/content/documentation/tdb2/tdb2_fuseki.html
+++ b/content/documentation/tdb2/tdb2_fuseki.html
@@ -187,72 +187,69 @@ embeddable <a href="../fuseki2/fuseki-embedded.html#fuseki-basic">Fuseki2 main s
either a complete server configuration (see below) or as an entry in the
<code>FUSEKI_BASE/configuration/</code> area of the full server.</p>
<p>The command line start-up for Fuseki (both full and basic versions) uses the
-the <code>--tdb2</code> flag to modify the <code>--loc</code> argument to work with a TDB2 dataset.</p>
+<code>--tdb2</code> flag to modify the <code>--loc</code> argument to work with a TDB2 dataset.</p>
<p>Example complete server configuration file for full or basic servers:
-The base URL will be of the form <code>http::/_host:port_/tdb2-database</code>.</p>
+The base URL will be of the form <code>http://_host:port_/tdb2-database</code>.</p>
<p>Note the <code>tdb2:</code> prefix.</p>
-<pre>
-PREFIX : <#>
-PREFIX fuseki: <http://jena.apache.org/fuseki#>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-<b>PREFIX tdb2: <http://jena.apache.org/2016/tdb#></b>
-PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
-
-[] 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:serviceReadWriteGraphStore "data" ;
- # A separate read-only graph store endpoint:
- fuseki:serviceReadGraphStore "get" ;
- fuseki:dataset <#tdb_dataset_readwrite> ;
- .
-
-<#tdb_dataset_readwrite> rdf:type <b>tdb2:DatasetTDB2</b> ;
- <b>tdb2:location</b> "TDB2" ;
- ## This is supported: tdb2:unionDefaultGraph true ;
- .
-</pre>
-<p>This example is available in <a href="https://github.com/apache/jena/blob/main/jena-fuseki2/examples/config-tdb2.ttl">config-tdb2.ttl</a></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-ttl" data-lang="ttl"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.apache.org/fuseki#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2000/01/rdf-schema#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#080;font-style:italic"># tdb2 in this line, below.</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.apache.org/2016/tdb#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/2005/11/Assembler#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">Server</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">services</span><span style="color:#bbb"> </span>(<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><#service_tdb2></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>)<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#service_tdb2></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">Service</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">label</span><span style="color:#bbb"> </span><span style="color:#b44">"TDB2 Service (RW)"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"tdb2-database"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceQuery</span><span style="color:#bbb"> </span><span style="color:#b44">"query"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceQuery</span><span style="color:#bbb"> </span><span style="color:#b44">"sparql"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceUpdate</span><span style="color:#bbb"> </span><span style="color:#b44">"update"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceReadWriteGraphStore</span><span style="color:#bbb"> </span><span style="color:#b44">"data"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># A separate read-only graph store endpoint:</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceReadGraphStore</span><span style="color:#bbb"> </span><span style="color:#b44">"get"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#tdb_dataset_readwrite></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#tdb_dataset_readwrite></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#008000;font-weight:bold">DatasetTDB2</span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#008000;font-weight:bold">location</span><span style="color:#b8860b"></b></span><span style="color:#bbb"> </span><span style="color:#b44">"TDB2"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## This is supported: tdb2:unionDefaultGraph true ;</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>This example is available in <a href="https://github.com/apache/jena/blob/main/jena-fuseki2/examples/config-tdb2.ttl">config-tdb2.ttl</a></p>
<p>The key difference is the declared <code>rdf:type</code> of the dataset.</p>
<p>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
editing will be routed to the TDB2 database.</p>
<p>For a service configuration in <code>FUSEKI_BASE/configuration/</code>:</p>
-<pre>
-PREFIX : <#>
-PREFIX fuseki: <http://jena.apache.org/fuseki#>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-PREFIX tdb2: <http://jena.apache.org/2016/tdb#>
-PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
-
-<#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:serviceReadWriteGraphStore "data" ;
- # A separate read-only graph store endpoint:
- fuseki:serviceReadGraphStore "get" ;
- fuseki:dataset <#tdb_dataset_readwrite> ;
- .
-
-<#tdb_dataset_readwrite> rdf:type <b>tdb2:DatasetTDB2</b> ;
- <b>tdb2:location</b> "TDB2" ;
- ## tdb2:unionDefaultGraph true ;
- .
-</pre>
-
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.apache.org/fuseki#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2000/01/rdf-schema#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.apache.org/2016/tdb#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">PREFIX</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">ja:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://jena.hpl.hp.com/2005/11/Assembler#></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#service_tdb2></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">Service</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdfs:</span><span style="color:#008000;font-weight:bold">label</span><span style="color:#bbb"> </span><span style="color:#b44">"TDB2 Service (RW)"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"tdb2-database"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceQuery</span><span style="color:#bbb"> </span><span style="color:#b44">"query"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceQuery</span><span style="color:#bbb"> </span><span style="color:#b44">"sparql"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceUpdate</span><span style="color:#bbb"> </span><span style="color:#b44">"update"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceReadWriteGraphStore</span><span style="color:#bbb"> </span><span style="color:#b44">"data"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic"># A separate read-only graph store endpoint:</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">serviceReadGraphStore</span><span style="color:#bbb"> </span><span style="color:#b44">"get"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">fuseki:</span><span style="color:#008000;font-weight:bold">dataset</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#tdb_dataset_readwrite></span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><#tdb_dataset_readwrite></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#008000;font-weight:bold">type</span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#008000;font-weight:bold">DatasetTDB2</span [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b8860b"><b></span><span style="color:#00f;font-weight:bold">tdb2:</span><span style="color:#008000;font-weight:bold">location</span><span style="color:#b8860b"></b></span><span style="color:#bbb"> </span><span style="color:#b44">"TDB2"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#080;font-style:italic">## tdb2:unionDefaultGraph true ;</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div>
</article>
<aside class="text-muted align-self-start mb-3 mb-xl-5 p-0 d-none d-xl-flex flex-column sticky-top">
diff --git a/content/documentation/txn/transactions_api.html b/content/documentation/txn/transactions_api.html
index 1c4b25fe9..e652f4399 100644
--- a/content/documentation/txn/transactions_api.html
+++ b/content/documentation/txn/transactions_api.html
@@ -210,84 +210,80 @@ but sometimes it is necessary to use the basic transaction API described here.</
<h3 id="read-transactions">Read transactions</h3>
<p>These are used for SPARQL queries and code using the Jena API
actions that do not change the data. The general pattern is:</p>
-<pre><code> dataset.begin(ReadWrite.READ) ;
- try {
- ...
- } finally { dataset.end() ; }
-</code></pre>
-<p>The <code>dataset.end()</code> declares the end of the read transaction. Applications may also call
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>The <code>dataset.end()</code> declares the end of the read transaction. Applications may also call
<code>dataset.commit()</code> or <code>dataset.abort()</code> which all have the same effect for a read transaction.</p>
<p>This example has two queries - no updates between or during the queries will be seen by
this code even if another thread commits changes in the lifetime of this transaction.</p>
-<pre><code> Dataset dataset = ... ;
- dataset.begin(ReadWrite.READ) ;
- try {
- String qs1 = "SELECT * {?s ?p ?o} LIMIT 10" ;
- try(QueryExecution qExec = QueryExecution.create(qs1, dataset)) {
- ResultSet rs = qExec.execSelect() ;
- ResultSetFormatter.out(rs) ;
- }
-
- String qs2 = "SELECT * {?s ?p ?o} OFFSET 10 LIMIT 10" ;
- try(QueryExecution qExec = QueryExecution.create(qs2, dataset)) {
- rs = qExec.execSelect() ;
- ResultSetFormatter.out(rs) ;
- }
- } finally { dataset.end() ; }
-</code></pre>
-<h3 id="write-transactions">Write transactions</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> String qs1 <span style="color:#666">=</span> <span style="color:#b44">"SELECT * {?s ?p ?o} LIMIT 10"</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>qs1<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ResultSet rs <span style="color:#666">=</span> qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">(</span>rs<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> String qs2 <span style="color:#666">=</span> <span style="color:#b44">"SELECT * {?s ?p ?o} OFFSET 10 LIMIT 10"</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>qs2<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> rs <span style="color:#666">=</span> qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">(</span>rs<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><h3 id="write-transactions">Write transactions</h3>
<p>These are used for SPARQL queries, SPARQL updates and any Jena API
actions that modify the data. Beware that large <code>model.read</code>
operations to change a dataset may consume large amounts of temporary space.</p>
<p>The general pattern is:</p>
-<pre><code> dataset.begin(ReadWrite.WRITE) ;
- try {
- ...
- dataset.commit() ;
- } finally {
- dataset.end() ;
- }
-</code></pre>
-<p>The <code>dataset.end()</code> will abort the transaction is there was no call to
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">WRITE</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>The <code>dataset.end()</code> will abort the transaction is there was no call to
<code>dataset.commit()</code> or <code>dataset.abort()</code> inside the write transaction.</p>
<p>Once <code>dataset.commit()</code> or <code>dataset.abort()</code> is called, the application
needs to start a new transaction to perform further operations on the
dataset.</p>
-<pre><code> Dataset dataset = ... ;
- dataset.begin(TxnType.WRITE) ;
-
- try {
- Model model = dataset.getDefaultModel() ;
- // API calls to a model in the dataset
-
- // Make some changes via the model ...
- model.add( ... )
-
- // A SPARQL query will see the new statement added.
- try (QueryExecution qExec = QueryExecution.create(
- "SELECT (count(?s) AS ?count) { ?s ?p ?o} LIMIT 10",
- dataset)) {
- ResultSet rs = qExec.execSelect() ;
- ResultSetFormatter.out(rs) ;
- }
-
- // ... perform a SPARQL Update
- String sparqlUpdateString = StrUtils.strjoinNL(
- "PREFIX . <http://example/>",
- "INSERT { :s :p ?now } WHERE { BIND(now() AS ?now) }"
- ) ;
-
- UpdateRequest request = UpdateFactory.create(sparqlUpdateString) ;
- UpdateExecution.dataset(dataset).update(request).execute();
-
- // Finally, commit the transaction.
- dataset.commit() ;
- // Or call .abort()
- } finally {
- dataset.end() ;
- }
-</code></pre>
-<h2 id="types-modes-promotion">Transaction Types, Modes and Promotion.</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>TxnType<span style="color:#666">.</span><span style="color:#b44">WRITE</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> Model model <span style="color:#666">=</span> dataset<span style="color:#666">.</span><span style="color:#b44">getDefaultModel</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// API calls to a model in the dataset
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Make some changes via the model ...
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> model<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span> <span style="color:#666">...</span> <span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// A SPARQL query will see the new statement added.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecution<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"SELECT (count(?s) AS ?count) { ?s ?p ?o} LIMIT 10"</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ResultSet rs <span style="color:#666">=</span> qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">(</span>rs<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// ... perform a SPARQL Update
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> String sparqlUpdateString <span style="color:#666">=</span> StrUtils<span style="color:#666">.</span><span style="color:#b44">strjoinNL</span><span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"PREFIX . <http://example/>"</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"INSERT { :s :p ?now } WHERE { BIND(now() AS ?now) }"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> UpdateRequest request <span style="color:#666">=</span> UpdateFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>sparqlUpdateString<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> UpdateExecution<span style="color:#666">.</span><span style="color:#b44">dataset</span><span style="color:#666">(</span>dataset<span style="color:#666">).</span><span style="color:#b44">update</span><span style="color:#666">(</span>request<span style="color:#666">).</span><span style="color:#b44">execute</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Finally, commit the transaction.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Or call .abort()
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><h2 id="types-modes-promotion">Transaction Types, Modes and Promotion.</h2>
<p>Transaction have a type (enum <code>TxnType</code>) and a mode (enum <code>ReadWrite</code>).
<code>TxnType.READ</code> and <code>TxnType.Write</code> start the transaction in
that mode and the mode is fixed for the transaction’s lifetime. A <code>READ</code>
@@ -312,39 +308,34 @@ A dataset object can be used by different threads, with independent transactions
<p>The usual idiom within multi-threaded applications is to have
one dataset, and so there is one transaction per thread.</p>
<p>Either:</p>
-<pre><code> // Create a dataset and keep it globally.
- static Dataset dataset = TDBFactory.createDataset(location) ;
-</code></pre>
-<p>Thread 1:</p>
-<pre><code> dataset.begin(TxnType.WRITE) ;
- try {
- ...
- dataset.commit() ;
- } finally { dataset.end() ; }
-</code></pre>
-<p>Thread 2:</p>
-<pre><code> dataset.begin(TxnType.READ) ;
- try {
- ...
- } finally { dataset.end() ; }
-</code></pre>
-<p>It is possible (in TDB) to create different dataset objects to the same location.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Create a dataset and keep it globally.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#a2f;font-weight:bold">static</span> Dataset dataset <span style="color:#666">=</span> TDBFactory<span style="color:#666">.</span><span style="color:#b44">createDataset</span><span style="color:#666">(</span>location<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>Thread 1:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>TxnType<span style="color:#666">.</span><span style="color:#b44">WRITE</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>Thread 2:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>TxnType<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>It is possible (in TDB) to create different dataset objects to the same location.</p>
<p>Thread 1:</p>
-<pre><code> Dataset dataset = TDBFactory.createDataset(location) ;
- dataset.begin(TxnType.WRITE) ;
- try {
- ...
- dataset.commit() ;
- } finally { dataset.end() ; }
-</code></pre>
-<p>Thread 2:</p>
-<pre><code> Dataset dataset = TDBFactory.createDataset(location) ;
- dataset.begin(TxnType.READ) ;
- try {
- ...
- } finally { dataset.end() ; }
-</code></pre>
-<p>Each thread has a separate <code>dataset</code> object; these safely share the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> TDBFactory<span style="color:#666">.</span><span style="color:#b44">createDataset</span><span style="color:#666">(</span>location<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>TxnType<span style="color:#666">.</span><span style="color:#b44">WRITE</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>Thread 2:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> TDBFactory<span style="color:#666">.</span><span style="color:#b44">createDataset</span><span style="color:#666">(</span>location<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>TxnType<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>Each thread has a separate <code>dataset</code> object; these safely share the
same storage and have independent transactions.</p>
<h2 id="multi-jvm">Multi JVM</h2>
<p>Multiple applications, running in multiple JVMs, using the same file
diff --git a/content/documentation/txn/txn.html b/content/documentation/txn/txn.html
index bd0d30914..fbeca7e50 100644
--- a/content/documentation/txn/txn.html
+++ b/content/documentation/txn/txn.html
@@ -203,115 +203,105 @@ to use transactions.</p>
<p>The <a href="basic_txn_api.html">basic transactions API</a> provides operations
<code>begin</code>, <code>commit</code>, <code>abort</code> and <code>end</code>.</p>
<p>A write transaction looks like:</p>
-<pre><code>dataset.begin(ReadWrite.write) ;
-try {
- ... write operations ...
- dataset.commit() ; // Or abort
-} finally {
- dataset.end() ;
-}
-</code></pre>
-<p>This can be simplified by wrapping application code, contained in a Java lambda
-expression or a Java Runnable object, and calling a method of the daatset or
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span> write operations <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#080;font-style:italic">// Or abort
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>This can be simplified by wrapping application code, contained in a Java lambda
+expression or a Java Runnable object, and calling a method of the dataset or
other transactional object. This wil apply the correct entry and exit code for
a transaction, eliminating coding errors.</p>
<p>This is also available via transactional objects such as <code>Dataset</code>.</p>
<p>The pattern is:</p>
-<pre><code>Dataset dataset = ...
-dataset.executeRead(()-> {
- . . .
-}) ;
-</code></pre>
-<p>and</p>
-<pre><code>dataset.executeWrite(()-> {
- . . .
-}) ;
-</code></pre>
-<p>The form is:</p>
-<pre><code>Txn.executeRead(ds, ()-> {
- . . .
-}) ;
-</code></pre>
-<p>and</p>
-<pre><code>Txn.executeWrite(ds, ()-> {
- . . .
-}) ;
-</code></pre>
-<p>is also avilable (<code>Txn</code> is the implementation of this machinary). Using Txn is
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span> <span style="color:#666">.</span> <span style="color:#666">.</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>and</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeWrite</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span> <span style="color:#666">.</span> <span style="color:#666">.</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>The form is:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Txn<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(</span>ds<span style="color:#666">,</span> <span style="color:#666">()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span> <span style="color:#666">.</span> <span style="color:#666">.</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>and</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Txn<span style="color:#666">.</span><span style="color:#b44">executeWrite</span><span style="color:#666">(</span>ds<span style="color:#666">,</span> <span style="color:#666">()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span> <span style="color:#666">.</span> <span style="color:#666">.</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>is also available (<code>Txn</code> is the implementation of this machinery). Using Txn is
this way is necessary for Jena3.</p>
<h2 id="usage">Usage</h2>
<p>This first example shows how to write a SPARQL query .</p>
-<pre><code>Dataset dataset = ... ;
-Query query = ... ;
-dataset.executeRead(()-> {
- try(QueryExecution qExec = QueryExecutionFactory.create(query, dataset)) {
- ResultSetFormatter.out(qExec.execSelect()) ;
- }
-}) ;
-</code></pre>
-<p>Here, a <code>try-with-resources</code> ensures correct handling of the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Query query <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecutionFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> ResultSetFormatter<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">(</span>qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">())</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>Here, a <code>try-with-resources</code> ensures correct handling of the
<code>QueryExecution</code> inside a read transaction.</p>
<p>Writing to a file is a read-action (it does not update the RDF data, the
writer needs to read the dataset or model):</p>
-<pre><code>Dataset dataset = ... ;
-dataset.executeRead(()-> {
- RDFDataMgr.write(System.out, dataset, Lang.TRIG) ;
-}) ;
-</code></pre>
-<p>whereas reading data into an RDF dataset needs to be a write transaction
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> dataset<span style="color:#666">,</span> Lang<span style="color:#666">.</span><span style="color:#b44">TRIG</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>whereas reading data into an RDF dataset needs to be a write transaction
(the dataset or model is changed).</p>
-<pre><code>Dataset dataset = ... ;
-dataset.executeWrite(()-> {
- RDFDataMgr.read("data.ttl") ;
-}) ;
-</code></pre>
-<p>Applications are not limited to a single operation inside a transaction. It
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeWrite</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span><span style="color:#b44">"data.ttl"</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>Applications are not limited to a single operation inside a transaction. It
can involve multiple applications read operations, such as making several
queries:</p>
-<pre><code>Dataset dataset = ... ;
-Query query1 = ... ;
-Query query2 = ... ;
-dataset.executeRead(()-> {
- try(QueryExecution qExec1 = QueryExecutionFactory.create(query1, dataset)) {
- ...
- }
- try(QueryExecution qExec2 = QueryExecutionFactory.create(query2, dataset)) {
- ...
- }
-}) ;
-</code></pre>
-<p>A <code>calculateRead</code> block can return a result but only with the condition
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Query query1 <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Query query2 <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>dataset<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec1 <span style="color:#666">=</span> QueryExecutionFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query1<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec2 <span style="color:#666">=</span> QueryExecutionFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query2<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span></code></pre></div><p>A <code>calculateRead</code> block can return a result but only with the condition
that what is returned does not touch the data again unless it uses a new
transaction.</p>
<p>This includes returning a result set or returning a model from a dataset.</p>
<p><code>ResultSets</code> by default stream - each time <code>hasNext</code> or <code>next</code> is
called, new data might be read from the RDF dataset. A copy of the
-results needs to be take:</p>
-<pre><code>Dataset dataset = ... ;
-Query query = ... ;
-List<String> results = dataset.calculateRead(()-> {
- List<String> accumulator = new ArrayList<>() ;
- try(QueryExecution qExec = QueryExecutionFactory.create(query, dataset)) {
- qExec.execSelect().forEachRemaining((row)->{
- String strThisRow = row.getLiteral("variable").getLexicalForm() ;
- accumulator.add(strThisRow) ;
- }) ;
- }
- return accumulator ;
-}) ;
-// use "results"
-
-Dataset dataset = ... ;
-Query query = ... ;
-ResultSet List<String> resultSet = dataset.calculateRead(()-> {
- List<String> accumulator = new ArrayList<>() ;
- try(QueryExecution qExec = QueryExecutionFactory.create(query, dataset)) {
- return ResultSetFactory.copyResults(qExec.execSelect()) ;
- }
-}) ;
-// use "resultSet"
-</code></pre>
-<p>The functions <code>execute</code> and <code>calculate</code> start <code>READ_PROMOTE</code>
+results needs to be taken:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Query query <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>List<span style="color:#666"><</span>String<span style="color:#666">></span> results <span style="color:#666">=</span> dataset<span style="color:#666">.</span><span style="color:#b44">calculateRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> List<span style="color:#666"><</span>String<span style="color:#666">></span> accumulator <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> ArrayList<span style="color:#666"><>()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecutionFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">().</span><span style="color:#b44">forEachRemaining</span><span style="color:#666">((</span>row<span style="color:#666">)->{</span>
+</span></span><span style="display:flex;"><span> String strThisRow <span style="color:#666">=</span> row<span style="color:#666">.</span><span style="color:#b44">getLiteral</span><span style="color:#666">(</span><span style="color:#b44">"variable"</span><span style="color:#666">).</span><span style="color:#b44">getLexicalForm</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> accumulator<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span>strThisRow<span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">return</span> accumulator <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// use "results"
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>
+</span></span><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Query query <span style="color:#666">=</span> <span style="color:#666">...</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>ResultSet List<span style="color:#666"><</span>String<span style="color:#666">></span> resultSet <span style="color:#666">=</span> dataset<span style="color:#666">.</span><span style="color:#b44">calculateRead</span><span style="color:#666">(()-></span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> List<span style="color:#666"><</span>String<span style="color:#666">></span> accumulator <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> ArrayList<span style="color:#666"><>()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span><span style="color:#666">(</span>QueryExecution qExec <span style="color:#666">=</span> QueryExecutionFactory<span style="color:#666">.</span><span style="color:#b44">create</span><span style="color:#666">(</span>query<span style="color:#666">,</span> dataset<span style="color:#666">))</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">return</span> ResultSetFactory<span style="color:#666">.</span><span style="color:#b44">copyResults</span><span style="color:#666">(</span>qExec<span style="color:#666">.</span><span style="color:#b44">execSelect</span><span style="color:#666">())</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">})</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// use "resultSet"
+</span></span></span></code></pre></div><p>The functions <code>execute</code> and <code>calculate</code> start <code>READ_PROMOTE</code>
transactions which start in “read” mode but convert to “write” mode if
needed. For details of transaction promotion see the
<a href="transactions_api.html#types-modes-promotion">section in the transaction API documentation</a>.</p>
@@ -324,43 +314,40 @@ dataset.</p>
<code>execute...</code> or <code>calculate...</code> will be performed as part of
the transaction and that transaction is not terminated. If there is not transaction already started,
a transaction is wrapped around the <code>execute...</code> or <code>calculate...</code> action.</p>
-<pre><code>Dataset dataset = ...
-// Main transaction.
-dataset.begin(ReadWrite.WRITE) ;
-try {
- ...
- // Part of the transaction above.
- dataset.executeRead(() -> ...) ;
- ...
- // Part of the transaction above - no commit/abort
- dataset.executeWrite(() -> ...) ;
-
- // Outer transaction
- dataset.commit() ;
-} finally { dataset.end() ; }
-</code></pre>
-<h2 id="design">Design</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Dataset dataset <span style="color:#666">=</span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// Main transaction.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>dataset<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">WRITE</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Part of the transaction above.
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> dataset<span style="color:#666">.</span><span style="color:#b44">executeRead</span><span style="color:#666">(()</span> <span style="color:#666">-></span> <span style="color:#666">...)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Part of the transaction above - no commit/abort
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> dataset<span style="color:#666">.</span><span style="color:#b44">executeWrite</span><span style="color:#666">(()</span> <span style="color:#666">-></span> <span style="color:#666">...)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// Outer transaction
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> dataset<span style="color:#666">.</span><span style="color:#b44">commit</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> dataset<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><h2 id="design">Design</h2>
<p><code>Txn</code> uses Java <code>Runnable</code> for the application code, passed into control code
that wraps the transaction operations around the application code. This results
in application code automatically applied transaction begin/commit/end as needed.</p>
<p>A bare read transaction requires the following code structure (no exception handling):</p>
-<pre><code> txn.begin(ReadWrite.READ) ;
- try {
- ... application code ...
- } finally { txn.end() ; }
-</code></pre>
-<p>while a write transaction requires either a <code>commit</code> or an <code>abort</code>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>txn<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span> application code <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">finally</span> <span style="color:#666">{</span> txn<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span></code></pre></div><p>while a write transaction requires either a <code>commit</code> or an <code>abort</code>
at the end of the application code as well.</p>
<p>Without the transaction continuation code (simplified, the <code>Txn</code> code
for a read transaction takes the form:</p>
-<pre><code>public static <T extends Transactional> void executeRead(T txn, Runnable r) {
- txn.begin(ReadWrite.READ) ;
- try { r.run() ; }
- catch (Throwable th) { txn.end() ; throw th ; }
- txn.end() ;
-}
-</code></pre>
-<p>See <a href="https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/query/Txn.java"><code>Txn.java</code></a> for full details.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">public</span> <span style="color:#a2f;font-weight:bold">static</span> <span style="color:#666"><</span>T <span style="color:#a2f;font-weight:bold">extends</span> Transactional<span style="color:#666">></span> <span style="color:#0b0;font-weight:bold [...]
+</span></span><span style="display:flex;"><span> txn<span style="color:#666">.</span><span style="color:#b44">begin</span><span style="color:#666">(</span>ReadWrite<span style="color:#666">.</span><span style="color:#b44">READ</span><span style="color:#666">)</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span> r<span style="color:#666">.</span><span style="color:#b44">run</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>Throwable th<span style="color:#666">)</span> <span style="color:#666">{</span> txn<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span> <span style="color:#a2f;font-weight:bold">throw</span> th <span style="color:#666">;</span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> txn<span style="color:#666">.</span><span style="color:#b44">end</span><span style="color:#666">()</span> <span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>See <a href="https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/query/Txn.java"><code>Txn.java</code></a> for full details.</p>
</article>
diff --git a/content/download/index.html b/content/download/index.html
index bc3d9f1dd..1ea5df51e 100644
--- a/content/download/index.html
+++ b/content/download/index.html
@@ -284,7 +284,7 @@ The binary distribution of Fuseki as a WAR file:
<p>This can be run in any servlet application container supporting Jakarta Servlet 6.0
(part of Jakarta EE version 9), such as <a href="https://tomcat.apache.org/index.html">Apache Tomcat</a>
10.x or later.
-The server must be running running on the required version of Java.</p>
+The server must be running on the required version of Java.</p>
<h3 id="apache-jena-download-area">Apache Jena Download area</h3>
<p>The source release and also the binaries are available from the
<a href="https://downloads.apache.org/jena/">Apache Jena Download area</a>.</p>
@@ -293,17 +293,16 @@ The server must be running running on the required version of Java.</p>
<p>Individual modules may be obtained using a dependency manager which can talk to Maven repositories, some modules are only available via Maven.</p>
<h4 id="maven">Maven</h4>
<p>See “<a href="maven.html">Using Jena with Apache Maven</a>” for full details.</p>
-<pre><code><dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>apache-jena-libs</artifactId>
- <type>pom</type>
- <version>X.Y.Z</version>
-</dependency>
-</code></pre>
-<h4 id="source-code">Source code</h4>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>apache-jena-libs<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><type></span>pom<span style="color:#008000;font-weight:bold"></type></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>X.Y.Z<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><h4 id="source-code">Source code</h4>
<p>The development codebase is available from git.</p>
<p><a href="https://gitbox.apache.org/repos/asf?p=jena.git">https://gitbox.apache.org/repos/asf?p=jena.git</a></p>
-<p>This is also available on github:</p>
+<p>This is also available on GitHub:</p>
<p><a href="https://github.com/apache/jena">https://github.com/apache/jena</a></p>
<h4 id="previous-releases">Previous releases</h4>
<p>While previous releases are available, we strongly recommend that wherever
diff --git a/content/download/maven.html b/content/download/maven.html
index 7a977bf7c..7683593f1 100644
--- a/content/download/maven.html
+++ b/content/download/maven.html
@@ -201,24 +201,22 @@ repositories to your <code>pom.xml</code> or <code>settings.xml</code>.</p>
<h3 id="specifying-jena-as-a-dependency">Specifying Jena as a dependency</h3>
<p>This is how to specify in your pom.xml file the dependency
on a version of Jena:</p>
-<pre><code> <dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>apache-jena-libs</artifactId>
- <type>pom</type>
- <version>X.Y.Z</version>
- </dependency>
-</code></pre>
-<p>This will transitively resolve all the dependencies for you: <code>jena-core</code>,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>apache-jena-libs<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><type></span>pom<span style="color:#008000;font-weight:bold"></type></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>X.Y.Z<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><p>This will transitively resolve all the dependencies for you: <code>jena-core</code>,
<code>jena-arq</code>, <code>jena-tdb</code> and <code>jena-iri</code> and their dependencies.</p>
<p>Note the use of <code><type>pom</type></code> above.</p>
<p>Other modules need to be added separately, for example:</p>
-<pre><code> <dependency>
- <groupId>org.apache.jena</groupId>
- <artifactId>jena-text</artifactId>
- <version>x.y.z</version>
- </dependency>
-</code></pre>
-<p>Please check for the latest versions.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><dependency></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><groupId></span>org.apache.jena<span style="color:#008000;font-weight:bold"></groupId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><artifactId></span>jena-text<span style="color:#008000;font-weight:bold"></artifactId></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><version></span>x.y.z<span style="color:#008000;font-weight:bold"></version></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></dependency></span>
+</span></span></code></pre></div><p>Please check for the latest versions.</p>
<h3 id="major-artifacts">Major Artifacts</h3>
<p>Jena provides a number of maven artifacts as delivery points.<br>
There are also a number of maven artifacts used as part of
@@ -301,27 +299,25 @@ tree.</p>
<p>If you want to depend on Jena development snapshots and help with Jena
development, e.g. to get access to recent bug fixes for testing, you
should add the following to your <code>pom.xml</code>:</p>
-<pre><code> <repository>
- <id>apache-repo-snapshots</id>
- <url>https://repository.apache.org/content/repositories/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
-</code></pre>
-<h3 id="build-and-install-artifacts-in-your-local-maven-repository">Build and install artifacts in your local Maven repository</h3>
-<p>If you want you can checkout the Jena sources, build the artifacts and
-install them in your local Maven repository, then you simply checkout the source
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><repository></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><id></span>apache-repo-snapshots<span style="color:#008000;font-weight:bold"></id></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><url></span>https://repository.apache.org/content/repositories/snapshots/<span style="color:#008000;font-weight:bold"></url></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><releases></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><enabled></span>false<span style="color:#008000;font-weight:bold"></enabled></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></releases></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><snapshots></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><enabled></span>true<span style="color:#008000;font-weight:bold"></enabled></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></snapshots></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></repository></span>
+</span></span></code></pre></div><h3 id="build-and-install-artifacts-in-your-local-maven-repository">Build and install artifacts in your local Maven repository</h3>
+<p>If you want you can check out the Jena sources, build the artifacts and
+install them in your local Maven repository, then you simply check out the source
tree and build with maven
<code>mvn install</code>. This assumes you have Maven and Git installed:</p>
-<pre><code>git clone https://github.com/apache/jena/
-cd jena
-mvn clean install
-</code></pre>
-<p>Each of the modules can be built on its own but they
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ git clone https://github.com/apache/jena/
+</span></span><span style="display:flex;"><span>$ <span style="color:#a2f">cd</span> jena
+</span></span><span style="display:flex;"><span>$ mvn clean install
+</span></span></code></pre></div><p>Each of the modules can be built on its own, but they
require the current snapshots and Jena parent POM to be installed.</p>
</article>
diff --git a/content/index.json b/content/index.json
index c825ad946..a2c4ac904 100644
--- a/content/index.json
+++ b/content/index.json
@@ -1 +1 @@
-[{"categories":null,"contents":"This page is historical \u0026ldquo;for information only\u0026rdquo; - there is no Apache release of Eyeball and the code has not been updated for Jena3.\nThe original source code is available. So you\u0026rsquo;ve got Eyeball installed and you\u0026rsquo;ve run it on one of your files, and Eyeball doesn\u0026rsquo;t like it. You\u0026rsquo;re not sure why, or what to do about it. Here\u0026rsquo;s what\u0026rsquo;s going on.\nEyeball inspects your model a [...]
\ No newline at end of file
+[{"categories":null,"contents":"This page is historical \u0026ldquo;for information only\u0026rdquo; - there is no Apache release of Eyeball and the code has not been updated for Jena3.\nThe original source code is available. So you\u0026rsquo;ve got Eyeball installed and you\u0026rsquo;ve run it on one of your files, and Eyeball doesn\u0026rsquo;t like it. You\u0026rsquo;re not sure why, or what to do about it. Here\u0026rsquo;s what\u0026rsquo;s going on.\nEyeball inspects your model a [...]
\ No newline at end of file
diff --git a/content/index.xml b/content/index.xml
index 540021cc3..55460f71b 100644
--- a/content/index.xml
+++ b/content/index.xml
@@ -290,7 +290,7 @@ SERVICE is a feature of SPARQL 1.1 that allows an executing query to make a SPAR
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/programmatic.html</guid>
- <description>It is possible to build queries by building and abstract syntax tree (as the parser does) or by building the algebra expression for the query. It is usually better to work with the algebra form as it is more regular.
+ <description>It is possible to build queries by building and abstract syntax tree (as the parser does) or by building the algebra expression for the query. It is usually better to work with the algebra form as it is more regular.
See the examples such as arq.examples.algrebra.AlgebraExec at jena-examples:arq/examples
See also ARQ - SPARQL Algebra
ARQ documentation index</description>
@@ -430,8 +430,8 @@ A regular join only executes the RHS once, and the variables from the LHS are us
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/logging.html</guid>
- <description>ARQ uses SLF4j as the logging API and the query and RIOT commands use Log4J2 as a deployment system. You can use Java 1.4 logging instead.
-ARQ does not output any logging messages at level INFO in normal operation. The code uses level TRACE and DEBUG. Running with logging set to an application at INFO will cause no output in normal operation. Output below INFO can be very verbose and is intended mainly to help debug ARQ.</description>
+ <description>ARQ uses SLF4j as the logging API and the query and RIOT commands use Log4J2 as a deployment system. You can use Java 1.4 logging instead.
+ARQ does not output any logging messages at level INFO in normal operation. The code uses level TRACE and DEBUG. Running with logging set to an application at INFO will cause no output in normal operation. Output below INFO can be very verbose and is intended mainly to help debug ARQ.</description>
</item>
<item>
@@ -463,7 +463,8 @@ From your application The QueryExecutionHTTP has methods for creating a QueryExe
<guid>https://jena.apache.org/documentation/query/rdf_lists.html</guid>
<description>RDF collections, also called RDF lists, are difficult to query directly.
-ARQ provides a 3 property functions to work with RDF collections. list:member &ndash; members of a list list:index &ndash; index of a member in a list list:length &ndash; length of a list list:member is similar to rdfs:member except for RDF lists. ARQ also provides rdfs:member.
+ARQ provides a 3 property functions to work with RDF collections.
+list:member &ndash; members of a list list:index &ndash; index of a member in a list list:length &ndash; length of a list list:member is similar to rdfs:member except for RDF lists. ARQ also provides rdfs:member.
See the property functions library page.
ARQ documentation index</description>
</item>
@@ -574,7 +575,7 @@ ARQ documentation index</description>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/property_paths.html</guid>
- <description>ARQ - Property Paths A property path is a possible route through a graph between two graph nodes. A trivial case is a property path of length exactly one, which is a triple pattern.
+ <description>ARQ - Property Paths A property path is a possible route through a graph between two graph nodes. A trivial case is a property path of length exactly one, which is a triple pattern.
Most property paths are now legal SPARQL 1.1 syntax, there are some advanced property paths which are syntactic extensions and are only available if the query is parsed with language Syntax.syntaxARQ.
Path Language A property path expression (or just &lsquo;path&rsquo;) is similar to a string regular expression but over properties, not characters.</description>
</item>
@@ -770,7 +771,7 @@ The original source code is available. Documentation index The brief guide. The
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/query/library-function.html</guid>
- <description>The regular expressions for fan:localname and afn:namespace were incorrect. SPARQL allows custom functions in expressions so that queries can be used on domain-specific data. SPARQL defines a function by URI (or prefixed name) in FILTER expressions. ARQ provides a function library and supports application-provided functions. Functions and property functions can be registered or dynamically loaded.
+ <description>The regular expressions for fan:localname and afn:namespace were incorrect. SPARQL allows custom functions in expressions so that queries can be used on domain-specific data. SPARQL defines a function by URI (or prefixed name) in FILTER expressions. ARQ provides a function library and supports application-provided functions. Functions and property functions can be registered or dynamically loaded.
Applications can also provide their own functions.
ARQ also provides an implementation the Leviathan Function Library.</description>
</item>
@@ -948,7 +949,7 @@ RDF 1.1 Turtle RDF 1.1 Trig RDF 1.1 N-Triples RDF 1.1 N-Quads JSON-LD </descript
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/geosparql/geosparql-assembler.html</guid>
- <description>Details of the GeoSPARQL support are proivded on the GeoSPARQL page.
+ <description>Details of the GeoSPARQL support are provided on the GeoSPARQL page.
The assembler for GeoSPARQL support is part of the jena-geosparql artifact and must be on the Fuseki server classpath, along with its dependencies.
&lt;dependency&gt; &lt;groupId&gt;org.apache.jena&lt;/groupId&gt; &lt;artifactId&gt;jena-geosparql&lt;/artifactId&gt; &lt;version&gt;...&lt;/version&gt; &lt;/dependency&gt; or download the binary from the Maven central repository org/apache/jena/jena-geosparql
The GeoSPARQL assembler can be used in a Fuseki configuration file.
@@ -1209,7 +1210,7 @@ NOTE The permissions system caches intermediate results and will only call the e
<guid>https://jena.apache.org/documentation/extras/querybuilder/</guid>
<description>Overview Query Builder provides implementations of Ask, Construct, Select and Update builders that allow developers to create queries without resorting to StringBuilders or similar solutions. The Query Builder module is an extra package and is found in the jena-querybuilder jar.
Each of the builders has a series of methods to define the query. Each method returns the builder for easy chaining. The example:
-SelectBuilder sb = new SelectBuilder() .addVar( &quot;*&quot; ) .</description>
+SelectBuilder sb = new SelectBuilder() .addVar( &#34;*&#34; ) .</description>
</item>
<item>
@@ -1408,7 +1409,7 @@ Generating query/update strings in code without lots of error prone and messy st
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/documentation/notes/rdf-frames.html</guid>
- <description>The origins of RDF as a representation language include frame languages, in which an object, or frame, was the main unit of structuring data. Frames have slots, for example a Person frame might have an age slot, a heightslot etc. RDF, however, has taken a step beyond frame languages by making rdf:Property a first class value, not an element of a frame or resource per se. In RDF, for example, an age property can be defined: &lt;rdf:Property rdf:ID=&quot;age& [...]
+ <description>The origins of RDF as a representation language include frame languages, in which an object, or frame, was the main unit of structuring data. Frames have slots, for example a Person frame might have an age slot, a heightslot etc. RDF, however, has taken a step beyond frame languages by making rdf:Property a first class value, not an element of a frame or resource per se. In RDF, for example, an age property can be defined: &lt;rdf:Property rdf:ID=&quot;age& [...]
</item>
<item>
@@ -1878,7 +1879,7 @@ If you are looking for a short introduction to SPARQL and Jena try Search RDF da
<guid>https://jena.apache.org/tutorials/sparql_query1.html</guid>
<description>In this section, we look at a simple first query and show how to execute it with Jena.
A &ldquo;hello world&rdquo; of queries The file &ldquo;q1.rq&rdquo; contains the following query:
-SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &quot;John Smith&quot; } executing that query with the command line query application;
+SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &#34;John Smith&#34; } executing that query with the command line query application;
--------------------------------- | x | ================================= | &lt;http://somewhere/JohnSmith/&gt; | --------------------------------- This works by matching the triple pattern in the WHERE clause against the triples in the RDF graph.</description>
</item>
@@ -1889,7 +1890,7 @@ SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &am
<guid>https://jena.apache.org/tutorials/sparql_union.html</guid>
<description>Another way of dealing with the semi-structured data is to query for one of a number of possibilities. This section covers UNION patterns, where one of a number of possibilities is tried.
-UNION - two ways to the same data Both the vCard vocabulary and the FOAF vocabulary have properties for people&rsquo;s names. In vCard, it is vCard:FN, the &ldquo;formatted name&rdquo;, and in FOAF, it is foaf:name. In this section, we will look at a small set of data where the names of people can be given by either the FOAF or the vCard vocabulary.</description>
+UNION - two ways to the same data Both the vCard vocabulary and the FOAF vocabulary have properties for people&rsquo;s names. In vCard, it is vCard:FN, the &ldquo;formatted name&rdquo;, and in FOAF, it is foaf:name. In this section, we will look at a small set of data where the names of people can be given by either the FOAF or the vCard vocabulary.</description>
</item>
<item>
@@ -1919,7 +1920,7 @@ It is important to realize that it is the triples that matter, not the serializa
<guid>https://jena.apache.org/tutorials/sparql_datasets.html</guid>
<description>This section covers RDF Datasets - an RDF Dataset is the unit that is queried by a SPARQL query. It consists of a default graph, and a number of named graphs.
-Querying datasets The graph matching operation (basic patterns, OPTIONALs, and UNIONs) work on one RDF graph. This starts out being the default graph of the dataset but it can be changed by the GRAPH keyword.
+Querying datasets The graph matching operation (basic patterns, OPTIONALs, and UNIONs) work on one RDF graph. This starts out being the default graph of the dataset but it can be changed by the GRAPH keyword.
GRAPH uri { ... pattern .</description>
</item>
@@ -1929,7 +1930,7 @@ GRAPH uri { ... pattern .</description>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/tutorials/sparql_datasets_pt.html</guid>
- <description>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por um consulta SPARQL. Ele consiste de um grafo padrão, e certo número de grafos nomeados.
+ <description>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por uma consulta SPARQL. Ele consiste de um grafo padrão, e certo número de grafos nomeados.
Consultando datasets As operações de casamento de grafos (padrões básicos, OPTIONALs, e UNIONs) funcionam em um grafo RDF. Isso começa por ser o grafo padrão do conjunto de dados, mas pode ser alterado pela palavra-chave GRAPH. GRAPH uri { &hellip; padrão &hellip; }</description>
</item>
@@ -1940,7 +1941,7 @@ Consultando datasets As operações de casamento de grafos (padrões básicos, O
<guid>https://jena.apache.org/tutorials/sparql_filters.html</guid>
<description>Graph matching allows patterns in the graph to be found. This section describes how the values in a solution can be restricted. There are many comparisons available - we just cover two cases here.
-String Matching SPARQL provides an operation to test strings, based on regular expressions. This includes the ability to ask SQL &ldquo;LIKE&rdquo; style tests, although the syntax of the regular expression is different from SQL.
+String Matching SPARQL provides an operation to test strings, based on regular expressions. This includes the ability to ask SQL &ldquo;LIKE&rdquo; style tests, although the syntax of the regular expression is different from SQL.
The syntax is:</description>
</item>
@@ -2278,7 +2279,7 @@ import org.apache.jena.tdb2.TDB2Factory; ... public static void main(String[] ar
<guid>https://jena.apache.org/documentation/tdb2/tdb2_fuseki.html</guid>
<description>TDB2 is incorporated into Fuseki2, both in the full server, with UI, and embeddable Fuseki2 main server.
The TDB2 database can be in a configuration file, either a complete server configuration (see below) or as an entry in the FUSEKI_BASE/configuration/ area of the full server.
-The command line start-up for Fuseki (both full and basic versions) uses the the --tdb2 flag to modify the --loc argument to work with a TDB2 dataset.</description>
+The command line start-up for Fuseki (both full and basic versions) uses the --tdb2 flag to modify the --loc argument to work with a TDB2 dataset.</description>
</item>
<item>
@@ -2381,7 +2382,7 @@ SPARQL é uma linguagem de consulta e um protocolo para acesso a RDF elaborado p
<guid>https://jena.apache.org/tutorials/sparql_query1_pt.html</guid>
<description>Nesta sessão, vamos olhar para a primeira consulta simples e mostrar como executá-la em Jena.
O &ldquo;hello world&rdquo; de consultas O arquivo &ldquo;q1.rq&rdquo; contem a seguinte consulta:
-SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &quot;John Smith&quot; } executando esta consulta com a aplicação de consultas em linhas de comando:
+SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &#34;John Smith&#34; } executando esta consulta com a aplicação de consultas em linhas de comando:
--------------------------------- | x | ================================= | &lt;http://somewhere/JohnSmith/&gt; | --------------------------------- Isso funciona casando o padrão da tripla na clausula WHERE contra as triplas no grafo RDF.</description>
</item>
@@ -2520,7 +2521,7 @@ an API for reading, processing and writing RDF data in XML, N-triples and Turtle
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/about_jena/about.html</guid>
- <description>Jena is a Java framework for building Semantic Web applications. It provides a extensive Java libraries for helping developers develop code that handles RDF, RDFS, RDFa, OWL and SPARQL in line with published W3C recommendations. Jena includes a rule-based inference engine to perform reasoning based on OWL and RDFS ontologies, and a variety of storage strategies to store RDF triples in memory or on disk.
+ <description>Jena is a Java framework for building Semantic Web applications. It provides an extensive Java libraries for helping developers develop code that handles RDF, RDFS, RDFa, OWL and SPARQL in line with published W3C recommendations. Jena includes a rule-based inference engine to perform reasoning based on OWL and RDFS ontologies, and a variety of storage strategies to store RDF triples in memory or on disk.
History Jena was originally developed by researchers in HP Labs, starting in Bristol, UK, in 2000.</description>
</item>
diff --git a/content/sitemap.xml b/content/sitemap.xml
index 9a30190b9..25311fd48 100644
--- a/content/sitemap.xml
+++ b/content/sitemap.xml
@@ -6,16 +6,16 @@
<lastmod>2020-06-28T16:59:07+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/about_jena.html</loc>
- <lastmod>2024-03-01T21:57:18+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/permissions/example.html</loc>
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_union_pt.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/rdf_api.html</loc>
- <lastmod>2024-01-17T23:23:50+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/</loc>
<lastmod>2021-07-21T19:48:13+01:00</lastmod>
@@ -42,7 +42,7 @@
<lastmod>2022-11-16T00:31:00+03:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/geosparql/</loc>
- <lastmod>2023-04-05T21:33:27+02:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/notes/system-initialization.html</loc>
<lastmod>2023-01-07T15:49:38+00:00</lastmod>
@@ -51,7 +51,7 @@
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/download/</loc>
- <lastmod>2024-03-17T09:47:35+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/</loc>
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
@@ -69,19 +69,19 @@
<lastmod>2023-04-10T12:49:33+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/group-by.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/app_api.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/assignment.html</loc>
- <lastmod>2021-06-22T11:19:55+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/service.html</loc>
<lastmod>2023-04-10T12:49:33+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/programmatic.html</loc>
- <lastmod>2021-11-15T19:40:46+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/collation.html</loc>
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
@@ -99,7 +99,7 @@
<lastmod>2022-05-31T09:58:44+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/arq-query-eval.html</loc>
- <lastmod>2021-11-15T19:40:46+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/function_forms.html</loc>
<lastmod>2023-02-26T22:14:57+01:00</lastmod>
@@ -120,7 +120,7 @@
<lastmod>2023-02-26T22:14:57+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/logging.html</loc>
- <lastmod>2022-09-18T09:08:25+02:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/negation.html</loc>
<lastmod>2020-05-01T11:11:56+12:00</lastmod>
@@ -129,13 +129,13 @@
<lastmod>2022-08-25T11:17:26+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/rdf_lists.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/select_expr.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/algebra.html</loc>
- <lastmod>2021-11-15T19:40:46+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/update.html</loc>
<lastmod>2021-11-15T19:40:46+00:00</lastmod>
@@ -147,7 +147,7 @@
<lastmod>2023-02-26T22:14:57+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/writing_functions.html</loc>
- <lastmod>2020-05-01T11:11:56+12:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/writing_propfuncs.html</loc>
<lastmod>2023-10-30T12:01:30+00:00</lastmod>
@@ -159,7 +159,7 @@
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/property_paths.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/about_jena/citing.html</loc>
<lastmod>2021-12-13T18:16:57+13:00</lastmod>
@@ -195,25 +195,25 @@
<lastmod>2021-11-05T11:40:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/fuseki2/fuseki-data-access-control.html</loc>
- <lastmod>2023-08-15T14:34:21+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/rdfs/</loc>
<lastmod>2023-04-09T15:11:22+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation.html</loc>
- <lastmod>2024-03-25T13:26:54+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/download.html</loc>
- <lastmod>2024-03-17T09:47:35+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/notes/event-handler-howto.html</loc>
<lastmod>2023-06-06T21:08:29+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/explain.html</loc>
- <lastmod>2023-02-26T22:14:57+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/extension.html</loc>
- <lastmod>2021-02-16T16:52:52+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/eyeball/eyeball-getting-started.html</loc>
<lastmod>2020-06-28T16:59:07+01:00</lastmod>
@@ -222,7 +222,7 @@
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/library-function.html</loc>
- <lastmod>2024-03-20T19:36:24-04:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/fuseki2/fuseki-docker.html</loc>
<lastmod>2021-11-27T15:03:59+00:00</lastmod>
@@ -261,7 +261,7 @@
<lastmod>2020-09-19T11:47:36+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/serving_data/fuseki1.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/fuseki2/rdf-sparql-standards.html</loc>
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
@@ -270,10 +270,10 @@
<lastmod>2023-08-15T14:34:21+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/geosparql/geosparql-assembler.html</loc>
- <lastmod>2022-02-06T18:03:15+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/geosparql/geosparql-fuseki.html</loc>
- <lastmod>2021-12-27T19:32:13+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/help_and_support/</loc>
<lastmod>2023-11-23T00:10:28+01:00</lastmod>
@@ -306,16 +306,16 @@
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/assembler/inside-assemblers.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/about_jena/architecture.html</loc>
- <lastmod>2022-01-21T20:55:23+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/assembler/assembler-howto.html</loc>
- <lastmod>2020-06-28T16:59:39+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/assembler/</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/extras/</loc>
<lastmod>2022-08-20T12:20:18+01:00</lastmod>
@@ -324,7 +324,7 @@
<lastmod>2024-03-01T21:57:18+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/text-query.html</loc>
- <lastmod>2024-03-17T17:45:17+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/javadoc.html</loc>
<lastmod>2024-03-17T09:46:12+00:00</lastmod>
@@ -336,7 +336,7 @@
<lastmod>2023-10-30T12:01:30+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/ontology/</loc>
- <lastmod>2023-10-30T12:01:30+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/permissions/</loc>
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
@@ -354,19 +354,19 @@
<lastmod>2021-05-20T19:16:57+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/extras/querybuilder/</loc>
- <lastmod>2023-11-20T10:31:26+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdfxml-io.html</loc>
<lastmod>2024-03-17T17:44:27+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdfxml_howto.html</loc>
- <lastmod>2024-03-17T17:44:27+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdfxml-input.html</loc>
- <lastmod>2024-03-17T17:44:27+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdfxml-output.html</loc>
- <lastmod>2024-03-17T17:44:27+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/about_jena/roadmap.html</loc>
<lastmod>2024-03-01T21:57:18+00:00</lastmod>
@@ -381,7 +381,7 @@
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/txn/transactions_api.html</loc>
- <lastmod>2021-11-05T16:04:36+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/</loc>
<lastmod>2022-12-21T14:55:40+01:00</lastmod>
@@ -408,16 +408,16 @@
<lastmod>2023-10-30T12:01:30+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/notes/rdf-frames.html</loc>
- <lastmod>2023-10-30T12:01:30+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_results.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_results_pt.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/library-propfunc.html</loc>
- <lastmod>2021-02-16T16:52:52+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdf-binary.html</loc>
<lastmod>2024-01-18T09:09:14+01:00</lastmod>
@@ -435,13 +435,13 @@
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/json-ld-11.html</loc>
- <lastmod>2023-10-30T12:01:30+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/rdf-input.html</loc>
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/inference/</loc>
- <lastmod>2023-10-30T12:01:30+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/notes/reification.html</loc>
<lastmod>2023-08-15T14:34:21+01:00</lastmod>
@@ -468,7 +468,7 @@
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/configuration.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/database_layouts.html</loc>
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
@@ -480,7 +480,7 @@
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/dataset_description.html</loc>
- <lastmod>2022-11-09T14:16:56+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/faq.html</loc>
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
@@ -492,10 +492,10 @@
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/javaapi.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/loading_data.html</loc>
- <lastmod>2022-11-09T14:16:56+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/loading_performance.html</loc>
<lastmod>2022-11-09T14:16:56+00:00</lastmod>
@@ -504,13 +504,13 @@
<lastmod>2023-02-05T18:59:30+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/quickstart.html</loc>
- <lastmod>2022-11-09T14:16:56+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/store_description.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/archive/sdb/commands.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/search/</loc>
<lastmod>2023-02-12T15:23:22+01:00</lastmod>
@@ -537,31 +537,31 @@
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_query1.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_union.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_basic_patterns.html</loc>
- <lastmod>2021-01-11T00:19:16-08:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_data.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_datasets.html</loc>
- <lastmod>2020-06-28T16:59:39+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_datasets_pt.html</loc>
- <lastmod>2020-06-28T16:59:39+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_filters.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_optionals.html</loc>
- <lastmod>2021-05-17T03:19:54+08:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/spatial-query-doc.html</loc>
<lastmod>2023-02-05T18:59:30+01:00</lastmod>
@@ -579,40 +579,40 @@
<lastmod>2022-01-12T11:39:44+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/support_request.html</loc>
- <lastmod>2020-05-01T11:11:56+12:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/</loc>
<lastmod>2020-05-01T11:11:56+12:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/store-parameters.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/architecture.html</loc>
<lastmod>2023-12-03T18:03:00+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/assembler.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/commands.html</loc>
<lastmod>2023-02-05T18:59:30+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/configuration.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/datasets.html</loc>
- <lastmod>2021-11-05T16:04:36+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/dynamic_datasets.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/faqs.html</loc>
- <lastmod>2021-12-05T23:14:11+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/java_api.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/optimizer.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/quadfilter.html</loc>
<lastmod>2021-11-15T19:40:46+00:00</lastmod>
@@ -621,7 +621,7 @@
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb/tdb_transactions.html</loc>
- <lastmod>2023-02-05T18:59:30+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/txn/transactions_tdb.html</loc>
<lastmod>2020-02-28T13:09:12+01:00</lastmod>
@@ -642,13 +642,13 @@
<lastmod>2022-07-27T16:28:14+02:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb2/tdb2_admin.html</loc>
- <lastmod>2022-07-27T16:28:14+02:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb2/tdb2_migration.html</loc>
<lastmod>2023-02-26T22:14:57+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/tdb2/tdb2_fuseki.html</loc>
- <lastmod>2022-01-12T17:24:53+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/rdf/</loc>
<lastmod>2024-03-17T17:45:17+00:00</lastmod>
@@ -669,37 +669,37 @@
<lastmod>2020-05-01T11:11:56+12:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/query/manipulating_sparql_using_arq.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_pt.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_query1_pt.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_data_pt.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_optionals_pt.html</loc>
- <lastmod>2020-05-01T11:11:56+12:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_filters_pt.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/sparql_basic_patterns_pt.html</loc>
- <lastmod>2020-02-28T13:09:12+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials.html</loc>
- <lastmod>2024-01-17T23:23:50+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/txn/txn.html</loc>
- <lastmod>2021-03-26T16:47:58+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/notes/typed-literals.html</loc>
<lastmod>2023-10-30T12:01:30+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/rdf_api_pt.html</loc>
- <lastmod>2023-10-30T12:01:30+00:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/using_jena_with_eclipse_pt.html</loc>
<lastmod>2023-11-23T00:10:28+01:00</lastmod>
@@ -708,7 +708,7 @@
<lastmod>2024-03-17T17:44:27+00:00</lastmod>
</url><url>
<loc>https://jena.apache.org/download/maven.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/tutorials/using_jena_with_eclipse.html</loc>
<lastmod>2023-11-23T00:10:28+01:00</lastmod>
@@ -717,7 +717,7 @@
<lastmod>2022-12-21T14:55:40+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/about_jena/about.html</loc>
- <lastmod>2022-12-21T14:55:40+01:00</lastmod>
+ <lastmod>2024-03-28T22:35:37+01:00</lastmod>
</url><url>
<loc>https://jena.apache.org/documentation/io/streaming-io.html</loc>
<lastmod>2023-10-30T12:01:30+00:00</lastmod>
diff --git a/content/tutorials/index.xml b/content/tutorials/index.xml
index 12af179ba..95518259a 100644
--- a/content/tutorials/index.xml
+++ b/content/tutorials/index.xml
@@ -85,7 +85,7 @@ If you are looking for a short introduction to SPARQL and Jena try Search RDF da
<guid>https://jena.apache.org/tutorials/sparql_query1.html</guid>
<description>In this section, we look at a simple first query and show how to execute it with Jena.
A &ldquo;hello world&rdquo; of queries The file &ldquo;q1.rq&rdquo; contains the following query:
-SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &quot;John Smith&quot; } executing that query with the command line query application;
+SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &#34;John Smith&#34; } executing that query with the command line query application;
--------------------------------- | x | ================================= | &lt;http://somewhere/JohnSmith/&gt; | --------------------------------- This works by matching the triple pattern in the WHERE clause against the triples in the RDF graph.</description>
</item>
@@ -96,7 +96,7 @@ SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &am
<guid>https://jena.apache.org/tutorials/sparql_union.html</guid>
<description>Another way of dealing with the semi-structured data is to query for one of a number of possibilities. This section covers UNION patterns, where one of a number of possibilities is tried.
-UNION - two ways to the same data Both the vCard vocabulary and the FOAF vocabulary have properties for people&rsquo;s names. In vCard, it is vCard:FN, the &ldquo;formatted name&rdquo;, and in FOAF, it is foaf:name. In this section, we will look at a small set of data where the names of people can be given by either the FOAF or the vCard vocabulary.</description>
+UNION - two ways to the same data Both the vCard vocabulary and the FOAF vocabulary have properties for people&rsquo;s names. In vCard, it is vCard:FN, the &ldquo;formatted name&rdquo;, and in FOAF, it is foaf:name. In this section, we will look at a small set of data where the names of people can be given by either the FOAF or the vCard vocabulary.</description>
</item>
<item>
@@ -126,7 +126,7 @@ It is important to realize that it is the triples that matter, not the serializa
<guid>https://jena.apache.org/tutorials/sparql_datasets.html</guid>
<description>This section covers RDF Datasets - an RDF Dataset is the unit that is queried by a SPARQL query. It consists of a default graph, and a number of named graphs.
-Querying datasets The graph matching operation (basic patterns, OPTIONALs, and UNIONs) work on one RDF graph. This starts out being the default graph of the dataset but it can be changed by the GRAPH keyword.
+Querying datasets The graph matching operation (basic patterns, OPTIONALs, and UNIONs) work on one RDF graph. This starts out being the default graph of the dataset but it can be changed by the GRAPH keyword.
GRAPH uri { ... pattern .</description>
</item>
@@ -136,7 +136,7 @@ GRAPH uri { ... pattern .</description>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://jena.apache.org/tutorials/sparql_datasets_pt.html</guid>
- <description>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por um consulta SPARQL. Ele consiste de um grafo padrão, e certo número de grafos nomeados.
+ <description>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por uma consulta SPARQL. Ele consiste de um grafo padrão, e certo número de grafos nomeados.
Consultando datasets As operações de casamento de grafos (padrões básicos, OPTIONALs, e UNIONs) funcionam em um grafo RDF. Isso começa por ser o grafo padrão do conjunto de dados, mas pode ser alterado pela palavra-chave GRAPH. GRAPH uri { &hellip; padrão &hellip; }</description>
</item>
@@ -147,7 +147,7 @@ Consultando datasets As operações de casamento de grafos (padrões básicos, O
<guid>https://jena.apache.org/tutorials/sparql_filters.html</guid>
<description>Graph matching allows patterns in the graph to be found. This section describes how the values in a solution can be restricted. There are many comparisons available - we just cover two cases here.
-String Matching SPARQL provides an operation to test strings, based on regular expressions. This includes the ability to ask SQL &ldquo;LIKE&rdquo; style tests, although the syntax of the regular expression is different from SQL.
+String Matching SPARQL provides an operation to test strings, based on regular expressions. This includes the ability to ask SQL &ldquo;LIKE&rdquo; style tests, although the syntax of the regular expression is different from SQL.
The syntax is:</description>
</item>
@@ -181,7 +181,7 @@ SPARQL é uma linguagem de consulta e um protocolo para acesso a RDF elaborado p
<guid>https://jena.apache.org/tutorials/sparql_query1_pt.html</guid>
<description>Nesta sessão, vamos olhar para a primeira consulta simples e mostrar como executá-la em Jena.
O &ldquo;hello world&rdquo; de consultas O arquivo &ldquo;q1.rq&rdquo; contem a seguinte consulta:
-SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &quot;John Smith&quot; } executando esta consulta com a aplicação de consultas em linhas de comando:
+SELECT ?x WHERE { ?x &lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt; &#34;John Smith&#34; } executando esta consulta com a aplicação de consultas em linhas de comando:
--------------------------------- | x | ================================= | &lt;http://somewhere/JohnSmith/&gt; | --------------------------------- Isso funciona casando o padrão da tripla na clausula WHERE contra as triplas no grafo RDF.</description>
</item>
diff --git a/content/tutorials/rdf_api.html b/content/tutorials/rdf_api.html
index 90a5b852f..f86a1d633 100644
--- a/content/tutorials/rdf_api.html
+++ b/content/tutorials/rdf_api.html
@@ -606,8 +606,7 @@ output:
</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><j.0:Q</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#z"</span><span style="color:#008000;font-weight:bold">/></span>
</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
-</span></span></code></pre></div><p>The other namespace still gets the constructed name, but the nsA name
-is now used in the property tags. There’s no need for the prefix name
+</span></span></code></pre></div><p>is now used in the property tags. There’s no need for the prefix name
to have anything to do with the variables in the Jena code:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span># -- nsA and cat defined
</span></span><span style="display:flex;"><span>
@@ -779,18 +778,18 @@ package <code>org.apache.jena.rdf.model</code>. Using
<code>SimpleSelector </code>is one of the rare occasions in Jena when it is
necessary to use a specific class rather than an interface. The
<code>SimpleSelector</code> constructor takes three arguments:</p>
-<pre>Selector selector = new SimpleSelector(subject, predicate, object);</pre>
-<p>This selector will select all statements with a subject that matches
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span>subject<span style="color:#666">,</span> predicate<span style="color:#666">,</span> object<span style="color:#666">);</span>
+</span></span></code></pre></div><p>This selector will select all statements with a subject that matches
<code>subject</code>, a predicate that matches <code>predicate</code> and an
object that matches <code>object</code>. If a <code>null</code> is supplied
in any of the positions, it matches anything; otherwise they match corresponding
equal resources or literals. (Two resources are equal if they have equal URIs
or are the same blank node; two literals are the same if all their components
are equal.) Thus:</p>
-<pre>Selector selector = new SimpleSelector(null, null, null);</pre>
-<p>will select all the statements in a Model.</p>
-<pre>Selector selector = new SimpleSelector(null, VCARD.FN, null);</pre>
-<p>will select all the statements with VCARD.FN as their predicate, whatever
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span [...]
+</span></span></code></pre></div><p>will select all the statements in a Model.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> VCARD<span style="color:#666">.</span><span style="color:# [...]
+</span></span></code></pre></div><p>will select all the statements with VCARD.FN as their predicate, whatever
the subject or object. As a special shorthand,
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>listStatements<span style="color:#666">(</span> S<span style="color:#666">,</span> P<span style="color:#666">,</span> O <span style="color:#666">)</span>
</span></span></code></pre></div><p>is equivalent to</p>
@@ -819,7 +818,7 @@ vcards in the database.</p>
</span></span><span style="display:flex;"><span> Becky Smith
</span></span></code></pre></div><p>Your next exercise is to modify this code to use <code>SimpleSelector
</code>instead of <code>listSubjectsWithProperty</code>.</p>
-<p>Lets see how to implement some finer control over the statements selected.
+<p>Let's see how to implement some finer control over the statements selected.
<code>SimpleSelector</code> can be subclassed and its selects method modified
to perform further filtering:</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// select all the resources with a VCARD.FN property
@@ -874,7 +873,7 @@ Consider the following two Models:</p>
one and the duplicate <code>vcard:FN</code> arc is dropped to produce:</p>
<p style="text-align: center">
<img alt="figure 6" src="figures/fig6.png" width="540" height="240"></p>
-<p>Lets look at the code to do this (the full code is in <a
+<p>Let's look at the code to do this (the full code is in <a
href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial09.java">tutorial 9</a>) and see what happens.</p>
<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// read the RDF/XML files
</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model1<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> InputStreamReader<span style="color:#666">(</span>in1<span style="color:#666">),</span> <span style="color:#b44">""</span><span style="color:#666">);</span>
@@ -1016,7 +1015,7 @@ French language tag. This rather strange behaviour is an artefact of the
original RDF/XML syntax.</p>
<p>Further there are really two sorts of Literals. In one, the string
component is just that, an ordinary string. In the other the string
-component is expected to be a well balanced fragment of XML. When an RDF
+component is expected to be a well-balanced fragment of XML. When an RDF
Model is written as RDF/XML a special construction using a
parseType='Literal' attribute is used to represent it.</p>
<p>In Jena, these attributes of a literal may be set when the literal is
@@ -1065,8 +1064,8 @@ call):</p>
</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// write out the Model
</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>system<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> <span style="color:#b44">"N-TRIPLE"</span><span style="color:#666">);</span>
</span></span></code></pre></div><p>The output produced is:</p>
-<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">A</span>...<span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2000/01/rdf-schema#label></span><span style="color:#bbb"> </span><span style=" [...]
-</span></span></span></code></pre></div><p>Since both literals are really just the string "11", then only one
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>_:A... <http://www.w3.org/2000/01/rdf-schema#label> <span style="color:#b44">"11"</span> .
+</span></span></code></pre></div><p>Since both literals are really just the string "11", then only one
statement is added.</p>
<p>The RDFCore WG has defined mechanisms for supporting datatypes in RDF.
Jena supports these using the <i>typed literal</i> mechanisms; they are
diff --git a/content/tutorials/rdf_api_pt.html b/content/tutorials/rdf_api_pt.html
index 4bb02062c..a225bf59c 100644
--- a/content/tutorials/rdf_api_pt.html
+++ b/content/tutorials/rdf_api_pt.html
@@ -226,54 +226,51 @@ href="#glos-Literal"><i>literal</i></a>, que por hora podemos pensar nelas como
Literais são exibidas em retângulos.</p>
<p>Jena é uma API Java que pode ser usada para pra criar e manipular grafos RDF como o apresentado no exemplo. Jena possui classes para representar grafos, recursos, propriedades e literais. As interfaces que representam recursos, propriedades e literais são chamadas de modelo e é representada pela interface Model.</p>
<p>O código para criar este grafo, ou modelo, é simples:</p>
-<pre>// some definitions
-static String personURI = "http://somewhere/JohnSmith";
-static String fullName = "John Smith";
-
-// create an empty Model
-Model model = ModelFactory.createDefaultModel();
-
-// create the resource
-Resource johnSmith = model.createResource(personURI);
-
-// add the property
-johnSmith.addProperty(VCARD.FN, fullName);
-</pre>
-<p>Ele começa com algumas definições de constantes e então cria um Model vazio, usando o método <code>createDefaultModel()</code> de <code>ModelFactory</code>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// some definitions
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#a2f;font-weight:bold">static</span> String personURI <span style="color:#666">=</span> <span style="color:#b44">"http://somewhere/JohnSmith"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">static</span> String fullName <span style="color:#666">=</span> <span style="color:#b44">"John Smith"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create an empty Model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model model <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create the resource
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource johnSmith <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span>personURI<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// add the property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>johnSmith<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">,</span> fullName<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Ele começa com algumas definições de constantes e então cria um Model vazio, usando o método <code>createDefaultModel()</code> de <code>ModelFactory</code>
para criar um modelo na memória. Jena possui outras implementações da interface Model, e.g. uma que usa banco de dados relacionais: esses tipos de modelo são também disponibilizados a partir de ModelFactory.</p>
<p>O recurso Jonh Smith é então criado, e uma propriedade é adicionada a ele. A propriedade é fornecida pela a classe "constante" VCARD, que mantém os objetos que representam todas as definições no esquema de VCARD. Jena provê classes constantes para outros esquemas bem conhecidos, bem como os próprios RDF e RDFs , Dublin Core e OWL.</p>
<p>O código para criar o recurso e adicionar a propriedade pode ser escrito de forma mais compacta usando um estilo cascata:</p>
-<pre>Resource johnSmith =
- model.createResource(personURI)
- .addProperty(VCARD.FN, fullName);
-</pre>
-<p>Os códigos desse exemplo podem ser encontrados no diretório /src-examples no pacote de distribuição do Jena como <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial01.java">tutorial 1</a>. Como exercício, pegue este código e modifique-o para criar um próprio VCARD para você.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Resource johnSmith <span style="color:#666">=</span>
+</span></span><span style="display:flex;"><span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span>personURI<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">,</span> fullName<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Os códigos desse exemplo podem ser encontrados no diretório /src-examples no pacote de distribuição do Jena como <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial01.java">tutorial 1</a>. Como exercício, pegue este código e modifique-o para criar um próprio VCARD para você.</p>
<p>Agora vamos adicionar mais detalhes ao vcard, explorando mais recursos de RDF e Jena.</p>
<p>No primeiro exemplo, o valor da propriedade foi um número. As propriedades RDF podem também assumir outros recursos como valor. Usando uma técnica comum em RDF, este exemplo mostra como representar diferentes partes do nome de Jonh Smith:</p>
<p align="center">
<img border="0" src="figures/fig2.png" alt="figure 2" width="360" height="240"></p>
<p>Aqui, nós adicionamos uma nova propriedade, vcard:N, para representar a estrutura do nome de Jonh Smith. Há muitas coisas interessantes sobre este modelo. Note que a propriedade vcard:N usa um recurso como seu valor. Note também que a elipse que representa a composição do nome não possui URI. Isso é conhecido como <i><a href="#glos-blank node">blank Node</a>.</i></p>
<p>O código Jena para construir este exemplo é, novamente, muito simples. Primeiro algumas declarações e a criação do modelo vazio.</p>
-<pre>// some definitions
-String personURI = "http://somewhere/JohnSmith";
-String givenName = "John";
-String familyName = "Smith";
-String fullName = givenName + " " + familyName;
-
-// create an empty Model
-Model model = ModelFactory.createDefaultModel();
-
-// create the resource
-// and add the properties cascading style
-Resource johnSmith
- = model.createResource(personURI)
- .addProperty(VCARD.FN, fullName)
- .addProperty(VCARD.N,
- model.createResource()
- .addProperty(VCARD.Given, givenName)
- .addProperty(VCARD.Family, familyName));
-</pre>
-<p>Os códigos desse exemplo podem ser encontrados no diretório /src-examples no pacote de distribuição do Jena como <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial02.java">tutorial 2</a>.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// some definitions
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>String personURI <span style="color:#666">=</span> <span style="color:#b44">"http://somewhere/JohnSmith"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>String givenName <span style="color:#666">=</span> <span style="color:#b44">"John"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>String familyName <span style="color:#666">=</span> <span style="color:#b44">"Smith"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>String fullName <span style="color:#666">=</span> givenName <span style="color:#666">+</span> <span style="color:#b44">" "</span> <span style="color:#666">+</span> familyName<span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create an empty Model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model model <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create the resource
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// and add the properties cascading style
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource johnSmith
+</span></span><span style="display:flex;"><span> <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span>personURI<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">,</span> fullName<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">N</span><span style="color:#666">,</span>
+</span></span><span style="display:flex;"><span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">Given</span><span style="color:#666">,</span> givenName<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">Family</span><span style="color:#666">,</span> familyName<span style="color:#666">));</span>
+</span></span></code></pre></div><p>Os códigos desse exemplo podem ser encontrados no diretório /src-examples no pacote de distribuição do Jena como <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial02.java">tutorial 2</a>.</p>
<h2 id="ch-Statements">Sentenças</h2>
<p>Cada arco no modelo RDF é chamado de <i><a
href="#glos-Statement">sentença</a></i>. Cada sentença define um fato sobre o recurso. Uma sentença possui três partes:</p>
@@ -290,38 +287,36 @@ por causa de suas três partes.</p>
<code>StmtIterator</code> possui o método <code>nextStatement()</code>
que retorna a próxima sentença do iterador (o mesmo que <code>next()</code> faz, já convertido para <code>Statement</code>). A interface <code>Statement</code> provê métodos de acesso ao sujeito, predicado e objeto de uma sentença.</p>
<p>Agora vamos usar essa interface para estender tutorial2 para listar todas as sentenças criadas e imprimi-las. O código completo deste exemplo pode ser encontrado em <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial03.java">tutorial 3</a>.</p>
-<pre>// list the statements in the Model
-StmtIterator iter = model.listStatements();
-
-// print out the predicate, subject and object of each statement
-while (iter.hasNext()) {
- Statement stmt = iter.nextStatement(); // get next statement
- Resource subject = stmt.getSubject(); // get the subject
- Property predicate = stmt.getPredicate(); // get the predicate
- RDFNode object = stmt.getObject(); // get the object
-
- System.out.print(subject.toString());
- System.out.print(" " + predicate.toString() + " ");
- if (object instanceof Resource) {
- System.out.print(object.toString());
- } else {
- // object is a literal
- System.out.print(" \"" + object.toString() + "\"");
- }
-
- System.out.println(" .");
-}
-</pre>
-<p>Já que o objeto de uma sentença pode ser tanto um recurso quanto uma literal, o método
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// list the statements in the Model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>StmtIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// print out the predicate, subject and object of each statement
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> Statement stmt <span style="color:#666">=</span> iter<span style="color:#666">.</span><span style="color:#b44">nextStatement</span><span style="color:#666">();</span> <span style="color:#080;font-style:italic">// get next statement
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> Resource subject <span style="color:#666">=</span> stmt<span style="color:#666">.</span><span style="color:#b44">getSubject</span><span style="color:#666">();</span> <span style="color:#080;font-style:italic">// get the subject
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> Property predicate <span style="color:#666">=</span> stmt<span style="color:#666">.</span><span style="color:#b44">getPredicate</span><span style="color:#666">();</span> <span style="color:#080;font-style:italic">// get the predicate
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> RDFNode object <span style="color:#666">=</span> stmt<span style="color:#666">.</span><span style="color:#b44">getObject</span><span style="color:#666">();</span> <span style="color:#080;font-style:italic">// get the object
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span>subject<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span><span style="color:#b44">" "</span> <span style="color:#666">+</span> predicate<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">()</span> <span style="color:#666">+</span> <span style="color:#b44">"  [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>object <span style="color:#a2f;font-weight:bold">instanceof</span> Resource<span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span>object<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#080;font-style:italic">// object is a literal
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">print</span><span style="color:#666">(</span><span style="color:#b44">" \""</span> <span style="color:#666">+</span> object<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">()</span> <spa [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" ."</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Já que o objeto de uma sentença pode ser tanto um recurso quanto uma literal, o método
<code>getObject()</code> retorna um objeto do tipo <code>RDFNode</code>, que é uma superclasse comum de ambos <code>Resource</code> e <code>Literal</code>. O objeto em si é do tipo apropriado, então o código usa <code>instanceof</code> para determinar qual e processá-lo de acordo.</p>
<p>Quando executado, o programa deve produzir a saída:</p>
-<pre>http://somewhere/JohnSmith http://www.w3.org/2001/vcard-rdf/3.0#N anon:14df86:ecc3dee17b:-7fff .
-anon:14df86:ecc3dee17b:-7fff http://www.w3.org/2001/vcard-rdf/3.0#Family "Smith" .
-anon:14df86:ecc3dee17b:-7fff http://www.w3.org/2001/vcard-rdf/3.0#Given "John" .
-http://somewhere/JohnSmith http://www.w3.org/2001/vcard-rdf/3.0#FN "John Smith"
-.
-</pre>
-<p></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">http</span>:<span style="">//somewhere/JohnSmith</span><span style="color:#bbb"> </span><span style="">http</span>:<span style="">//www</span>.<span style="">w</span><span style="color:#666">3</span>.<span style="">org/</span><span style="color:#666">2001</span><span style="">/ [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">anon</span>:<span style="color:#666">14</span><span style="color:#00f;font-weight:bold">df86:</span><span style="color:#008000;font-weight:bold">ecc3dee17b</span>:<span style="color:#666">-7</span><span style="">fff</span><span style="color:#bbb"> </span><span style="">http</span>:<span style="">//www</span>.<span style="">w</span><span style="color:#666">3</span>.<span style="">org/</sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">anon</span>:<span style="color:#666">14</span><span style="color:#00f;font-weight:bold">df86:</span><span style="color:#008000;font-weight:bold">ecc3dee17b</span>:<span style="color:#666">-7</span><span style="">fff</span><span style="color:#bbb"> </span><span style="">http</span>:<span style="">//www</span>.<span style="">w</span><span style="color:#666">3</span>.<span style="">org/</sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">http</span>:<span style="">//somewhere/JohnSmith</span><span style="color:#bbb"> </span><span style="">http</span>:<span style="">//www</span>.<span style="">w</span><span style="color:#666">3</span>.<span style="">org/</span><span style="color:#666">2001</span><span style="">/vcard-rdf/</span><span style="color:#666">3.0</span><span style="color:#080;font-style:italic">#FN "John Sm [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p></p>
<p>Agora você sabe o porquê de ser simples elaborar modelos. Se você olhar atentamente, você perceberá que cada linha consiste de três campos representando o sujeito, predicado e objeto de cada sentença. Há quatro arcos no nosso modelo, então há quatro sentenças. O "anon:14df86:ecc3dee17b:-7fff" é um identificador interno gerado pelo Jena. Não é uma URI e não deve ser confundido como tal. É simplesmente um nome interno usado pela implementação do Jena.</p>
<p>O W3C <a href="https://www.w3.org/2001/sw/RDFCore/">RDFCore Working
Group</a> definiu uma notação similar chamada <a href="https://www.w3.org/TR/rdf-testcases/#ntriples">N-Triples</a>. O nome significa "notação de triplas". Nós veremos na próxima sessão que o Jena possui uma interface de escrita de N-Triples também.</p>
@@ -329,23 +324,23 @@ Group</a> definiu uma notação similar chamada <a href="https://www.w3.org/TR/r
<p>Jena possui métodos para ler e escrever RDF como XML. Eles podem ser usados para armazenar o modelo RDF em um arquivo e carregá-lo novamente em outro momento.</p>
<p>O Tutorial 3 criou um modelo e o escreveu no formato de triplas. <a
href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial04.java">Tutorial 4</a> modifica o tutorial 3 para escrever o modelo na forma de RDF XML numa stream de saída. O código, novamente, é muito simples: <code>model.write</code> pode receber um <code>OutputStream</code> como argumento.</p>
- <pre>// now write the model in XML form to a file
-model.write(System.out);</pre>
-<p>A saída deve parecer com isso:</p>
- <pre><rdf:RDF
- xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
- xmlns:vcard='http://www.w3.org/2001/vcard-rdf/3.0#'
- >
- <rdf:Description rdf:about='http://somewhere/JohnSmith'>
- <vcard:FN>John Smith</vcard:FN>
- <vcard:N rdf:nodeID="A0"/>
- </rdf:Description>
- <rdf:Description rdf:nodeID="A0">
- <vcard:Given>John</vcard:Given>
- <vcard:Family>Smith</vcard:Family>
- </rdf:Description>
-</rdf:RDF></pre>
-<p></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// now write the model in XML form to a file
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>A saída deve parecer com isso:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">'http://www.w3.org/1999/02/22-rdf-syntax-ns#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:vcard=</span><span style="color:#b44">'http://www.w3.org/2001/vcard-rdf/3.0#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">'http://somewhere/JohnSmith'</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>John Smith<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A0"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A0"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>John<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Smith<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p></p>
<p>As especificações de RDF especificam como representar RDF como XML. A sintaxe de RDF XML é bastante complexa. Recomendamos ao leitor dar uma olhada no <a href="https://www.w3.org/TR/rdf-primer/">primer</a> sendo desenvolvido pelo RDFCore WG para uma introdução mais detalhada. Entretanto, vamos dar uma olhada rápida em como interpretar a saída acima.</p>
<p>RDF é normalmente encapsulada num elemento <rdf:RDF>. O elemento é opcional se houver outras maneiras de saber se aquele XML é RDF, mas normalmente ele é presente. O elemento RDF define os dois namespaces usados no documento. Há um elemento <rdf:Description> que descreve o recurso cuja URI é "http://somewhere/JohnSmith". Se o atributo rdf:about estivesse ausente, esse elemento representaria um blank node.</p>
<p>O elemento <vcard:FN> descreve uma propriedade do recurso. O nome da propriedade é o "FN" no namespace do vcard. RDF o converte para uma referência URI concatenando a referência URI do prefixo presente no namespace de vcard e "FN", o nome local parte do nome. Isto nos dá a referência URI " http://www.w3.org/2001/vcard-rdf/3.0#FN". O valor da propriedade é a literal "Jonh Smith".</p>
@@ -353,158 +348,144 @@ model.write(System.out);</pre>
<p>Há um erro nesse RDF XML: ele não representa exatamente o modelo que criamos. Foi dado uma URI ao blank node do modelo. Ele não é mais um blank node portanto. A sintaxe RDF/XML não é capaz de representar todos os modelos RDF; por exemplo, ela não pode representar um blank node que é o objeto de duas sentenças. O escritor que usamos para escrever este RDF/XML não é capaz de escrever corretamente o subconjunto de modelos que podem ser escritos corretamente. Ele dá uma URI a cada blank n [...]
<p>Jena possui uma interface extensível que permite novos escritores para diferentes linguagens de serialização RDF. Jena possuem também um escritor RDF/XML mais sofisticado que pode ser invocado ao especificar outro argumento à chamada de método
<code>RDFDataMgr.write</code>:</p>
-<pre>// now write the model in a pretty form
-RDFDataMgr.write(System.out, model, Lang.RDFXML);
-</pre>
-<p>Este escritor, chamado também de PrettyWriter, ganha vantagem ao usar as particularidades da sintaxe abreviada de RDF/XML ao criar um modelo mais compacto. Ele também é capaz de preservar os blank nodes onde é possível. Entretanto, não é recomendável para escrever modelos muito grandes, já que sua desempenho deixa a desejar. Para escrever grandes arquivos e preservar os blank nodes, escreva no formato de N-Triplas:</p>
-<pre>// now write the model in XML form to a file
-RDFDataMgr.write(System.out, model, Lang.NTRIPLES);
-</pre>
-<p>Isso produzirá uma saída similar à do tutorial 3, que está em conformidade com a especificação de N-Triplas.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// now write the model in a pretty form
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> model<span style="color:#666">,</span> Lang<span style="color:#666">.</span><span style="color:#b44">RDFXML</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>Este escritor, chamado também de PrettyWriter, ganha vantagem ao usar as particularidades da sintaxe abreviada de RDF/XML ao criar um modelo mais compacto. Ele também é capaz de preservar os blank nodes onde é possível. Entretanto, não é recomendável para escrever modelos muito grandes, já que sua desempenho deixa a desejar. Para escrever grandes arquivos e preservar os blank nodes, escreva no formato de N-Triplas:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// now write the model in XML form to a file
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> model<span style="color:#666">,</span> Lang<span style="color:#666">.</span><span style="color:#b44">NTRIPLES</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>Isso produzirá uma saída similar à do tutorial 3, que está em conformidade com a especificação de N-Triplas.</p>
<h2 id="ch-Reading-RDF">Leitura de RDF</h2>
<p><a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial05.java">Tutorial 5</a> demonstra a leitura num modelo de sentenças gravadas num RDF XML. Com este tutorial, nós teremos criado uma pequena base de dados de vcards na forma RDF/XML. O código a seguir fará leitura e escrita. <em>Note que para esta aplicação rodar, o arquivo de entrada precisa estar no diretório da aplicação.</em></p>
-<pre>
-// create an empty model
-Model model = ModelFactory.createDefaultModel();
-
-// use the RDFDataMgr to find the input file
-InputStream in = RDFDataMgr.open( inputFileName );
-if (in == null) {
- throw new IllegalArgumentException(
- "File: " + inputFileName + " not found");
-}
-
-// read the RDF/XML file
-model.read(in, null);
-
-// write it to standard out
-model.write(System.out);
-</pre>
-<p>O segundo argumento da chamada de método <code>read()</code> é a URI que será usada para resolver URIs relativas. Como não há referências URI relativas no arquivo de teste, ele pode ser vazio. Quando executado, <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial05.java"> tutorial 5</a> produzirá uma saída XML como esta:</p>
-<pre><rdf:RDF
- xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
- xmlns:vcard='http://www.w3.org/2001/vcard-rdf/3.0#'
- >
- <rdf:Description rdf:nodeID="A0">
- <vcard:Family>Smith</vcard:Family>
- <vcard:Given>John</vcard:Given>
- </rdf:Description>
- <rdf:Description rdf:about='http://somewhere/JohnSmith/'>
- <vcard:FN>John Smith</vcard:FN>
- <vcard:N rdf:nodeID="A0"/>
- </rdf:Description>
- <rdf:Description rdf:about='http://somewhere/SarahJones/'>
- <vcard:FN>Sarah Jones</vcard:FN>
- <vcard:N rdf:nodeID="A1"/>
- </rdf:Description>
- <rdf:Description rdf:about='http://somewhere/MattJones/'>
- <vcard:FN>Matt Jones</vcard:FN>
- <vcard:N rdf:nodeID="A2"/>
- </rdf:Description>
- <rdf:Description rdf:nodeID="A3">
- <vcard:Family>Smith</vcard:Family>
- <vcard:Given>Rebecca</vcard:Given>
- </rdf:Description>
- <rdf:Description rdf:nodeID="A1">
- <vcard:Family>Jones</vcard:Family>
- <vcard:Given>Sarah</vcard:Given>
- </rdf:Description>
- <rdf:Description rdf:nodeID="A2">
- <vcard:Family>Jones</vcard:Family>
- <vcard:Given>Matthew</vcard:Given>
- </rdf:Description>
- <rdf:Description rdf:about='http://somewhere/RebeccaSmith/'>
- <vcard:FN>Becky Smith</vcard:FN>
- <vcard:N rdf:nodeID="A3"/>
- </rdf:Description>
-</rdf:RDF></pre>
-<h2 id="ch-Prefixes">Controlando prefixos</h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create an empty model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model model <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// use the RDFDataMgr to find the input file
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>InputStream in <span style="color:#666">=</span> RDFDataMgr<span style="color:#666">.</span><span style="color:#b44">open</span><span style="color:#666">(</span> inputFileName <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>in <span style="color:#666">==</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">throw</span> <span style="color:#a2f;font-weight:bold">new</span> IllegalArgumentException<span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">"File: "</span> <span style="color:#666">+</span> inputFileName <span style="color:#666">+</span> <span style="color:#b44">" not found"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// read the RDF/XML file
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span>in<span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// write it to standard out
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>O segundo argumento da chamada de método <code>read()</code> é a URI que será usada para resolver URIs relativas. Como não há referências URI relativas no arquivo de teste, ele pode ser vazio. Quando executado, <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial05.java"> tutorial 5</a> produzirá uma saída XML como esta:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">'http://www.w3.org/1999/02/22-rdf-syntax-ns#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:vcard=</span><span style="color:#b44">'http://www.w3.org/2001/vcard-rdf/3.0#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A0"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Smith<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>John<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">'http://somewhere/JohnSmith/'</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>John Smith<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A0"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">'http://somewhere/SarahJones/'</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>Sarah Jones<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A1"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">'http://somewhere/MattJones/'</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>Matt Jones<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A2"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A3"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Smith<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>Rebecca<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A1"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Jones<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>Sarah<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A2"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Jones<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>Matthew<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">'http://somewhere/RebeccaSmith/'</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>Becky Smith<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A3"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><h2 id="ch-Prefixes">Controlando prefixos</h2>
<h3 id="definições-explícitas-de-prefixos">Definições explícitas de prefixos</h3>
<p>Na sessão anterior, nós vimos que a saída XML declarou um prefixo namespace<br>
<code>vcard</code> e o usou para abreviar URIs. Enquanto que RDF usa somente URIs completas, e não sua forma encurtada, Jena provê formas de controlar namespaces usados na saída com seu mapeamento de prefixos. Aqui vai um exemplo simples.</p>
-<pre>
- Model m = ModelFactory.createDefaultModel();
- String nsA = "http://somewhere/else#";
- String nsB = "http://nowhere/else#";
- Resource root = m.createResource( nsA + "root" );
- Property P = m.createProperty( nsA + "P" );
- Property Q = m.createProperty( nsB + "Q" );
- Resource x = m.createResource( nsA + "x" );
- Resource y = m.createResource( nsA + "y" );
- Resource z = m.createResource( nsA + "z" );
- m.add( root, P, x ).add( root, P, y ).add( y, Q, z );
- System.out.println( "# -- no special prefixes defined" );
- m.write( System.out );
- System.out.println( "# -- nsA defined" );
- m.setNsPrefix( "nsA", nsA );
- m.write( System.out );
- System.out.println( "# -- nsA and cat defined" );
- m.setNsPrefix( "cat", nsB );
- m.write( System.out );
-</pre>
-<p>A saída deste fragmento são três blocos de RDF/XML, com três diferentes mapeamentos de prefixos. Primeiro o padrão, sem prefixos diferentes dos padrões:</p>
-<pre>
-# -- no special prefixes defined
-
-<rdf:RDF
- xmlns:j.0="http://nowhere/else#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:j.1="http://somewhere/else#" >
- <rdf:Description rdf:about="http://somewhere/else#root">
- <j.1:P rdf:resource="http://somewhere/else#x"/>
- <j.1:P rdf:resource="http://somewhere/else#y"/>
- </rdf:Description>
- <rdf:Description rdf:about="http://somewhere/else#y">
- <j.0:Q rdf:resource="http://somewhere/else#z"/>
- </rdf:Description>
-</rdf:RDF>
-</pre>
-<p>Nós vimos que o namespace rdf é declarado automaticamente, já que são requeridos para tags como <code><RDF:rdf></code> e <code><rdf:resource></code>. Declarações de namespace são também necessárias para o uso das duas propriedades P e Q, mas já que seus namespaces não foram introduzidos no modelo, eles recebem nomes namespaces inventados <code>j.0</code> e <code>j.1</code>.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model m <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>String nsA <span style="color:#666">=</span> <span style="color:#b44">"http://somewhere/else#"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>String nsB <span style="color:#666">=</span> <span style="color:#b44">"http://nowhere/else#"</span><span style="color:#666">;</span>
+</span></span><span style="display:flex;"><span>Resource root <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span> nsA <span style="color:#666">+</span> <span style="color:#b44">"root"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Property P <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createProperty</span><span style="color:#666">(</span> nsA <span style="color:#666">+</span> <span style="color:#b44">"P"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Property Q <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createProperty</span><span style="color:#666">(</span> nsB <span style="color:#666">+</span> <span style="color:#b44">"Q"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource x <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span> nsA <span style="color:#666">+</span> <span style="color:#b44">"x"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource y <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span> nsA <span style="color:#666">+</span> <span style="color:#b44">"y"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>Resource z <span style="color:#666">=</span> m<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">(</span> nsA <span style="color:#666">+</span> <span style="color:#b44">"z"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span> root<span style="color:#666">,</span> P<span style="color:#666">,</span> x <span style="color:#666">).</span><span style="color:#b44">add</span><span style="color:#666">(</span> root<span style="color:#666">,</span> P<span style="color:#666">,</span> y <span style="color:#666">).</span><span style="color:#b44">add</span><span style="color: [...]
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span> <span style="color:#b44">"# -- no special prefixes defined"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span> System<span style="color:#666">.</span><span style="color:#b44">out</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span> <span style="color:#b44">"# -- nsA defined"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">setNsPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"nsA"</span><span style="color:#666">,</span> nsA <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span> System<span style="color:#666">.</span><span style="color:#b44">out</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span> <span style="color:#b44">"# -- nsA and cat defined"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">setNsPrefix</span><span style="color:#666">(</span> <span style="color:#b44">"cat"</span><span style="color:#666">,</span> nsB <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span> System<span style="color:#666">.</span><span style="color:#b44">out</span> <span style="color:#666">);</span>
+</span></span></code></pre></div><p>A saída deste fragmento são três blocos de RDF/XML, com três diferentes mapeamentos de prefixos. Primeiro o padrão, sem prefixos diferentes dos padrões:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span># -- no special prefixes defined
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:j.0=</span><span style="color:#b44">"http://nowhere/else#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:j.1=</span><span style="color:#b44">"http://somewhere/else#"</span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#root"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><j.1:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#x"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><j.1:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><j.0:Q</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#z"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>Nós vimos que o namespace rdf é declarado automaticamente, já que são requeridos para tags como <code><RDF:rdf></code> e <code><rdf:resource></code>. Declarações de namespace são também necessárias para o uso das duas propriedades P e Q, mas já que seus namespaces não foram introduzidos no modelo, eles recebem nomes namespaces inventados <code>j.0</code> e <code>j.1</code>.</p>
<p>O método <code>setNsPrefix(String prefix, String URI)</code>
declara que o namespace da <code>URI</code> deve ser abreviado por <code>prefixos</code>. Jena requer que o <code>prefixo</code> seja um namespace XML correto, e que o <code>URI</code> termine com um caractere sem-nome. O escritor RDF/XML transformará essas declarações de prefixos em declarações de namespaces XML e as usará nas suas saídas:
-<pre>
-# -- nsA defined
-
-<rdf:RDF
- xmlns:j.0="http://nowhere/else#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:nsA="http://somewhere/else#" >
- <rdf:Description rdf:about="http://somewhere/else#root">
- <nsA:P rdf:resource="http://somewhere/else#x"/>
- <nsA:P rdf:resource="http://somewhere/else#y"/>
- </rdf:Description>
- <rdf:Description rdf:about="http://somewhere/else#y">
- <j.0:Q rdf:resource="http://somewhere/else#z"/>
- </rdf:Description>
-</rdf:RDF>
-</pre>
-<p>O outro namespace ainda recebe o nome criado automaticamente, mas o nome nsA é agora usado nas tags de propriedades. Não há necessidade de que o nome do prefixo tenha alguma relação com as variáveis do código Jena:</p>
-<pre>
-# -- nsA and cat defined
-
-<rdf:RDF
- xmlns:cat="http://nowhere/else#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:nsA="http://somewhere/else#" >
- <rdf:Description rdf:about="http://somewhere/else#root">
- <nsA:P rdf:resource="http://somewhere/else#x"/>
- <nsA:P rdf:resource="http://somewhere/else#y"/>
- </rdf:Description>
- <rdf:Description rdf:about="http://somewhere/else#y">
- <cat:Q rdf:resource="http://somewhere/else#z"/>
- </rdf:Description>
-</rdf:RDF>
-</pre>
-<p>Ambos os prefixos são usados na saída, e não houve a necessidade de prefixos gerados automaticamente.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span># -- nsA defined
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:j.0=</span><span style="color:#b44">"http://nowhere/else#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:nsA=</span><span style="color:#b44">"http://somewhere/else#"</span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#root"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><nsA:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#x"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><nsA:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><j.0:Q</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#z"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>O outro namespace ainda recebe o nome criado automaticamente, mas o nome nsA é agora usado nas tags de propriedades. Não há necessidade de que o nome do prefixo tenha alguma relação com as variáveis do código Jena:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span># -- nsA and cat defined
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:cat=</span><span style="color:#b44">"http://nowhere/else#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">"http://www.w3.org/1999/02/22-rdf-syntax-ns#"</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:nsA=</span><span style="color:#b44">"http://somewhere/else#"</span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#root"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><nsA:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#x"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><nsA:P</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/else#y"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><cat:Q</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">"http://somewhere/else#z"</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>Ambos os prefixos são usados na saída, e não houve a necessidade de prefixos gerados automaticamente.</p>
<h3 id="definições-implícitas-de-prefixos">Definições implícitas de prefixos</h3>
<p>Assim como as declarações de prefixos definidas por chamadas a <code>setNsPrefix</code>, Jena vai lembrar-se dos prefixos que foram usados na entrada para <code>model.read()</code>.</p>
<p>Pegue a saída produzida pelo fragmento anterior e cole-o dentro de algum arquivo, com a URL <b>file:/tmp/fragment.rdf</b> say. E execute o código:
-<pre>
-Model m2 = ModelFactory.createDefaultModel();
-m2.read( "file:/tmp/fragment.rdf" );
-m2.write( System.out );
-</pre>
-<p>Você verá que os prefixos da entrada são preservados na saída. Todos os prefixos são escritos, mesmo se eles não forem usados em lugar algum. Você pode remover um prefixo com <code>removeNsPrefix(String prefix)</code> se você não o quiser na saída.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Model m2 <span style="color:#666">=</span> ModelFactory<span style="color:#666">.</span><span style="color:#b44">createDefaultModel</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>m2<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span> <span style="color:#b44">"file:/tmp/fragment.rdf"</span> <span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>m2<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span> System<span style="color:#666">.</span><span style="color:#b44">out</span> <span style="color:#666">);</span>
+</span></span></code></pre></div><p>Você verá que os prefixos da entrada são preservados na saída. Todos os prefixos são escritos, mesmo se eles não forem usados em lugar algum. Você pode remover um prefixo com <code>removeNsPrefix(String prefix)</code> se você não o quiser na saída.</p>
<p>Como N-Triplas não possuem nenhuma forma reduzida de escrever URIs, não há prefixos nem na entrada nem na saída. A notação <b>N3</b>, também suportada pelo Jena, possui nomes prefixados reduzidos, e grava-os na entrada e usa-os na saída.
<p>Jena possui outras operações sobre mapeamento de prefixos de um modelo, como um<code>Map</code> de Java extraído a partir dos mapeamentos existentes, ou a adição de um grupo inteiro de mapeamentos de uma só vez; olhe a documentação de <code>PrefixMapping</code> para mais detalhes.
<h2 id="ch-Jena-RDF-Packages">Pacotes Jena RDF</h2>
@@ -516,46 +497,41 @@ m2.write( System.out );
<h2 id="ch-Navigating-a-Model">Navegação em Modelos</h2>
<p>Até agora, este tutorial mostrou como criar, ler e escrever modelos RDF. Chegou o momento de mostrar como acessar as informações mantidas num modelo.</p>
<p> Dada a URI de um recurso, o objeto do recurso pode ser recuperado de um modelo usando o método <code>Model.getResource(String uri)</code>. Este método é definido para retornar um objeto Resource se ele existir no modelo, ou, caso contrário, criar um novo. Por exemplo, para recuperar o recurso Adam Smith do modelo lido a partir do arquivo no tutorial 5:</p>
-<pre>// retrieve the John Smith vcard resource from the model
-Resource vcard = model.getResource(johnSmithURI);
-</pre>
-<p>A interface Resource define numerosos métodos para acessar as propriedades de um recurso. O método <code>Resource.getProperty(Property p)</code> acessa uma propriedade do recurso. Este método não segue a convenção usual de Java de acesso já que o tipo do objeto retorna é <code>Statement,</code> e não <code>Property</code> como era de se esperar. Retornando toda a sentença permite à aplicação acessar o valor da propriedade usando um de seus métodos de acesso que retornam o objeto da s [...]
-<pre>// retrieve the value of the N property
-Resource name = (Resource) vcard.getProperty(VCARD.N)
- .getObject();
-</pre>
-<p>De modo geral, o objeto de uma sentença pode ser um recurso ou uma literal, então a aplicação, sabendo que o valor precisar ser um recurso, faz o cast do objeto retornado. Uma das coisas que Jena tenta fazer é fornecer tipos específicos de métodos, então a aplicação não tem que fazer cast, e checagem de tipos pode ser feita em tempo de compilação. O fragmento de código acima poderia ser mais convenientemente escrito assim:</p>
-<pre>// retrieve the value of the FN property
-Resource name = vcard.getProperty(VCARD.N)
- .getResource();</pre>
-<p>Similarmente, o valor literal de uma propriedade pode ser recuperado:</p>
-<pre>// retrieve the given name property
-String fullName = vcard.getProperty(VCARD.FN)
- .getString();</pre>
-<p>Neste exemplo, o recurso vcard possui somente as propriedades <code>vcard:FN</code> e <code>vcard:N</code>. RDF permite a um recurso repetir uma propriedade; por exemplo, Adam pode ter mais de um apelido. Vamos dar dois apelidos a ele:</p>
-<pre>// add two nickname properties to vcard
-vcard.addProperty(VCARD.NICKNAME, "Smithy")
- .addProperty(VCARD.NICKNAME, "Adman");</pre>
-<p>Como notado anteriormente, Jena representa um modelo RDF como um conjunto de sentenças, então, adicionar uma sentença com um sujeito, predicado e objeto igual a um já existente não terá efeito. Jena não define qual do dois apelidos será retornado. O resultado da chamada a <code>vcard.getProperty(VCARD.NICKNAME)</code> é indeterminado. Jena vai retornar um dos valores, mas não há garantia nem mesmo de que duas chamadas consecutivas irá retornar o mesmo valor.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// retrieve the John Smith vcard resource from the model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource vcard <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">(</span>johnSmithURI<span style="color:#666">);</span>
+</span></span></code></pre></div><p>A interface Resource define numerosos métodos para acessar as propriedades de um recurso. O método <code>Resource.getProperty(Property p)</code> acessa uma propriedade do recurso. Este método não segue a convenção usual de Java de acesso já que o tipo do objeto retorna é <code>Statement,</code> e não <code>Property</code> como era de se esperar. Retornando toda a sentença permite à aplicação acessar o valor da propriedade usando um de seus métodos de [...]
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// retrieve the value of the N property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource name <span style="color:#666">=</span> <span style="color:#666">(</span>Resource<span style="color:#666">)</span> vcard<span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">N</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getObject</span><span style="color:#666">();</span>
+</span></span></code></pre></div><p>De modo geral, o objeto de uma sentença pode ser um recurso ou uma literal, então a aplicação, sabendo que o valor precisar ser um recurso, faz o cast do objeto retornado. Uma das coisas que Jena tenta fazer é fornecer tipos específicos de métodos, então a aplicação não tem que fazer cast, e checagem de tipos pode ser feita em tempo de compilação. O fragmento de código acima poderia ser mais convenientemente escrito assim:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// retrieve the value of the N property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource name <span style="color:#666">=</span> vcard<span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">N</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getResource</span><span style="color:#666">();</span>
+</span></span></code></pre></div><p>Similarmente, o valor literal de uma propriedade pode ser recuperado:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java//" data-lang="java//"><span style="display:flex;"><span>String fullName <span style="color:#666">=</span> vcard<span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getString</span><span style="color:#666">();</span>
+</span></span></code></pre></div><p>Neste exemplo, o recurso vcard possui somente as propriedades <code>vcard:FN</code> e <code>vcard:N</code>. RDF permite a um recurso repetir uma propriedade; por exemplo, Adam pode ter mais de um apelido. Vamos dar dois apelidos a ele:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// add two nickname properties to vcard
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>vcard<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">NICKNAME</span><span style="color:#666">,</span> <span style="color:#b44">"Smithy"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">NICKNAME</span><span style="color:#666">,</span> <span style="color:#b44">"Adman"</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>Como notado anteriormente, Jena representa um modelo RDF como um conjunto de sentenças, então, adicionar uma sentença com um sujeito, predicado e objeto igual a um já existente não terá efeito. Jena não define qual do dois apelidos será retornado. O resultado da chamada a <code>vcard.getProperty(VCARD.NICKNAME)</code> é indeterminado. Jena vai retornar um dos valores, mas não há garantia nem mesmo de que duas chamadas consecutivas irá retornar o mesmo [...]
<p>Se for possível que uma propriedade ocorra mais de uma vez, então o método Resource.listProperties(Property p) pode ser usado para retornar um iterador para lista-las. Este método retorna um iterador que retorna objetos do tipo <code>Statement</code>. Nós podemos listar os apelidos assim:</p>
-<pre>// set up the output
-System.out.println("The nicknames of \""
- + fullName + "\" are:");
-// list the nicknames
-StmtIterator iter = vcard.listProperties(VCARD.NICKNAME);
-while (iter.hasNext()) {
- System.out.println(" " + iter.nextStatement()
- .getObject()
- .toString());
-}
-</pre>
-<p>Esse código pode ser encontrado em <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial06.java"> tutorial 6</a>. O iterador <code>iter</code> reproduz todas as sentenças com sujeito <code>vcard</code> e predicado <code>VCARD.NICKNAME</code>, então, iterar sobre ele permite recuperar cada sentença usando
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// set up the output
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"The nicknames of \""</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">+</span> fullName <span style="color:#666">+</span> <span style="color:#b44">"\" are:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// list the nicknames
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>StmtIterator iter <span style="color:#666">=</span> vcard<span style="color:#666">.</span><span style="color:#b44">listProperties</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">NICKNAME</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" "</span> <span style="color:#666">+</span> iter<span style="color:#666">.</span><span style="color:#b44">nextStatement</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getObject</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Esse código pode ser encontrado em <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial06.java"> tutorial 6</a>. O iterador <code>iter</code> reproduz todas as sentenças com sujeito <code>vcard</code> e predicado <code>VCARD.NICKNAME</code>, então, iterar sobre ele permite recuperar cada sentença usando
<code>nextStatement()</code>, pegar o campo do objeto, e convertê-lo para string. O código produz a seguinte saída quando executado:</p>
-<pre>The nicknames of "John Smith" are:
- Smithy
- Adman
-</pre>
-<p>Todas as propriedades de um recurso podem ser listadas usando o método
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>The nicknames of <span style="color:#b44">"John Smith"</span> are:
+</span></span><span style="display:flex;"><span> Smithy
+</span></span><span style="display:flex;"><span> Adman
+</span></span></code></pre></div><p>Todas as propriedades de um recurso podem ser listadas usando o método
<code>listProperties()</code> sem argumentos.
</p>
<h2 id="ch-Querying-a-Model">Consultas em Modelos</h2>
@@ -564,83 +540,77 @@ while (iter.hasNext()) {
<code>Model.listSubjects()</code> é similar, mas retorna um iterador sobre todos os recursos que possuem propriedades, <i>ie</i> são sujeitos de alguma sentença.</p>
<p><code>Model.listSubjectsWithProperty(Property p, RDFNode
o)</code><code></code> retornará um iterador sobre todos os recursos com propriedade <code>p</code> de valor <code>o</code>. Se nós assumirmos que somente recursos vcard terão a propriedade <code>vcard:FN</code> e que, em nossos dados, todos esses recursos têm essa propriedade, então podemos encontrar todos os vCards assim:</p>
- <pre>// list vcards
-ResIterator iter = model.listSubjectsWithProperty(VCARD.FN);
-while (iter.hasNext()) {
- Resource r = iter.nextResource();
- ...
-}</pre>
-<p>Todos esses métodos de consulta são açúcar sintático sobre o método primitivo de consulta <code>model.listStatements(Selector s)</code>. Esse método retorna um iterador sobre todas as sentenças no modelo 'selecionado' por <code>s</code>. A interface de selector foi feita para ser extensível, mas por hora, só há uma implementação dela, a classe <code>SimpleSelector</code> do pacote <code>org.apache.jena.rdf.model</code>. Usar <code>SimpleSelector </code> é uma das raras ocasiões em Je [...]
-<pre>Selector selector = new SimpleSelector(subject, predicate, object)</pre>
-<p>Esse selector vai selecionar todas as sentenças em que o sujeito casa com
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// list vcards
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>ResIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listSubjectsWithProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> Resource r <span style="color:#666">=</span> iter<span style="color:#666">.</span><span style="color:#b44">nextResource</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">...</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Todos esses métodos de consulta são açúcar sintático sobre o método primitivo de consulta <code>model.listStatements(Selector s)</code>. Esse método retorna um iterador sobre todas as sentenças no modelo 'selecionado' por <code>s</code>. A interface de selector foi feita para ser extensível, mas por hora, só há uma implementação dela, a classe <code>SimpleSelector</code> do pacote <code>org.apache.jena.rdf.model</code>. Usar <code>SimpleSelector </cod [...]
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span>subject<span style="color:#666">,</span> predicate<span style="color:#666">,</span> object<span style="color:#666">);</span>
+</span></span></code></pre></div><p>Esse selector vai selecionar todas as sentenças em que o sujeito casa com
<code>subject</code>, um predicado que casa com <code>predicate</code> e um objeto que casa com <code>object</code>. Se <code>null</code> é passado para algum dos argumentos, ele vai casar com qualquer coisa, caso contrário, ele vai casar com os recursos ou literais correspondentes. (Dois recursos são iguais se eles possuem o mesmo URI ou são o mesmo blank node; dois literais são iguais se todos os seus componentes forem iguais.) Assim:</p>
- <pre>Selector selector = new SimpleSelector(null, null, null);</pre>
-<p>vai selecionar todas as sentenças do modelo.</p>
- <pre>Selector selector = new SimpleSelector(null, VCARD.FN, null);</pre>
-<p>vai selecionar todas as sentenças com o predicado VCARD.FN, independente do sujeito ou objeto. Como um atalho especial,
-<p><code>listStatements( S, P, O )
-</code></p>
-<p>é equivalente a</p>
-<p><code>listStatements( new SimpleSelector( S, P, O ) )
-</code></p>
-<p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span [...]
+</span></span></code></pre></div><p>vai selecionar todas as sentenças do modelo.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>Selector selector <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> VCARD<span style="color:#666">.</span><span style="color:# [...]
+</span></span></code></pre></div><p>vai selecionar todas as sentenças com o predicado VCARD.FN, independente do sujeito ou objeto. Como um atalho especial,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>listStatements<span style="color:#666">(</span> S<span style="color:#666">,</span> P<span style="color:#666">,</span> O <span style="color:#666">)</span>
+</span></span></code></pre></div><p>é equivalente a</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>listStatements<span style="color:#666">(</span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span> S<span style="color:#666">,</span> P<span style="color:#666">,</span> O <span style="color:#666">)</span> <span style="color:#666">)</span>
+</span></span></code></pre></div><p>
O código a seguir, que pode ser encontrado em <a
href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial07.java">tutorial 7</a> que lista os nomes completos de todos os vcards do banco de dados.</p>
-<pre>// select all the resources with a VCARD.FN property
-ResIterator iter = model.listSubjectsWithProperty(VCARD.FN);
-if (iter.hasNext()) {
- System.out.println("The database contains vcards for:");
- while (iter.hasNext()) {
- System.out.println(" " + iter.nextResource()
- .getProperty(VCARD.FN)
- .getString());
- }
-} else {
- System.out.println("No vcards were found in the database");
-}
-</pre>
-<p>Isso deve produzir uma saída similar a:</p>
-<pre>The database contains vcards for:
- Sarah Jones
- John Smith
- Matt Jones
- Becky Smith
-</pre>
-<p>Seu próximo exercício é modificar o código para usar <code>SimpleSelector
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// select all the resources with a VCARD.FN property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>ResIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listSubjectsWithProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"The database contains vcards for:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" "</span> <span style="color:#666">+</span> iter<span style="color:#666">.</span><span style="color:#b44">nextResource</span><span style="color:#666">()</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getString</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"No vcards were found in the database"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Isso deve produzir uma saída similar a:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>The database contains vcards <span style="color:#a2f;font-weight:bold">for</span>:
+</span></span><span style="display:flex;"><span> Sarah Jones
+</span></span><span style="display:flex;"><span> John Smith
+</span></span><span style="display:flex;"><span> Matt Jones
+</span></span><span style="display:flex;"><span> Becky Smith
+</span></span></code></pre></div><p>Seu próximo exercício é modificar o código para usar <code>SimpleSelector
</code>em vez de <code>listSubjectsWithProperty</code>.</p>
<p>Vamos ver como implementar um controle mais refinado sobre as sentenças selecionadas.
<code>SimpleSelector</code> pode ser herdado ter seus selects modificado para mais filtragens:</p>
- <pre>// select all the resources with a VCARD.FN property
-// whose value ends with "Smith"
-StmtIterator iter = model.listStatements(
- new SimpleSelector(null, VCARD.FN, (RDFNode) null) {
- public boolean selects(Statement s)
- {return s.getString().endsWith("Smith");}
- });</pre>
-<p>Esse código usa uma técnica elegante de Java para sobrescrever a definição de um método quando criamos uma instância da classe. Aqui, o método <code>selects(...)</code> garante que o nome completo termine com “Smith”. É importante notar que a filtragem baseada nos argumentos sujeito, predicado e objeto tem lugar antes que o método <code>selects(...)</code> seja chamado, então esse teste extra só será aplicado para casar sentenças.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// select all the resources with a VCARD.FN property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// whose value ends with "Smith"
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>StmtIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">,</span> <span style="color:#666">(</span>RDFNode<span style="color:#666">)</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:# [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">boolean</span> <span style="color:#00a000">selects</span><span style="color:#666">(</span>Statement s<span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">{</span><span style="color:#a2f;font-weight:bold">return</span> s<span style="color:#666">.</span><span style="color:#b44">getString</span><span style="color:#666">().</span><span style="color:#b44">endsWith</span><span style="color:#666">(</span><span style="color:#b44">"Smith"</span><span style="color:#666">);}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">});</span>
+</span></span></code></pre></div><p>Esse código usa uma técnica elegante de Java para sobrescrever a definição de um método quando criamos uma instância da classe. Aqui, o método <code>selects(...)</code> garante que o nome completo termine com “Smith”. É importante notar que a filtragem baseada nos argumentos sujeito, predicado e objeto tem lugar antes que o método <code>selects(...)</code> seja chamado, então esse teste extra só será aplicado para casar sentenças.</p>
<p>O código completo pode ser encontrado no <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial08.java">tutorial
8</a> e produz uma saída igual a:</p>
- <pre>The database contains vcards for:
- John Smith
- Becky Smith</pre>
-<p></p>
-<p>Você pode imaginar que:</p>
-<pre>// do all filtering in the selects method
-StmtIterator iter = model.listStatements(
- new
- SimpleSelector(null, null, (RDFNode) null) {
- public boolean selects(Statement s) {
- return (subject == null || s.getSubject().equals(subject))
- && (predicate == null || s.getPredicate().equals(predicate))
- && (object == null || s.getObject().equals(object))
- }
- }
- });
-</pre>
-<p>é equivalente a:</p>
- <pre>StmtIterator iter =
- model.listStatements(new SimpleSelector(subject, predicate, object)</pre>
-<p>Embora possam ser funcionalmente equivalentes, a primeira forma vai listar todas as sentenças do modelo e testar cada uma individualmente, a segunda forma permite índices mantidos pela implementação para melhor a perfomance. Tente isso em modelos grandes e veja você mesmo, mas prepare uma chícara de café antes.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>The database contains vcards <span style="color:#a2f;font-weight:bold">for</span>:
+</span></span><span style="display:flex;"><span> John Smith
+</span></span><span style="display:flex;"><span> Becky Smith
+</span></span></code></pre></div><p>Você pode imaginar que:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// do all filtering in the selects method
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>StmtIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">new</span>
+</span></span><span style="display:flex;"><span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> <span style="color:#666">(</span>RDFNode<span style="color:#666">)</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">boolean</span> <span style="color:#00a000">selects</span><span style="color:#666">(</span>Statement s<span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">return</span> <span style="color:#666">(</span>subject <span style="color:#666">==</span> <span style="color:#a2f;font-weight:bold">null</span> <span style="color:#666">||</span> s<span style="color:#666">.</span><span style="color:#b44">getSubject</span><span style="color:#666">().</span><span style="color:#b44">equals</span><span style="color:#666">(</span>subject<span style="color [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">&</span>amp<span style="color:#666">;&</span>amp<span style="color:#666">;</span> <span style="color:#666">(</span>predicate <span style="color:#666">==</span> <span style="color:#a2f;font-weight:bold">null</span> <span style="color:#666">||</span> s<span style="color:#666">.</span><span style="color:#b44">getPredicate</span><span style="color:#666">().</span><span style="color:#b44">equals [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">&</span>amp<span style="color:#666">;&</span>amp<span style="color:#666">;</span> <span style="color:#666">(</span>object <span style="color:#666">==</span> <span style="color:#a2f;font-weight:bold">null</span> <span style="color:#666">||</span> s<span style="color:#666">.</span><span style="color:#b44">getObject</span><span style="color:#666">().</span><span style="color:#b44">equals</s [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">});</span>
+</span></span></code></pre></div><p>é equivalente a:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span>StmtIterator iter <span style="color:#666">=</span>
+</span></span><span style="display:flex;"><span> model<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span>subject<span style="color:#666">,</span> predicate<span style="color:#666">,</span> object<span style="color:#666">)</span>
+</span></span></code></pre></div><p>Embora possam ser funcionalmente equivalentes, a primeira forma vai listar todas as sentenças do modelo e testar cada uma individualmente, a segunda forma permite índices mantidos pela implementação para melhor a perfomance. Tente isso em modelos grandes e veja você mesmo, mas prepare uma chícara de café antes.</p>
<h2 id="ch-Operations-on-Models">Operações em Modelos</h2>
<p>Jena provê três operações para manipular modelos. Elas são operações comuns de conjunto: união, intersecção e diferença.</p>
<p>A união de dois modelos é a união do conjunto de sentenças que representa cada modelo. Esta é uma das operações chaves que RDF suporta. Isso permite que fontes de dados discrepantes sejam juntadas. Considere o seguintes modelos:</p>
@@ -652,34 +622,33 @@ StmtIterator iter = model.listStatements(
<img alt="figure 6" src="figures/fig6.png" width="540" height="240"></p>
<p>Vamos ver o código (o código completo está em <a
href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial09.java">tutorial 9</a>) e ver o que acontece.</p>
-<pre>// read the RDF/XML files
-model1.read(new InputStreamReader(in1), "");
-model2.read(new InputStreamReader(in2), "");
-
-// merge the Models
-Model model = model1.union(model2);
-
-// print the Model as RDF/XML
-model.write(system.out, "RDF/XML-ABBREV");</pre>
-<p>A saída produzida pelo PrettyWriter se assemelha a:</p>
-<pre><rdf:RDF
- xmlns:rdf="<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>"
- xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
- <rdf:Description rdf:about="http://somewhere/JohnSmith/">
- <vcard:EMAIL>
- <vcard:internet>
- <rdf:value>John@somewhere.com</rdf:value>
- </vcard:internet>
- </vcard:EMAIL>
- <vcard:N rdf:parseType="Resource">
- <vcard:Given>John</vcard:Given>
- <vcard:Family>Smith</vcard:Family>
- </vcard:N>
- <vcard:FN>John Smith</vcard:FN>
- </rdf:Description>
-</rdf:RDF>
-</pre>
-<p>Mesmo que você não seja familiarizado com os detalhes da sintaxe RDF/XML, deve ser relativamente claro que os modelos foram unidos como esperado A interseção e a diferença de modelos podem ser computados de maneira semelhante, usando os métodos <code>.intersection(Model)</code> e
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// read the RDF/XML files
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model1<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> InputStreamReader<span style="color:#666">(</span>in1<span style="color:#666">),</span> <span style="color:#b44">""</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>model2<span style="color:#666">.</span><span style="color:#b44">read</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> InputStreamReader<span style="color:#666">(</span>in2<span style="color:#666">),</span> <span style="color:#b44">""</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// merge the Models
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Model model <span style="color:#666">=</span> model1<span style="color:#666">.</span><span style="color:#b44">union</span><span style="color:#666">(</span>model2<span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// print the Model as RDF/XML
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>system<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> <span style="color:#b44">"RDF/XML-ABBREV"</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>A saída produzida pelo PrettyWriter se assemelha a:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">"<a href="</span><span style="">http://www.w3.org/1999/02/22-rdf-syntax-ns#"</span><span style="color:#008000;font-weight:bold">></span>http://www.w3.org/1999/02/22-rdf-syntax-ns#<span style="color:#008000;font-weight:bold"></a></span>"
+</span></span><span style="display:flex;"><span> xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:about=</span><span style="color:#b44">"http://somewhere/JohnSmith/"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:EMAIL></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:internet></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:value></span>John@somewhere.com<span style="color:#008000;font-weight:bold"></rdf:value></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></vcard:internet></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></vcard:EMAIL></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:N</span> <span style="color:#b44">rdf:parseType=</span><span style="color:#b44">"Resource"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Given></span>John<span style="color:#008000;font-weight:bold"></vcard:Given></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:Family></span>Smith<span style="color:#008000;font-weight:bold"></vcard:Family></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></vcard:N></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><vcard:FN></span>John Smith<span style="color:#008000;font-weight:bold"></vcard:FN></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>Mesmo que você não seja familiarizado com os detalhes da sintaxe RDF/XML, deve ser relativamente claro que os modelos foram unidos como esperado A interseção e a diferença de modelos podem ser computados de maneira semelhante, usando os métodos <code>.intersection(Model)</code> e
<code>.difference(Model)</code>; veja a documentação de
<a href="/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#difference(org.apache.jena.rdf.model.Model)">difference</a>
e
@@ -701,97 +670,94 @@ para mais detalhes.
<p align="left">ALTs representam alternativas. Por exemplo, vamos supor um recurso representando um software. Ele poderia ter uma propriedade indicando onde ele foi obtido. O valor dessa propriedade pode ser uma coleção ALT contendo vários sites de onde ele poderia ser baixado. ALTs são desordenados a menos que a propriedade rdf:_1 tenha significado especial. Ela representa a escolha padrão.</p>
<p align="left">Embora os containers sejam manipulados como recursos e propriedades, Jena têm interfaces e implementações de classes explicitas para manipulá-los. Não é uma boa ideia ter um objeto manipulando um container e ao mesmo tempo modificando o estado do container usando métodos de mais baixo nível.</p>
<p align="left">Vamos modificar o tutorial 8 para criar essa bag:</p>
-<pre>// create a bag
-Bag smiths = model.createBag();
-
-// select all the resources with a VCARD.FN property
-// whose value ends with "Smith"
-StmtIterator iter = model.listStatements(
- new SimpleSelector(null, VCARD.FN, (RDFNode) null) {
- public boolean selects(Statement s) {
- return s.getString().endsWith("Smith");
- }
- });
-// add the Smith's to the bag
-while (iter.hasNext()) {
- smiths.add(iter.nextStatement().getSubject());
-}
-</pre>
-<p>Se nós imprimirmos esse modelo, vamos obter algo do tipo:</p>
- <pre><rdf:RDF
- xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
- xmlns:vcard='http://www.w3.org/2001/vcard-rdf/3.0#'
- >
-...
- <rdf:Description rdf:nodeID="A3">
- <rdf:type rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
- <rdf:_1 rdf:resource='http://somewhere/JohnSmith/'/>
- <rdf:_2 rdf:resource='http://somewhere/RebeccaSmith/'/>
- </rdf:Description>
-</rdf:RDF></pre>
-<p>que representa o recurso Bag.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create a bag
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Bag smiths <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">createBag</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// select all the resources with a VCARD.FN property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// whose value ends with "Smith"
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>StmtIterator iter <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">listStatements</span><span style="color:#666">(</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">new</span> SimpleSelector<span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">,</span> VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">,</span> <span style="color:#666">(</span>RDFNode<span style="color:#666">)</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:# [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">boolean</span> <span style="color:#00a000">selects</span><span style="color:#666">(</span>Statement s<span style="color:#666">)</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">return</span> s<span style="color:#666">.</span><span style="color:#b44">getString</span><span style="color:#666">().</span><span style="color:#b44">endsWith</span><span style="color:#666">(</span><span style="color:#b44">"Smith"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">});</span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// add the Smith's to the bag
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span><span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> smiths<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span>iter<span style="color:#666">.</span><span style="color:#b44">nextStatement</span><span style="color:#666">().</span><span style="color:#b44">getSubject</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>Se nós imprimirmos esse modelo, vamos obter algo do tipo:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">'http://www.w3.org/1999/02/22-rdf-syntax-ns#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:vcard=</span><span style="color:#b44">'http://www.w3.org/2001/vcard-rdf/3.0#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span>...
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A3"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:type</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">'http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:_1</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">'http://somewhere/JohnSmith/'</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:_2</span> <span style="color:#b44">rdf:resource=</span><span style="color:#b44">'http://somewhere/RebeccaSmith/'</span><span style="color:#008000;font-weight:bold">/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>que representa o recurso Bag.</p>
<p>A interface do container fornece um iterador para listar o conteúdo do container:</p>
-<pre>// print out the members of the bag
-NodeIterator iter2 = smiths.iterator();
-if (iter2.hasNext()) {
- System.out.println("The bag contains:");
- while (iter2.hasNext()) {
- System.out.println(" " +
- ((Resource) iter2.next())
- .getProperty(VCARD.FN)
- .getString());
- }
-} else {
- System.out.println("The bag is empty");
-}
-</pre>
-<p>que produz a seguinte saída:</p>
-<pre>The bag contains:
- John Smith
- Becky Smith</pre>
-<p>O código executável pode ser encontrado em <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial10.java">
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// print out the members of the bag
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>NodeIterator iter2 <span style="color:#666">=</span> smiths<span style="color:#666">.</span><span style="color:#b44">iterator</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>iter2<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"The bag contains:"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">while</span> <span style="color:#666">(</span>iter2<span style="color:#666">.</span><span style="color:#b44">hasNext</span><span style="color:#666">())</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">" "</span> <span style="color:#666">+</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">((</span>Resource<span style="color:#666">)</span> iter2<span style="color:#666">.</span><span style="color:#b44">next</span><span style="color:#666">())</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getProperty</span><span style="color:#666">(</span>VCARD<span style="color:#666">.</span><span style="color:#b44">FN</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">getString</span><span style="color:#666">());</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">}</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+</span></span><span style="display:flex;"><span> System<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">.</span><span style="color:#b44">println</span><span style="color:#666">(</span><span style="color:#b44">"The bag is empty"</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span><span style="color:#666">}</span>
+</span></span></code></pre></div><p>que produz a seguinte saída:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>The bag contains:
+</span></span><span style="display:flex;"><span> John Smith
+</span></span><span style="display:flex;"><span> Becky Smith
+</span></span></code></pre></div><p>O código executável pode ser encontrado em <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial10.java">
tutorial 10</a>, que coloca esses fragmentos de código juntos num exemplo completo.</p>
<p>As classes de Jena oferecem métodos para manipular containers, incluindo adição de novos membros, inserção de novos membros no meio de um container e a remoção de membros existentes. As classes de container Jena atualmente garantem que a lista ordenada de propriedades usadas começam com rdf:_1 e é contíguo. O RDFCore WG relaxou essa regra, permitindo uma representação parcial dos containers. Isso, portanto, é uma área de Jena que pode ser mudada no futuro.</p>
<h2 id="ch-More-about-Literals-and-Datatypes">Mais sobre Literais e Datatypes</h2>
<p>Literais RDF não são apenas strings. Literais devem ter uma tag para indicar a linguagem da literal. O diálogo de uma literal em Inglês é considerado diferente de um diálogo de uma literal em Francês. Esse comportamento estranho é um artefato da sintaxe RDF/XML original.</p>
<p>Há na realidade dois tipos de Literais. Em uma delas, o componente string é somente isso, uma string ordinária. Na outra, o componente string é esperado que fosse um bem balanceado fragmento de XML. Quando um modelo RDF é escrito como RDF/XML, uma construção especial usando um atributo parseType='Literal' é usado para representar isso.</p>
<p>Em Jena, esses atributos de uma literal podem ser setados quando a literal é construída, e.g. no <a href="https://github.com/apache/jena/tree/main/jena-core/src-examples/jena/examples/rdf/Tutorial11.java">tutorial 11</a>:</p>
-<pre>// create the resource
-Resource r = model.createResource();
-
-// add the property
-r.addProperty(RDFS.label, model.createLiteral("chat", "en"))
- .addProperty(RDFS.label, model.createLiteral("chat", "fr"))
- .addProperty(RDFS.label, model.createLiteral("<em>chat</em>", true));
-
-// write out the Model
-model.write(system.out);</pre>
-<p>produz</p>
-<pre><rdf:RDF
- xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
- xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#'
- >
- <rdf:Description rdf:nodeID="A0">
- <rdfs:label xml:lang='en'>chat</rdfs:label>
- <rdfs:label xml:lang='fr'>chat</rdfs:label>
- <rdfs:label rdf:parseType='Literal'><em>chat</em></rdfs:label>
- </rdf:Description>
-</rdf:RDF></pre>
-<p>Para que duas literais sejam consideradas iguais, elas devem ser ambas literais XML ou ambas literais simples. Em adição a isso, ambas não devem possuir tag de linguagem, ou se as tags de linguagem estiverem presentes, elas devem ser iguais. Para simples literais strings, elas devem ser iguais. Literais XML têm duas noções de igualdade. A noção simples é que as condições anteriores são verdade e as strings também são iguais. A outra noção é de que elas podem ser iguais se a canonizaçã [...]
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create the resource
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource r <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// add the property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>r<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>RDFS<span style="color:#666">.</span><span style="color:#b44">label</span><span style="color:#666">,</span> model<span style="color:#666">.</span><span style="color:#b44">createLiteral</span><span style="color:#666">(</span><span style="color:#b44">"chat"</span><span s [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>RDFS<span style="color:#666">.</span><span style="color:#b44">label</span><span style="color:#666">,</span> model<span style="color:#666">.</span><span style="color:#b44">createLiteral</span><span style="color:#666">(</span><span style="color:#b44">"chat"</span><span style="color:#666">,</span> <span style="color:#b44">" [...]
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>RDFS<span style="color:#666">.</span><span style="color:#b44">label</span><span style="color:#666">,</span> model<span style="color:#666">.</span><span style="color:#b44">createLiteral</span><span style="color:#666">(</span><span style="color:#b44">"&lt;em&gt;chat&lt;/em&gt;"</span><span style="color:#666">,< [...]
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// write out the Model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>system<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>produz</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"><rdf:RDF</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdf=</span><span style="color:#b44">'http://www.w3.org/1999/02/22-rdf-syntax-ns#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#b44">xmlns:rdfs=</span><span style="color:#b44">'http://www.w3.org/2000/01/rdf-schema#'</span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdf:Description</span> <span style="color:#b44">rdf:nodeID=</span><span style="color:#b44">"A0"</span><span style="color:#008000;font-weight:bold">></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:label</span> <span style="color:#b44">xml:lang=</span><span style="color:#b44">'en'</span><span style="color:#008000;font-weight:bold">></span>chat<span style="color:#008000;font-weight:bold"></rdfs:label></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:label</span> <span style="color:#b44">xml:lang=</span><span style="color:#b44">'fr'</span><span style="color:#008000;font-weight:bold">></span>chat<span style="color:#008000;font-weight:bold"></rdfs:label></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"><rdfs:label</span> <span style="color:#b44">rdf:parseType=</span><span style="color:#b44">'Literal'</span><span style="color:#008000;font-weight:bold">><em></span>chat<span style="color:#008000;font-weight:bold"></em></rdfs:label></span>
+</span></span><span style="display:flex;"><span> <span style="color:#008000;font-weight:bold"></rdf:Description></span>
+</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
+</span></span></code></pre></div><p>Para que duas literais sejam consideradas iguais, elas devem ser ambas literais XML ou ambas literais simples. Em adição a isso, ambas não devem possuir tag de linguagem, ou se as tags de linguagem estiverem presentes, elas devem ser iguais. Para simples literais strings, elas devem ser iguais. Literais XML têm duas noções de igualdade. A noção simples é que as condições anteriores são verdade e as strings também são iguais. A outra noção é de que elas [...]
<p>As interfaces de Jena também suportam literais tipadas. A maneira antiga (mostrada abaixo) trata literais tipadas como atalhos para strings: valores tipados são convertidos por Java em strings, e essas strings são armazenadas no modelo. Por exemplo, tente (observando que para literais simples, nós podemos omitir a chamada code>model.createLiteral</code>(...)):</p>
-<pre>// create the resource
-Resource r = model.createResource();
-
-// add the property
-r.addProperty(RDFS.label, "11")
- .addProperty(RDFS.label, 11);
-
-// write out the Model
-model.write(system.out, "N-TRIPLE");
-</pre>
-<p>A saída produzida é:</p>
- <pre>_:A... <http://www.w3.org/2000/01/rdf-schema#label> "11" .</pre>
-<p>Já que ambas as literais são apenas a string “’11”, então somente uma sentença é adicionada</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#080;font-style:italic">// create the resource
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>Resource r <span style="color:#666">=</span> model<span style="color:#666">.</span><span style="color:#b44">createResource</span><span style="color:#666">();</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// add the property
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>r<span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>RDFS<span style="color:#666">.</span><span style="color:#b44">label</span><span style="color:#666">,</span> <span style="color:#b44">"11"</span><span style="color:#666">)</span>
+</span></span><span style="display:flex;"><span> <span style="color:#666">.</span><span style="color:#b44">addProperty</span><span style="color:#666">(</span>RDFS<span style="color:#666">.</span><span style="color:#b44">label</span><span style="color:#666">,</span> <span style="color:#666">11</span><span style="color:#666">);</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic">// write out the Model
+</span></span></span><span style="display:flex;"><span><span style="color:#080;font-style:italic"></span>model<span style="color:#666">.</span><span style="color:#b44">write</span><span style="color:#666">(</span>system<span style="color:#666">.</span><span style="color:#b44">out</span><span style="color:#666">,</span> <span style="color:#b44">"N-TRIPLE"</span><span style="color:#666">);</span>
+</span></span></code></pre></div><p>A saída produzida é:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>_:A... <http://www.w3.org/2000/01/rdf-schema#label> <span style="color:#b44">"11"</span> .
+</span></span></code></pre></div><p>Já que ambas as literais são apenas a string “’11”, então somente uma sentença é adicionada</p>
<p>O RDFCore WG definiu mecanismos para suportar datatypes em RDF. Jena os suporta usando mecanismos de <i>literais tipadas</i>; isso não é discutido neste tutorial.</p>
<h2 id="ch-Glossary">Glossário</h2>
<dl>
diff --git a/content/tutorials/sparql.html b/content/tutorials/sparql.html
index f59f5f681..7de9f4539 100644
--- a/content/tutorials/sparql.html
+++ b/content/tutorials/sparql.html
@@ -187,12 +187,12 @@ language through examples but does not aim to be complete.</p>
<a href="https://www.w3.org/TR/sparql11-query/">query language</a> and a
<a href="https://www.w3.org/TR/rdf-sparql-protocol/">protocol</a> for accessing
RDF designed by the
-<a href="https://www.w3.org/2001/sw/DataAccess/">W3C RDF Data Access Working Group</a>. </p>
+<a href="https://www.w3.org/2001/sw/DataAccess/">W3C RDF Data Access Working Group</a>.</p>
<p>As a query language, SPARQL is “data-oriented” in that it only
queries the information held in the models; there is no inference
-in the query language itself. Of course, the Jena model may be
+in the query language itself. Of course, the Jena model may be
‘smart’ in that it provides the impression that certain triples
-exist by creating them on-demand, including OWL reasoning. SPARQL
+exist by creating them on-demand, including OWL reasoning. SPARQL
does not do anything other than take the description of what the
application wants, in the form of a query, and returns that
information, in the form of a set of bindings or an RDF graph.</p>
diff --git a/content/tutorials/sparql_basic_patterns.html b/content/tutorials/sparql_basic_patterns.html
index 9f1a543bb..7632bf027 100644
--- a/content/tutorials/sparql_basic_patterns.html
+++ b/content/tutorials/sparql_basic_patterns.html
@@ -194,21 +194,19 @@ the pattern matched - which values the variables must take for a
pattern to match.</p>
<p>The first query example had a single solution. Change the pattern
to this second query: (<a href="sparql_data/q-bp1.rq">q-bp1.rq</a>):</p>
-<pre><code>SELECT ?x ?fname
-WHERE {?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> ?fname}
-</code></pre>
-<p>This has 4 solutions, one for each VCARD name property triples in
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?x</span> <span style="color:#b8860b">?fname</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span> {<span style="color:#b8860b">?x</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#FN></span> <span style="color:#b8860b">?fname</span>}
+</span></span></code></pre></div><p>This has 4 solutions, one for each VCARD name property triples in
the data source</p>
-<pre><code>----------------------------------------------------
-| x | fname |
-====================================================
-| <http://somewhere/RebeccaSmith/> | "Becky Smith" |
-| <http://somewhere/SarahJones/> | "Sarah Jones" |
-| <http://somewhere/JohnSmith/> | "John Smith" |
-| <http://somewhere/MattJones/> | "Matt Jones" |
-----------------------------------------------------
-</code></pre>
-<p>So far, with triple patterns and basic patterns, every variable
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">----------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">x</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">fname</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">====================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">----------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>So far, with triple patterns and basic patterns, every variable
will be defined in every solution. The solutions to a query can be
thought of a table, but in the general case, it is a table where
not every row will have a value for every column. All the solutions
@@ -218,37 +216,34 @@ variables in every solution as we shall see later.</p>
<p>A basic pattern is a set of triple patterns. It matches when the
triple patterns all match with the same value used each time the
variable with the same name is used.</p>
-<pre><code>SELECT ?givenName
-WHERE
- { ?y <http://www.w3.org/2001/vcard-rdf/3.0#Family> "Smith" .
- ?y <http://www.w3.org/2001/vcard-rdf/3.0#Given> ?givenName .
- }
-</code></pre>
-<p>This query (<a href="sparql_data/q-bp2.rq">q-bp2.rq</a>) involves two triple patterns, each
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#Family></span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#Given></span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>This query (<a href="sparql_data/q-bp2.rq">q-bp2.rq</a>) involves two triple patterns, each
triple ends in a ‘.’ (but the dot after the last one can be omitted
like it was in the one triple pattern example). The variable y has
to be the same for each triple pattern match. The solutions
are:</p>
-<pre><code>-------------
-| givenName |
-=============
-| "John" |
-| "Rebecca" |
--------------
-</code></pre>
-<h3 id="qnames">QNames</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">givenName</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="qnames">QNames</h3>
<p>There is shorthand mechanism for writing long URIs using prefixes.
The query above is more clearly written as the query
(<a href="sparql_data/q-bp3.rq">q-bp3.rq</a>):</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?givenName
-WHERE
- { ?y vcard:Family "Smith" .
- ?y vcard:Given ?givenName .
- }
-</code></pre>
-<p>This is a prefixing mechanism - the two parts of the URIs, from the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>This is a prefixing mechanism - the two parts of the URIs, from the
prefix declaration and from the part after the “:” in the qname,
are concatenated together. This is strictly not what an XML qname
is but uses the RDF rule for turning a qname into a URI by
@@ -256,25 +251,23 @@ concatenating the parts.</p>
<h3 id="blank-nodes">Blank Nodes</h3>
<p>Change the query just a little to return y as well
(<a href="sparql_data/q-bp4.rq">q-bp4.rq</a>) :</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?y ?givenName
-WHERE
- { ?y vcard:Family "Smith" .
- ?y vcard:Given ?givenName .
- }
-</code></pre>
-<p>and the blank nodes appear</p>
-<pre><code>--------------------
-| y | givenName |
-====================
-| _:b0 | "John" |
-| _:b1 | "Rebecca" |
---------------------
-</code></pre>
-<p>as odd looking qnames starting _:. This isn’t the internal label
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?y</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>and the blank nodes appear</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">--------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">y</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">givenName</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">====================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">--------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>as odd looking qnames starting <code>_:</code>. This isn’t the internal label
for the blank node - it is ARQ printing them out that assigned the
-_:b0, _:b1 to show when two blank nodes are the same. Here they
+<code>_:b0</code>, <code>_:b1</code> to show when two blank nodes are the same. Here they
are different. It does not reveal the internal label used for the
blank node although that is available when using the Java API.</p>
<p><a href="sparql_filters.html">Next: Filters</a></p>
diff --git a/content/tutorials/sparql_basic_patterns_pt.html b/content/tutorials/sparql_basic_patterns_pt.html
index c52df4ff1..afa0904e8 100644
--- a/content/tutorials/sparql_basic_patterns_pt.html
+++ b/content/tutorials/sparql_basic_patterns_pt.html
@@ -187,68 +187,61 @@
<h2 id="soluções">Soluções</h2>
<p>Soluções são um conjunto de pares de variáveis com um valor. Uma consulta <code>SELECT</code> expõe diretamente as soluções (depois de ordenar/limitar/deslocar) como o conjunto resultado – outras formas de consulta usam as soluções para fazer um grafo. Solução é a maneira como o padrão é casado – em que os valores das variáveis são utilizados para casar com o padrão.</p>
<p>A primeira consulta de exemplo teve uma solução simples. Mude o padrão para esta segunda consulta: (<a href="sparql_data/q-bp1.rq">q-bp1.rq</a>):</p>
-<pre><code>SELECT ?x ?fname
-WHERE {?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> ?fname}
-</code></pre>
-<p>Isso tem quatro soluções, uma pra cada propriedade nome de VCARD das triplas na fonte de dados.</p>
-<pre><code>----------------------------------------------------
-| x | name |
-====================================================
-| <http://somewhere/RebeccaSmith/> | "Becky Smith" |
-| <http://somewhere/SarahJones/> | "Sarah Jones" |
-| <http://somewhere/JohnSmith/> | "John Smith" |
-| <http://somewhere/MattJones/> | "Matt Jones" |
-----------------------------------------------------
-</code></pre>
-<p>Até agora, com padrões de triplas e padrões básicos, cada variável será definida em cada solução. As soluções de uma consulta podem ser pensadas como uma tabela, mas no caso geral, é uma tabela onde nem sempre cada linha vai ter um valor para cada coluna. Todas as soluções para uma consulta SPARQL não têm que ter valores para todas as variáveis em todas as soluções como veremos depois.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?x</span> <span style="color:#b8860b">?fname</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span> {<span style="color:#b8860b">?x</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#FN></span> <span style="color:#b8860b">?fname</span>}
+</span></span></code></pre></div><p>Isso tem quatro soluções, uma pra cada propriedade nome de VCARD das triplas na fonte de dados.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">----------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">x</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">====================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">----------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Até agora, com padrões de triplas e padrões básicos, cada variável será definida em cada solução. As soluções de uma consulta podem ser pensadas como uma tabela, mas no caso geral, é uma tabela onde nem sempre cada linha vai ter um valor para cada coluna. Todas as soluções para uma consulta SPARQL não têm que ter valores para todas as variáveis em todas as soluções como veremos depois.</p>
<h2 id="padrões-básicos">Padrões Básicos</h2>
<p>Um padrão básico é um conjunto de padrões de triplas. Ele casa quando todo o padrão da tripla casa com o mesmo valor usado cada vez que a variável com o mesmo nome é usada.</p>
-<pre><code>SELECT ?givenName
-WHERE
- { ?y <http://www.w3.org/2001/vcard-rdf/3.0#Family> "Smith" .
- ?y <http://www.w3.org/2001/vcard-rdf/3.0#Given> ?givenName .
- }
-</code></pre>
-<p>Essa consulta (<a href="sparql_data/q-bp2.rq">q-bp2.rq</a>)envolve dois padrões de triplas, cada tripla termina com ‘.’ (mas o ponto depois do último pode ser omitido como foi omitido no exemplo de padrão de uma tripla). A variável y tem que ser a mesma para cada casamento de padrão de tripla. As soluções são:</p>
-<pre><code>-------------
-| givenName |
-=============
-| "John" |
-| "Rebecca" |
--------------
-</code></pre>
-<h3 id="qnames">QNames</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#Family></span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#Given></span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>Essa consulta (<a href="sparql_data/q-bp2.rq">q-bp2.rq</a>)envolve dois padrões de triplas, cada tripla termina com ‘.’ (mas o ponto depois do último pode ser omitido como foi omitido no exemplo de padrão de uma tripla). A variável y tem que ser a mesma para cada casamento de padrão de tripla. As soluções são:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">givenName</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="qnames">QNames</h3>
<p>Aqui temos um mecanismo prático para escrever longas URIs usando prefixos. A consulta acima poderia ser escrita mais claramente como a consulta:
(<a href="sparql_data/q-bp3.rq">q-bp3.rq</a>):</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?givenName
-WHERE
- { ?y vcard:Family "Smith" .
- ?y vcard:Given ?givenName .
- }
-</code></pre>
-<p>Isso é um mecanismo de prefixagem – as duas partes do URI, da declaração do prefixo e da parte depois de “:” no qname são concatenadas. Isso não é exatamente como um qname XML é, mas usa as regras de RDF para transformar o qname numa URI concatenando as partes.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>Isso é um mecanismo de prefixagem – as duas partes do URI, da declaração do prefixo e da parte depois de “:” no qname são concatenadas. Isso não é exatamente como um qname XML é, mas usa as regras de RDF para transformar o qname numa URI concatenando as partes.</p>
<h3 id="blank-nodes">Blank Nodes</h3>
<p>Mude a consulta só para retornar y da seguinte forma:
(<a href="sparql_data/q-bp4.rq">q-bp4.rq</a>) :</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?y ?givenName
-WHERE
- { ?y vcard:Family "Smith" .
- ?y vcard:Given ?givenName .
- }
-</code></pre>
-<p>e os blank nodes aparecem</p>
-<pre><code>--------------------
-| y | givenName |
-====================
-| _:b0 | "John" |
-| _:b1 | "Rebecca" |
---------------------
-</code></pre>
-<p>como os estranhos qnames iniciados com _:. Isso não é o título interno do blank node – isso é o ARQ imprimindo-os, atribuindo _:b0, _:b1 para mostrar quando dois blank nodes são o mesmo. Aqui eles são diferentes. Isso não revela o título interno usado para um blank node, mas isso está disponível quando usar a API Java.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?y</span> <span style="color:#b8860b">?givenName</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?givenName</span> .
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>e os blank nodes aparecem</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">--------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">y</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">givenName</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">====================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">--------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>como os estranhos qnames iniciados com <code>_:</code>. Isso não é o título interno do blank node – isso é o ARQ imprimindo-os, atribuindo <code>_:b0</code>, <code>_:b1</code>para mostrar quando dois blank nodes são o mesmo. Aqui eles são diferentes. Isso não revela o título interno usado para um blank node, mas isso está disponível quando usar a API Java.</p>
<p><a href="sparql_filters_pt.html">Próximo: Filtros</a></p>
</article>
diff --git a/content/tutorials/sparql_data.html b/content/tutorials/sparql_data.html
index bb3ab3e48..cb060f220 100644
--- a/content/tutorials/sparql_data.html
+++ b/content/tutorials/sparql_data.html
@@ -181,84 +181,82 @@ they were called at the time the Jena API was first designed).</p>
the serialization. The serialization is just a way to write the
triples down. RDF/XML is the W3C recommendation but it can be
difficult to see the triples in the serialized form because there are
-multiple ways to encode the same graph. In this tutorial, we use a
+multiple ways to encode the same graph. In this tutorial, we use a
more “triple-like” serialization, called
<a href="http://www.ilrt.bris.ac.uk/discovery/2004/01/turtle/">Turtle</a> (see
also N3 language described in the
<a href="https://www.w3.org/2000/10/swap/Primer">W3C semantic web primer</a>).</p>
<p>We will start with the simple data in <a href="sparql_data/vc-db-1.rdf">vc-db-1.rdf</a>:
this file contains RDF for a number of vCard descriptions of
-people. vCards are described in
+people. vCards are described in
<a href="https://www.ietf.org/rfc/rfc2426.txt">RFC2426</a> and the RDF
translation is described in the W3C note
-“<a href="https://www.w3.org/TR/vcard-rdf.html">Representing vCard Objects in RDF/XML</a>".
+“<a href="https://www.w3.org/TR/vcard-rdf.html">Representing vCard Objects in RDF/XML</a>”.
Our example database just contains some name information.</p>
<p>Graphically, the data looks like:</p>
<p><img src="/images/vc-db.png" alt="Graph of the vCard database" title="Graph of the vCard database"></p>
<p>In triples, this might look like:</p>
-<pre><code>@prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix : <#> .
-
-<http://somewhere/MattJones/>
- vCard:FN "Matt Jones" ;
- vCard:N [ vCard:Family
- "Jones" ;
- vCard:Given
- "Matthew"
- ] .
-
-<http://somewhere/RebeccaSmith/>
- vCard:FN "Becky Smith" ;
- vCard:N [ vCard:Family
- "Smith" ;
- vCard:Given
- "Rebecca"
- ] .
-
-<http://somewhere/JohnSmith/>
- vCard:FN "John Smith" ;
- vCard:N [ vCard:Family
- "Smith" ;
- vCard:Given
- "John"
- ] .
-
-<http://somewhere/SarahJones/>
- vCard:FN "Sarah Jones" ;
- vCard:N [ vCard:Family
- "Jones" ;
- vCard:Given
- "Sarah"
- ] .
-</code></pre>
-<p>or even more explicitly as triples:</p>
-<pre><code>@prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-<http://somewhere/MattJones/> vCard:FN "Matt Jones" .
-<http://somewhere/MattJones/> vCard:N _:b0 .
-_:b0 vCard:Family "Jones" .
-_:b0 vCard:Given "Matthew" .
-
-
-<http://somewhere/RebeccaSmith/> vCard:FN "Becky Smith" .
-<http://somewhere/RebeccaSmith/> vCard:N _:b1 .
-_:b1 vCard:Family "Smith" .
-_:b1 vCard:Given "Rebecca" .
-
-<http://somewhere/JohnSmith/> vCard:FN "John Smith" .
-<http://somewhere/JohnSmith/> vCard:N _:b2 .
-_:b2 vCard:Family "Smith" .
-_:b2 vCard:Given "John" .
-
-<http://somewhere/SarahJones/> vCard:FN "Sarah Jones" .
-<http://somewhere/SarahJones/> vCard:N _:b3 .
-_:b3 vCard:Family "Jones" .
-_:b3 vCard:Given "Sarah" .
-</code></pre>
-<p>It is important to realize that these are the same RDF graph and
-that the triples in the graph are in no particular order. They are
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>. [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Matthew"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>or even more explicitly as triples:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>. [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Matthew"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span>.<span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span></code></pre></div><p>It is important to realize that these are the same RDF graph and
+that the triples in the graph are in no particular order. They are
just written in related groups above for the human reader - the
machine does not care.</p>
<p><a href="sparql_query1.html">Next: A Simple Query</a></p>
diff --git a/content/tutorials/sparql_data_pt.html b/content/tutorials/sparql_data_pt.html
index f01072be6..147ce8e2a 100644
--- a/content/tutorials/sparql_data_pt.html
+++ b/content/tutorials/sparql_data_pt.html
@@ -178,73 +178,71 @@
<p>Nós vamos começar os dados em <a href="sparql_data/vc-db-1.rdf">vc-db-1.rdf</a>:
este arquivo contém RDF para uma quantidade de descrições de vcards de pessoas. Vcards são descritos em
<a href="https://www.ietf.org/rfc/rfc2426.txt">RFC2426</a> e a tradução RDF é descrita na nota da W3C
-“<a href="https://www.w3.org/TR/vcard-rdf.html">Representing vCard Objects in RDF/XML</a>".
+“<a href="https://www.w3.org/TR/vcard-rdf.html">Representing vCard Objects in RDF/XML</a>”.
Nosso banco de dados exemplo apenas contém alguma informação sobre nomes.</p>
<p>Graficamente, os dados se assemelham a:</p>
<p><img src="/images/vc-db.png" alt="Graph of the vCard database" title="Graph of the vCard database"></p>
<p>Em triplas, devem se parecer com:</p>
-<pre><code>@prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix : <#> .
-
-<http://somewhere/MattJones/>
- vCard:FN "Matt Jones" ;
- vCard:N [ vCard:Family
- "Jones" ;
- vCard:Given
- "Matthew"
- ] .
-
-<http://somewhere/RebeccaSmith/>
- vCard:FN "Becky Smith" ;
- vCard:N [ vCard:Family
- "Smith" ;
- vCard:Given
- "Rebecca"
- ] .
-
-<http://somewhere/JohnSmith/>
- vCard:FN "John Smith" ;
- vCard:N [ vCard:Family
- "Smith" ;
- vCard:Given
- "John"
- ] .
-
-<http://somewhere/SarahJones/>
- vCard:FN "Sarah Jones" ;
- vCard:N [ vCard:Family
- "Jones" ;
- vCard:Given
- "Sarah"
- ] .
-</code></pre>
-<p>ou então mais explicitamente como triplas:</p>
-<pre><code>@prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-<http://somewhere/MattJones/> vCard:FN "Matt Jones" .
-<http://somewhere/MattJones/> vCard:N _:b0 .
-_:b0 vCard:Family "Jones" .
-_:b0 vCard:Given "Matthew" .
-
-
-<http://somewhere/RebeccaSmith/> vCard:FN "Becky Smith" .
-<http://somewhere/RebeccaSmith/> vCard:N _:b1 .
-_:b1 vCard:Family "Smith" .
-_:b1 vCard:Given "Rebecca" .
-
-<http://somewhere/JohnSmith/> vCard:FN "John Smith" .
-<http://somewhere/JohnSmith/> vCard:N _:b2 .
-_:b2 vCard:Family "Smith" .
-_:b2 vCard:Given "John" .
-
-<http://somewhere/SarahJones/> vCard:FN "Sarah Jones" .
-<http://somewhere/SarahJones/> vCard:N _:b3 .
-_:b3 vCard:Family "Jones" .
-_:b3 vCard:Given "Sarah" .
-</code></pre>
-<p>É importante perceber que elas são as mesmas do grafo RDF e que as triplas no grafo não estão em alguma ordem particular. Elas são apenas escritas em grupos relacionados para a leitura humana – a máquina não se importa com isso.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>. [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Matthew"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>;<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"> </span>]<span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>ou então mais explicitamente como triplas:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>. [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">rdf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/MattJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </sp [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Matthew"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/RebeccaSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span>.<span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Smith"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"John"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><http://somewhere/SarahJones/></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">N</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Family</span><span style="color:#bbb"> </span><span style="color:#b44">"Jones"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vCard:</span><span style="color:#008000;font-weight:bold">Given</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb"> </span>.<span style="colo [...]
+</span></span></span></code></pre></div><p>É importante perceber que elas são as mesmas do grafo RDF e que as triplas no grafo não estão em alguma ordem particular. Elas são apenas escritas em grupos relacionados para a leitura humana – a máquina não se importa com isso.</p>
<p><a href="sparql_query1_pt.html">Próximo: Uma consulta simples</a></p>
</article>
diff --git a/content/tutorials/sparql_datasets.html b/content/tutorials/sparql_datasets.html
index 27982a9c5..822c23d3d 100644
--- a/content/tutorials/sparql_datasets.html
+++ b/content/tutorials/sparql_datasets.html
@@ -192,152 +192,139 @@ number of named graphs.</p>
<p>The graph matching operation
(<a href="sparql_basic_patterns.html">basic patterns</a>,
<a href="sparql_optionals.html"><code>OPTIONAL</code>s</a>, and <a href="sparql_union.html"><code>UNION</code>s</a>) work on
-one RDF graph. This starts out being the default graph of the
+one RDF graph. This starts out being the default graph of the
dataset but it can be changed by the <code>GRAPH</code> keyword.</p>
-<pre><code>GRAPH uri { ... pattern ... }
-
-GRAPH var { ... pattern ... }
-</code></pre>
-<p>If a URI is given, the pattern will be matched against the graph in
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#00a000">uri</span> { ... <span style="">pattern</span> ... }
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="">var</span> { ... <span style="">pattern</span> ... }
+</span></span></code></pre></div><p>If a URI is given, the pattern will be matched against the graph in
the dataset with that name - if there isn’t one, the <code>GRAPH</code> clause
fails to match at all.</p>
<p>If a variable is given, all the named graphs (not the default
-graph) are tried. The variable may be used elsewhere so that if,
+graph) are tried. The variable may be used elsewhere so that if,
during execution, its value is already known for a solution, only
the specific named graph is tried.</p>
<h3 id="example-data">Example Data</h3>
-<p>An RDF dataset can take a variety of forms. Two common setups are
+<p>An RDF dataset can take a variety of forms. Two common setups are
to have the default graph being the union (the RDF merge) of all
the named graphs or to have the default graph be an inventory of
-the named graphs (where they came from, when they were read etc).
+the named graphs (where they came from, when they were read etc).
There are no limitations - one graph can be included twice under
different names, or some graphs may share triples with others.</p>
<p>In the examples below we will use the following dataset that might
occur for an RDF aggregator of book details:</p>
<p>Default graph (<a href="sparql_data/ds-dft.ttl">ds-dft.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<ds-ng-1.ttl> dc:date "2005-07-14T03:18:56+0100"^^xsd:dateTime .
-<ds-ng-2.ttl> dc:date "2005-09-22T05:53:05+0100"^^xsd:dateTime .
-</code></pre>
-<p>Named graph (<a href="sparql_data/ds-ng-1.ttl">ds-ng-1.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-
-[] dc:title "Harry Potter and the Philospher's Stone" .
-[] dc:title "Harry Potter and the Chamber of Secrets" .
-</code></pre>
-<p>Named graph (<a href="sparql_data/ds-ng-2.ttl">ds-ng-2.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-
-[] dc:title "Harry Potter and the Sorcerer's Stone" .
-[] dc:title "Harry Potter and the Chamber of Secrets" .
-</code></pre>
-<p>That is, we have two small graphs describing some books, and we
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">xsd:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/XMLSchema#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><ds-ng-1.ttl></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-07-14T03:18:56+0100"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><ds-ng-2.ttl></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+0100"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> [...]
+</span></span></span></code></pre></div><p>Named graph (<a href="sparql_data/ds-ng-1.ttl">ds-ng-1.ttl</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Philospher's Stone"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>Named graph (<a href="sparql_data/ds-ng-2.ttl">ds-ng-2.ttl</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>That is, we have two small graphs describing some books, and we
have a default graph which records when these graphs were last
read.</p>
<p>Queries can be run with the command line application (this would be
all one line):</p>
-<pre><code>java -cp ... arq.sparql
- --graph ds-dft.ttl --namedgraph ds-ng-1.ttl --namedgraph ds-ng-2.ttl
- --query query file
-</code></pre>
-<p>Datasets don’t have to be created just for the lifetime of the query.
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ java -cp ... arq.sparql
+</span></span><span style="display:flex;"><span> --graph ds-dft.ttl --namedgraph ds-ng-1.ttl --namedgraph ds-ng-2.ttl
+</span></span><span style="display:flex;"><span> --query query file
+</span></span></code></pre></div><p>Datasets don’t have to be created just for the lifetime of the query.
They can be created and stored in a database, as would be more
usual for an aggregator application.</p>
<h3 id="accessing-the-dataset">Accessing the Dataset</h3>
<p>The first example just accesses the default graph
(<a href="sparql_data/q-ds-1.rq">q-ds-1.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-{ ?s ?p ?o }
-</code></pre>
-<p>(The “<code>PREFIX : <.></code>” just helps format the output)</p>
-<pre><code>----------------------------------------------------------------------
-| s | p | o |
-======================================================================
-| :ds-ng-2.ttl | dc:date | "2005-09-22T05:53:05+01:00"^^xsd:dateTime |
-| :ds-ng-1.ttl | dc:date | "2005-07-14T03:18:56+01:00"^^xsd:dateTime |
-----------------------------------------------------------------------
-</code></pre>
-<p>This is the default graph only - nothing from the named graphs
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span>{ <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> }
+</span></span></code></pre></div><p>(The “<code>PREFIX : <.></code>” just helps format the output)</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">----------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">s</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">p</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">o</span><span style="color:#bbb"> </span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">======================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-2</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-1</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">----------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>This is the default graph only - nothing from the named graphs
because they aren’t queried unless explicitly indicated via
<code>GRAPH</code>.</p>
<p>We can query for all triples by querying the default graph and the
named graphs (<a href="sparql_data/q-ds-2.rq">q-ds-2.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-{
- { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
-}
-</code></pre>
-<p>giving:</p>
-<pre><code>---------------------------------------------------------------------------------------
-| s | p | o | g |
-=======================================================================================
-| :ds-ng-2.ttl | dc:date | "2005-09-22T05:53:05+01:00"^^xsd:dateTime | |
-| :ds-ng-1.ttl | dc:date | "2005-07-14T03:18:56+01:00"^^xsd:dateTime | |
-| _:b0 | dc:title | "Harry Potter and the Sorcerer's Stone" | :ds-ng-2.ttl |
-| _:b1 | dc:title | "Harry Potter and the Chamber of Secrets" | :ds-ng-2.ttl |
-| _:b2 | dc:title | "Harry Potter and the Chamber of Secrets" | :ds-ng-1.ttl |
-| _:b3 | dc:title | "Harry Potter and the Philospher's Stone" | :ds-ng-1.ttl |
----------------------------------------------------------------------------------------
-</code></pre>
-<h3 id="querying-a-specific-graph">Querying a specific graph</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>giving:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">s</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">p</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">o</span><span style="color:#bbb"> </span><span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-2</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-1</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="querying-a-specific-graph">Querying a specific graph</h3>
<p>If the application knows the name graph, it can directly ask a
query such as finding all the titles in a given graph
(<a href="sparql_data/q-ds-3.rq">q-ds-3.rq</a>):</p>
-<pre><code>PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT ?title
-{
- GRAPH :ds-ng-2.ttl
- { ?b dc:title ?title }
-}
-</code></pre>
-<p>Results:</p>
-<pre><code>---------------------------------------------
-| title |
-=============================================
-| "Harry Potter and the Sorcerer's Stone" |
-| "Harry Potter and the Chamber of Secrets" |
----------------------------------------------
-</code></pre>
-<h3 id="querying-to-find-data-from-graphs-that-match-a-pattern">Querying to find data from graphs that match a pattern</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?title</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">GRAPH</span> :<span style="color:#008000;font-weight:bold">ds-ng-2.ttl</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?b</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">title</span> <span style="color:#b8860b">?title</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Results:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">title</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="querying-to-find-data-from-graphs-that-match-a-pattern">Querying to find data from graphs that match a pattern</h3>
<p>The name of the graphs to be queried can be determined with the
query itself. The same process for variables applies whether they
are part of a graph pattern or the <code>GRAPH</code> form. The query below
(<a href="sparql_data/q-ds-4.rq">q-ds-4.rq</a>) sets a condition on the variable used to
select named graphs, based on information in the default graph.</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT ?date ?title
-{
- ?g dc:date ?date . FILTER (?date > "2005-08-01T00:00:00Z"^^xsd:dateTime )
- GRAPH ?g
- { ?b dc:title ?title }
-}
-</code></pre>
-<p>The results of executing this query on the example dataset are the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?date</span> <span style="color:#b8860b">?title</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?g</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">date</span> <span style="color:#b8860b">?date</span> . <span style="color:#a2f;font-weight:bold">FILTER</span> (<span style="color:#b8860b">?date</span> <span style="color:#666">></span> <span style="color:#b44">"2005-08-01T00:00:00Z"</span><span style="color:#666">^^</span><span style="color:#0 [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?b</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">title</span> <span style="color:#b8860b">?title</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>The results of executing this query on the example dataset are the
titles in one of the graphs, the one with the date later than 1
August 2005.</p>
-<pre><code>-----------------------------------------------------------------------------------------
-| date | title |
-=========================================================================================
-| "2005-09-22T05:53:05+01:00"^^xsd:dateTime | "Harry Potter and the Sorcerer's Stone" |
-| "2005-09-22T05:53:05+01:00"^^xsd:dateTime | "Harry Potter and the Chamber of Secrets" |
------------------------------------------------------------------------------------------
-</code></pre>
-<h2 id="describing-rdf-datasets---from-and-from-named">Describing RDF Datasets - <code>FROM</code> and <code>FROM NAMED</code></h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">date</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">title</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=========================================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+01:00"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+01:00"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h2 id="describing-rdf-datasets---from-and-from-named">Describing RDF Datasets - <code>FROM</code> and <code>FROM NAMED</code></h2>
<p>A query execution can be given the dataset when the execution
object is built or it can be described in the query itself. When
the details are on the command line, a temporary dataset is created
@@ -360,19 +347,18 @@ added to the dataset.</p>
<p>For example, the query to find all the triples in both default
graph and named graphs could be written as
(<a href="sparql_data/q-ds-5.rq">q-ds-5.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-FROM <ds-dft.ttl>
-FROM NAMED <ds-ng-1.ttl>
-FROM NAMED <ds-ng-2.ttl>
-{
- { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
-}
-</code></pre>
-<p><a href="sparql_results.html">Next: results</a></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM</span> <span style="color:#a0a000"><ds-dft.ttl></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM NAMED</span> <span style="color:#a0a000"><ds-ng-1.ttl></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM NAMED</span> <span style="color:#a0a000"><ds-ng-2.ttl></span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p><a href="sparql_results.html">Next: results</a></p>
</article>
diff --git a/content/tutorials/sparql_datasets_pt.html b/content/tutorials/sparql_datasets_pt.html
index e4ebdb2a1..00a149f26 100644
--- a/content/tutorials/sparql_datasets_pt.html
+++ b/content/tutorials/sparql_datasets_pt.html
@@ -185,12 +185,12 @@
</nav>
</aside>
<article class="flex-column me-lg-4">
- <p>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por um consulta SPARQL.
+ <p>Essa sessão cobre datasets RDF – um dataset RDF é a unidade consultada por uma consulta SPARQL.
Ele consiste de um grafo padrão, e certo número de grafos nomeados.</p>
<h2 id="consultando-datasets">Consultando datasets</h2>
<p>As operações de casamento de grafos
(<a href="sparql_basic_patterns_pt.html">padrões básicos</a>,
-<a href="sparql_optionals_pt.html"><code>OPTIONAL</code>s</a>, e <a href="sparql_union_pt.html"><code>UNION</code>s</a>) funcionam em um grafo RDF. Isso começa por ser o grafo padrão do conjunto de dados,
+<a href="sparql_optionals_pt.html"><code>OPTIONAL</code>s</a>, e <a href="sparql_union_pt.html"><code>UNION</code>s</a>) funcionam em um grafo RDF. Isso começa por ser o grafo padrão do conjunto de dados,
mas pode ser alterado pela palavra-chave <code>GRAPH</code>.
GRAPH uri { … padrão … }</p>
<pre><code>GRAPH var { ... padrão ... }
@@ -209,149 +209,136 @@ ou alguns grafos podem compartilhar triplas com outros.</p>
<p>Nos exemplos abaixo, vamos usar o seguinte dataset que pode ocorrer para um
RDF agregador de um livro de detalhes:</p>
<p>Grafo padrão (<a href="sparql_data/ds-dft.ttl">ds-dft.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<ds-ng-1.ttl> dc:date "2005-07-14T03:18:56+0100"^^xsd:dateTime .
-<ds-ng-2.ttl> dc:date "2005-09-22T05:53:05+0100"^^xsd:dateTime .
-</code></pre>
-<p>Grafo nomeado (<a href="sparql_data/ds-ng-1.ttl">ds-ng-1.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-
-[] dc:title "Harry Potter and the Philospher's Stone" .
-[] dc:title "Harry Potter and the Chamber of Secrets" .
-</code></pre>
-<p>Grafo nomeado (<a href="sparql_data/ds-ng-2.ttl">ds-ng-2.ttl</a>):</p>
-<pre><code>@prefix dc: <http://purl.org/dc/elements/1.1/> .
-
-[] dc:title "Harry Potter and the Sorcerer's Stone" .
-[] dc:title "Harry Potter and the Chamber of Secrets" .
-</code></pre>
-<p>Isto é, nós temos dois pequenos grafos descrevendo alguns livros,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">xsd:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/XMLSchema#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><ds-ng-1.ttl></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-07-14T03:18:56+0100"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#b8860b"><ds-ng-2.ttl></span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+0100"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> [...]
+</span></span></span></code></pre></div><p>Grafo nomeado (<a href="sparql_data/ds-ng-1.ttl">ds-ng-1.ttl</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Philospher's Stone"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>Grafo nomeado (<a href="sparql_data/ds-ng-2.ttl">ds-ng-2.ttl</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://purl.org/dc/elements/1.1/></span><span style="color:#bbb"> </span>.<span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span>[]<span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span></code></pre></div><p>Isto é, nós temos dois pequenos grafos descrevendo alguns livros,
e nós temos um grafo padrão que armazena quando esses grafos foram lidos pela última vez.</p>
<p>As consultas podem ser executadas via linha de comando (tudo numa linha):</p>
-<pre><code>java -cp ... arq.sparql
- --graph ds-dft.ttl --namedgraph ds-ng-1.ttl --namedgraph ds-ng-2.ttl
- --query query file
-</code></pre>
-<p>Datasets não têm que ser criados só para o tempo de vida da consulta.
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ java -cp ... arq.sparql
+</span></span><span style="display:flex;"><span> --graph ds-dft.ttl --namedgraph ds-ng-1.ttl --namedgraph ds-ng-2.ttl
+</span></span><span style="display:flex;"><span> --query query file
+</span></span></code></pre></div><p>Datasets não têm que ser criados só para o tempo de vida da consulta.
Eles podem ser criados e armazenados num banco de dados, o que seria mais usual para uma aplicação agregadora.</p>
<h3 id="acessando-o-dataset">Acessando o Dataset</h3>
<p>O primeiro exemplo apenas acessa o grafo padrão:
(<a href="sparql_data/q-ds-1.rq">q-ds-1.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-{ ?s ?p ?o }
-</code></pre>
-<p>(O “<code>PREFIX : <.></code>” apenas ajuda a formatar a saída)</p>
-<pre><code>----------------------------------------------------------------------
-| s | p | o |
-======================================================================
-| :ds-ng-2.ttl | dc:date | "2005-09-22T05:53:05+01:00"^^xsd:dateTime |
-| :ds-ng-1.ttl | dc:date | "2005-07-14T03:18:56+01:00"^^xsd:dateTime |
-----------------------------------------------------------------------
-</code></pre>
-<p>Este é somente o grafo padrão – nada dos grafos nomeados porque eles não são consultados a menos que
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span>{ <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> }
+</span></span></code></pre></div><p>(O “<code>PREFIX : <.></code>” apenas ajuda a formatar a saída)</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">----------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">s</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">p</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">o</span><span style="color:#bbb"> </span><span style= [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">======================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-2</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-1</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">----------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Este é somente o grafo padrão – nada dos grafos nomeados porque eles não são consultados a menos que
seja informado explicitamente via <code>GRAPH</code>.</p>
<p>Nós podemos consultar todas as triplas ao consultar o grafo padrão e os grafos nomeados:
(<a href="sparql_data/q-ds-2.rq">q-ds-2.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-{
- { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
-}
-</code></pre>
-<p>resultando em:</p>
-<pre><code>---------------------------------------------------------------------------------------
-| s | p | o | g |
-=======================================================================================
-| :ds-ng-2.ttl | dc:date | "2005-09-22T05:53:05+01:00"^^xsd:dateTime | |
-| :ds-ng-1.ttl | dc:date | "2005-07-14T03:18:56+01:00"^^xsd:dateTime | |
-| _:b0 | dc:title | "Harry Potter and the Sorcerer's Stone" | :ds-ng-2.ttl |
-| _:b1 | dc:title | "Harry Potter and the Chamber of Secrets" | :ds-ng-2.ttl |
-| _:b2 | dc:title | "Harry Potter and the Chamber of Secrets" | :ds-ng-1.ttl |
-| _:b3 | dc:title | "Harry Potter and the Philospher's Stone" | :ds-ng-1.ttl |
----------------------------------------------------------------------------------------
-</code></pre>
-<h3 id="consultando-um-grafo-especifico">Consultando um grafo especifico</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>resultando em:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">s</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">p</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">o</span><span style="color:#bbb"> </span><span styl [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-2</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">ds-ng-1</span>.<span style="">ttl</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">date</span><span style="colo [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b0</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b3</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">dc:</span><span style="color:#008000;font-weight:bold">title</span><span style="col [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="consultando-um-grafo-especifico">Consultando um grafo especifico</h3>
<p>Se a aplicação souber o nome do grafo, ele pode consultar diretamente títulos num grafo dado:
(<a href="sparql_data/q-ds-3.rq">q-ds-3.rq</a>):</p>
-<pre><code>PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT ?title
-{
- GRAPH :ds-ng-2.ttl
- { ?b dc:title ?title }
-}
-</code></pre>
-<p>Resultados:</p>
-<pre><code>---------------------------------------------
-| title |
-=============================================
-| "Harry Potter and the Sorcerer's Stone" |
-| "Harry Potter and the Chamber of Secrets" |
----------------------------------------------
-</code></pre>
-<h3 id="consulta-para-encontrar-dados-de-grafos-que-casam-com-um-padrão">Consulta para encontrar dados de grafos que casam com um padrão</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?title</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">GRAPH</span> :<span style="color:#008000;font-weight:bold">ds-ng-2.ttl</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?b</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">title</span> <span style="color:#b8860b">?title</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Resultados:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">title</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h3 id="consulta-para-encontrar-dados-de-grafos-que-casam-com-um-padrão">Consulta para encontrar dados de grafos que casam com um padrão</h3>
<p>O nome dos grafos a ser consultados podem ser determinados na consulta.<br>
O mesmo processo se aplica a variáveis se elas são parte de
um padrão de grafo ou na forma <code>GRAPH</code> form. A consulta abaixo
(<a href="sparql_data/q-ds-4.rq">q-ds-4.rq</a>) seta uma condição nas variáveis
usadas para selecionar grafos nomeados, baseada na informação do grafo padrão.</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT ?date ?title
-{
- ?g dc:date ?date . FILTER (?date > "2005-08-01T00:00:00Z"^^xsd:dateTime )
- GRAPH ?g
- { ?b dc:title ?title }
-}
-</code></pre>
-<p>O resultado da consulta no dataset de exemplo são títulos em um dos grafos, o grafo com data anterior a 1 de agosto de 2005.</p>
-<pre><code>-----------------------------------------------------------------------------------------
-| date | title |
-=========================================================================================
-| "2005-09-22T05:53:05+01:00"^^xsd:dateTime | "Harry Potter and the Sorcerer's Stone" |
-| "2005-09-22T05:53:05+01:00"^^xsd:dateTime | "Harry Potter and the Chamber of Secrets" |
------------------------------------------------------------------------------------------
-</code></pre>
-<h2 id="descrevendo-datasets-rdf----from-e-from-named">Descrevendo datasets RDF - <code>FROM</code> e <code>FROM NAMED</code></h2>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?date</span> <span style="color:#b8860b">?title</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?g</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">date</span> <span style="color:#b8860b">?date</span> . <span style="color:#a2f;font-weight:bold">FILTER</span> (<span style="color:#b8860b">?date</span> <span style="color:#666">></span> <span style="color:#b44">"2005-08-01T00:00:00Z"</span><span style="color:#666">^^</span><span style="color:#0 [...]
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span>
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?b</span> <span style="color:#00f;font-weight:bold">dc</span>:<span style="color:#008000;font-weight:bold">title</span> <span style="color:#b8860b">?title</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>O resultado da consulta no dataset de exemplo são títulos em um dos grafos, o grafo com data anterior a 1 de agosto de 2005.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">date</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">title</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=========================================================================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+01:00"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Sorcerer's Stone"</span><span style="color:#bbb"> [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"2005-09-22T05:53:05+01:00"</span><span style="color:#666">^^</span><span style="font-style:italic">xsd:dateTime</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Harry Potter and the Chamber of Secrets"</span><span style="color:#bbb"> < [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------------------------------------------------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><h2 id="descrevendo-datasets-rdf----from-e-from-named">Descrevendo datasets RDF - <code>FROM</code> e <code>FROM NAMED</code></h2>
<p>À execução de um consulta pode ser dado o dataset quando o objeto da execução é construído ou ele pode ser
descrito na própria consulta. Quando os detalhes estão na linha de comando,
um dataset temporário é criado, mas uma aplicação pode criar datasets e então usá-los em várias consultas.</p>
<p>Quando descrito na consulta, <code>FROM <i>url</i></code> é usado para identificar o conteúdo a preencher o grafo padrão.
-Pode haver mais de uma clausula <code>FROM</code> e o grafo padrão é resultado da leitura de cada arquivo no grafo padrão.
+Pode haver mais de uma cláusula <code>FROM</code> e o grafo padrão é resultado da leitura de cada arquivo no grafo padrão.
Isto é o merge de RDF de grafos individuais.</p>
<p>Não se confunda com o fato de um grafo padrão ser descrito por uma ou mais URL na clausula <code>FROM</code>.
Esse é o lugar de onde o dado é lido, não o nome do grafo.
-Como muitas clausulas FROM podem ser fornecidas, o dado pode ser lido de vários lugares,
+Como muitas cláusulas FROM podem ser fornecidas, o dado pode ser lido de vários lugares,
mas nenhum deles se torna o nome do grafo.</p>
<p><code>FROM NAMED <i>url</i></code> é usado para identificar o grafo nomeado. Ao grafo é dado a url e o dado é lido daquela localização.
Múltiplas clausulas <code>FROM NAMED</code> causam em muitos grafos para serem adicionados ao dataset.</p>
<p>Por exemplo, a consulta para buscar todas as triplas em ambos o grafo padrão e os grafos nomeados poderia ser escrita como
(<a href="sparql_data/q-ds-5.rq">q-ds-5.rq</a>):</p>
-<pre><code>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-PREFIX dc: <http://purl.org/dc/elements/1.1/>
-PREFIX : <.>
-
-SELECT *
-FROM <ds-dft.ttl>
-FROM NAMED <ds-ng-1.ttl>
-FROM NAMED <ds-ng-2.ttl>
-{
- { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
-}
-</code></pre>
-<p><a href="sparql_results_pt.html">Next: Resultados</a></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">xsd</span>: <span style="color:#a0a000"><http://www.w3.org/2001/XMLSchema#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">dc</span>: <span style="color:#a0a000"><http://purl.org/dc/elements/1.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> : <span style="color:#a0a000"><.></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#666">*</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM</span> <span style="color:#a0a000"><ds-dft.ttl></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM NAMED</span> <span style="color:#a0a000"><ds-ng-1.ttl></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FROM NAMED</span> <span style="color:#a0a000"><ds-ng-2.ttl></span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { <span style="color:#a2f;font-weight:bold">GRAPH</span> <span style="color:#b8860b">?g</span> { <span style="color:#b8860b">?s</span> <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?o</span> } }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p><a href="sparql_results_pt.html">Next: Resultados</a></p>
</article>
diff --git a/content/tutorials/sparql_filters.html b/content/tutorials/sparql_filters.html
index e4fb7fdb7..2556985f1 100644
--- a/content/tutorials/sparql_filters.html
+++ b/content/tutorials/sparql_filters.html
@@ -184,72 +184,66 @@ There are many comparisons available - we just cover two cases
here.</p>
<h2 id="string-matching">String Matching</h2>
<p>SPARQL provides an operation to test strings, based on regular
-expressions. This includes the ability to ask SQL “LIKE” style
+expressions. This includes the ability to ask SQL “LIKE” style
tests, although the syntax of the regular expression is different
from SQL.</p>
<p>The syntax is:</p>
-<pre><code>FILTER regex(?x, "pattern" [, "flags"])
-</code></pre>
-<p>The flags argument is optional. The flag “i” means a
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FILTER</span> <span style="color:#00a000">regex</span>(<span style="color:#b8860b">?x</span>, <span style="color:#b44">"pattern"</span> [, <span style="color:#b44">"flags"</span>])
+</span></span></code></pre></div><p>The flags argument is optional. The flag “i” means a
case-insensitive pattern match is done.</p>
<p>The example query (<a href="sparql_data/q-f1.rq">q-f1.rq</a>) finds given names with an
“r” or “R” in them.</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?g
-WHERE
-{ ?y vcard:Given ?g .
- FILTER regex(?g, "r", "i") }
-</code></pre>
-<p>with the results:</p>
-<pre><code>-------------
-| g |
-=============
-| "Rebecca" |
-| "Sarah" |
--------------
-</code></pre>
-<p>The regular expression language is the same as the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?g</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{ <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?g</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> <span style="color:#00a000">regex</span>(<span style="color:#b8860b">?g</span>, <span style="color:#b44">"r"</span>, <span style="color:#b44">"i"</span>) }
+</span></span></code></pre></div><p>with the results:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">g</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>The regular expression language is the same as the
<a href="https://www.w3.org/TR/xpath-functions/#regex-syntax">XQuery regular expression language</a>
which is codified version of that found in Perl.</p>
<h2 id="testing-values">Testing Values</h2>
<p>There are times when the application wants to filter on the value
-of a variable. In the data file <a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>, we
-have added an extra field for age. Age is not defined by the vCard
-schema so we have created a new property for the purpose of this
-tutorial. RDF allows such mixing of different definitions of
-information because URIs are unique. Note also that the <code>info:age</code>
+of a variable. In the data file <a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>, we
+have added an extra field for age. Age is not defined by the vCard
+schema, so we have created a new property for the purpose of this
+tutorial. RDF allows such mixing of different definitions of
+information because URIs are unique. Note also that the <code>info:age</code>
property value is typed.</p>
<p>In this extract of the data, we show the typed value. It can also
be written plain 23.</p>
-<pre><code><http://somewhere/RebeccaSmith/>
- info:age "23"^^xsd:integer ;
- vCard:FN "Becky Smith" ;
- vCard:N [ vCard:Family "Smith" ;
- vCard:Given "Rebecca" ] .
-</code></pre>
-<p>So, a query (<a href="sparql_data/q-f2.rq">q-f2.rq</a>) to find the names of people who
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a0a000"><http://somewhere/RebeccaSmith/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b44">"23"</span><span style="color:#666">^^</span><span style="color:#00f;font-weight:bold">xsd</span>:<span style="color:#008000;font-weight:bold">integer</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b44">"Becky Smith"</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">N</span> [ <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b44">"Rebecca"</span> ] .
+</span></span></code></pre></div><p>So, a query (<a href="sparql_data/q-f2.rq">q-f2.rq</a>) to find the names of people who
are older than 24 is:</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-
-SELECT ?resource
-WHERE
- {
- ?resource info:age ?age .
- FILTER (?age >= 24)
- }
-</code></pre>
-<p>The arithmetic expression must be in parentheses (round brackets).
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?resource</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> {
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?resource</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> (<span style="color:#b8860b">?age</span> <span style="color:#666">>=</span> <span style="color:#666">24</span>)
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>The arithmetic expression must be in parentheses (round brackets).
The only solution is:</p>
-<pre><code>---------------------------------
-| resource |
-=================================
-| <http://somewhere/JohnSmith/> |
----------------------------------
-</code></pre>
-<p>Just one match, resulting in the resource URI for John Smith.
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">resource</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Just one match, resulting in the resource URI for John Smith.
Turning this round to ask for those less than 24 also yields one
-match for Rebecca Smith. Nothing about the Jones’s.</p>
+match for Rebecca Smith. Nothing about the Jones'.</p>
<p>The database contains no age information about the Jones: there are
no info:age properties on these vCards so the variable <code>age</code> did
not get a value and so was not tested by the filter.</p>
diff --git a/content/tutorials/sparql_filters_pt.html b/content/tutorials/sparql_filters_pt.html
index d8700c7dd..2d00f234b 100644
--- a/content/tutorials/sparql_filters_pt.html
+++ b/content/tutorials/sparql_filters_pt.html
@@ -182,56 +182,50 @@
<h2 id="casamento-de-strings">Casamento de Strings</h2>
<p>SPARQL fornece uma operação para testar strings, baseada em expressões regulares. Isso inclui a habilidade de testes como SQL “LIKE”, no entanto, a sintaxe de expressões regulares é diferente de SQL.</p>
<p>A sintaxe é:</p>
-<pre><code>FILTER regex(?x, "pattern" [, "flags"])
-</code></pre>
-<p>O argumento flags é opcional. A flag “i” significa casamento de padrão case-insensitivo.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">FILTER</span> <span style="color:#00a000">regex</span>(<span style="color:#b8860b">?x</span>, <span style="color:#b44">"pattern"</span> [, <span style="color:#b44">"flags"</span>])
+</span></span></code></pre></div><p>O argumento flags é opcional. A flag “i” significa casamento de padrão case-insensitivo.</p>
<p>A consulta (<a href="sparql_data/q-f1.rq">q-f1.rq</a>) procura nomes com um “r” ou “R” neles.</p>
-<pre><code>PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?g
-WHERE
-{ ?y vcard:Given ?g .
- FILTER regex(?g, "r", "i") }
-</code></pre>
-<p>resultados:</p>
-<pre><code>-------------
-| g |
-=============
-| "Rebecca" |
-| "Sarah" |
--------------
-</code></pre>
-<p>A linguagem de expressão regular
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?g</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{ <span style="color:#b8860b">?y</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b8860b">?g</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> <span style="color:#00a000">regex</span>(<span style="color:#b8860b">?g</span>, <span style="color:#b44">"r"</span>, <span style="color:#b44">"i"</span>) }
+</span></span></code></pre></div><p>resultados:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">g</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=============</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>A linguagem de expressão regular
<a href="https://www.w3.org/TR/xpath-functions/#regex-syntax">XQuery regular expression language</a>
é a versão codificada da mesma encontrada em Perl.</p>
<h2 id="testando-valores">Testando valores</h2>
-<p>Muitas vezes, a aplicação necessita filtrar com o valor de uma variável. No arquivo <a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>, nós adicionamos um campo extra para idade. Idade não é definida no esquema de vcard então tivemos que criar uma nova propriedade para usar neste tutorial. RDF permite a mistura de diferentes definições de informação porque URIs são únicas. Note também que a propriedade info:age é tipada.</p>
+<p>Muitas vezes, a aplicação necessita filtrar com o valor de uma variável. No arquivo <a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>, nós adicionamos um campo extra para idade. Idade não é definida no esquema de vcard então tivemos que criar uma nova propriedade para usar neste tutorial. RDF permite a mistura de diferentes definições de informação porque URIs são únicas. Note também que a propriedade <code>info:age</code> é tipada.</p>
<p>Nesse pedaço de dado, nós mostramos o valor tipado.</p>
-<pre><code><http://somewhere/RebeccaSmith/>
- info:age "23"^^xsd:integer ;
- vCard:FN "Becky Smith" ;
- vCard:N [ vCard:Family "Smith" ;
- vCard:Given "Rebecca" ] .
-</code></pre>
-<p>Então a consulta (<a href="sparql_data/q-f2.rq">q-f2.rq</a>) para procurar as pessoas mais velhas que 24 anos é:</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-
-SELECT ?resource
-WHERE
- {
- ?resource info:age ?age .
- FILTER (?age >= 24)
- }
-</code></pre>
-<p>A expressão aritmética precisa estar em parêntesis. A única solução é:</p>
-<pre><code>---------------------------------
-| resource |
-=================================
-| <http://somewhere/JohnSmith/> |
----------------------------------
-</code></pre>
-<p>Apenas um resultado, resultando na URI para o recurso Jonh Smith. Se consultássemos os mais novos que 24 anos, resultaria em Rebecca Smith. Nada sobre os Jones.</p>
-<p>O banco de dados não contém informação sobre a idade dos Jones: não há propriedades info:age nos seus vcards, então a variável <code>age</code> não recebe um valor, então não é testada.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a0a000"><http://somewhere/RebeccaSmith/></span>
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b44">"23"</span><span style="color:#666">^^</span><span style="color:#00f;font-weight:bold">xsd</span>:<span style="color:#008000;font-weight:bold">integer</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b44">"Becky Smith"</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">N</span> [ <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">Family</span> <span style="color:#b44">"Smith"</span> ;
+</span></span><span style="display:flex;"><span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">Given</span> <span style="color:#b44">"Rebecca"</span> ] .
+</span></span></code></pre></div><p>Então a consulta (<a href="sparql_data/q-f2.rq">q-f2.rq</a>) para procurar as pessoas mais velhas que 24 anos é:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?resource</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span> {
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?resource</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> (<span style="color:#b8860b">?age</span> <span style="color:#666">>=</span> <span style="color:#666">24</span>)
+</span></span><span style="display:flex;"><span> }
+</span></span></code></pre></div><p>A expressão aritmética precisa estar em parêntesis. A única solução é:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">resource</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Apenas um resultado, resultando na URI para o recurso Jonh Smith. Se consultássemos os mais novos que 24 anos, resultaria em Rebecca Smith. Nada sobre os Jones.</p>
+<p>O banco de dados não contém informação sobre a idade dos Jones: não há propriedades <code>info:age</code> nos seus vcards, então a variável <code>age</code> não recebe um valor, então não é testada.</p>
<p><a href="sparql_optionals_pt.html">Próximo: Opcionais</a></p>
</article>
diff --git a/content/tutorials/sparql_optionals.html b/content/tutorials/sparql_optionals.html
index 24ed532a0..58284ab6b 100644
--- a/content/tutorials/sparql_optionals.html
+++ b/content/tutorials/sparql_optionals.html
@@ -187,125 +187,116 @@ anyway.</p>
<h2 id="optionals">OPTIONALs</h2>
<p>This query (<a href="sparql_data/q-opt1.rq">q-opt1.rq</a>) gets the name of a person and
also their age if that piece of information is available.</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age }
-}
-</code></pre>
-<p>Two of the four people in the data (<a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>)have
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Two of the four people in the data (<a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>)have
age properties so two of the query solutions have that
-information. However, because the triple pattern for the age is
+information. However, because the triple pattern for the age is
optional, there is a pattern solution for the people who don’t have
age information.</p>
-<pre><code>------------------------
-| name | age |
-=======================
-| "Becky Smith" | 23 |
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>If the optional clause had not been there, no age information would
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">23</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>If the optional clause had not been there, no age information would
have been retrieved. If the triple pattern had been included but
not optional then we would have the query
(<a href="sparql_data/q-opt2.rq">q-opt2.rq</a>):</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- ?person info:age ?age .
-}
-</code></pre>
-<p>with only two solutions:</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Becky Smith" | 23 |
-| "John Smith" | 25 |
------------------------
-</code></pre>
-<p>because the <code>info:age</code> property must now be present in a solution.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> .
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>with only two solutions:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">23</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>because the <code>info:age</code> property must now be present in a solution.</p>
<h2 id="optionals-with-filters">OPTIONALs with FILTERs</h2>
<p><code>OPTIONAL</code> is a binary operator that combines two graph patterns.
The optional pattern is any group pattern and may involve any
-SPARQL pattern types. If the group matches, the solution is
+SPARQL pattern types. If the group matches, the solution is
extended, if not, the original solution is given
(<a href="sparql_data/q-opt3.rq">q-opt3.rq</a>).</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age . FILTER ( ?age > 24 ) }
-}
-</code></pre>
-<p>So, if we filter for ages greater than 24 in the optional part, we
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> . <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#b8860b">?age</span> <span style="color:#666">></span> <span style="color:#666">24</span> ) }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>So, if we filter for ages greater than 24 in the optional part, we
will still get 4 solutions (from the <code>vcard:FN</code> pattern) but only
get ages if they pass the test.</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Becky Smith" | |
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>No age included for “Becky Smith” because it is less than 24.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>No age included for “Becky Smith” because it is less than 24.</p>
<p>If the filter condition is moved out of the optional part, then it
-can influence the number of solutions but it may be necessary to
+can influence the number of solutions, but it may be necessary to
make the filter more complicated to allow for variable <code>age</code> being
unbound (<a href="sparql_data/q-opt4.rq">q-opt4.rq</a>).</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age . }
- FILTER ( !bound(?age) || ?age > 24 )
-}
-</code></pre>
-<p>If a solution has an <code>age</code> variable, then it must be greater than
-24. It can also be unbound. There are now three solutions:</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>Evaluating an expression which has an unbound variables where a
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> . }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#666">!</span><span style="color:#00a000">bound</span>(<span style="color:#b8860b">?age</span>) <span style="color:#666">||</span> <span style="color:#b8860b">?age</span> <span style="color:#666">></span> <span style="color:#666">24</span> )
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>If a solution has an <code>age</code> variable, then it must be greater than
+24. It can also be unbound. There are now three solutions:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Evaluating an expression which has an unbound variables where a
bound one was expected causes an evaluation exception and the whole
expression fails.</p>
<h2 id="optionals-and-order-dependent-queries">OPTIONALs and Order Dependent Queries</h2>
<p>One thing to be careful of is using the same variable in two or
more optional clauses (and not in some basic pattern as well):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- ?x a foaf:Person .
- OPTIONAL { ?x foaf:name ?name }
- OPTIONAL { ?x vCard:FN ?name }
-}
-</code></pre>
-<p>If the first optional binds <code>?name</code> and <code>?x</code> to some values, the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?x</span> <span style="color:#a2f;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">Person</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>If the first optional binds <code>?name</code> and <code>?x</code> to some values, the
second <code>OPTIONAL</code> is an attempt to match the ground triples (<code>?x</code>
and <code>?name</code> have values). If the first optional did not
match the optional part, then the second one is an attempt to match
@@ -345,17 +336,16 @@ its triple with two variables.</p>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold"></rdf:RDF></span>
</span></span></code></pre></div><p>Executing the above query will yield these solutions:</p>
-<pre><code>-------------------
-| name |
-===================
-| "John Smith" |
-| "Matthew Jones" |
-| "Sarah Jones" |
-| |
-| "Rebecca Smith" |
--------------------
-</code></pre>
-<p><a href="sparql_union.html">Next: union queries</a></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">===================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matthew Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Rebecca Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p><a href="sparql_union.html">Next: union queries</a></p>
</article>
diff --git a/content/tutorials/sparql_optionals_pt.html b/content/tutorials/sparql_optionals_pt.html
index ea7f07e0f..505de84b4 100644
--- a/content/tutorials/sparql_optionals_pt.html
+++ b/content/tutorials/sparql_optionals_pt.html
@@ -182,107 +182,97 @@
<p>RDF é dado semi-estruturado então SPARQL tem a habilidade de consultá-lo, mas não para falhar quando o dado não existe. A consulta usa uma parte opcional para extender a informação encontrada na solução de uma consulta, mas para retornar a informação não opcional de qualquer maneira.</p>
<h2 id="opicionais">OPICIONAIS</h2>
<p>Essa consulta (<a href="sparql_data/q-opt1.rq">q-opt1.rq</a>) pega o nome da pessoa e também sua idade se essa informação estiver disponível.</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age }
-}
-</code></pre>
-<p>Duas das quatro pessoas nos dados (<a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>) possui a propriedade idade, então duas das soluções da consulta têm essa informação. No entanto, já que o padrão de tripla para a idade é opcional, há uma solução padrão para a pessoa que não tiver informação sobre a idade.</p>
-<pre><code>------------------------
-| name | age |
-=======================
-| "Becky Smith" | 23 |
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>Se a clausula opcional não estivesse ali, nenhuma informação sobre idade seria retornada. Se o padrão da tripla fosse incluída, mas não fosse opcional, nós teríamos a consulta (<a href="sparql_data/q-opt2.rq">q-opt2.rq</a>):</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- ?person info:age ?age .
-}
-</code></pre>
-<p>com os dois únicos resultados:</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Becky Smith" | 23 |
-| "John Smith" | 25 |
------------------------
-</code></pre>
-<p>porque a propriedade <code>info:age</code> deve estar presente na solução agora.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Duas das quatro pessoas nos dados (<a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>) possui a propriedade idade, então duas das soluções da consulta têm essa informação. No entanto, já que o padrão de tripla para a idade é opcional, há uma solução padrão para a pessoa que não tiver informação sobre a idade.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">23</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Se a clausula opcional não estivesse ali, nenhuma informação sobre idade seria retornada. Se o padrão da tripla fosse incluída, mas não fosse opcional, nós teríamos a consulta (<a href="sparql_data/q-opt2.rq">q-opt2.rq</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> .
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>com os dois únicos resultados:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">23</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>porque a propriedade <code>info:age</code> deve estar presente na solução agora.</p>
<h2 id="opcionais-com-filtros">OPCIONAIS com FILTROS</h2>
<p><code>OPTIONAL</code> é um operador binário que combina dois padrões de grafo. O padrão opcional é qualquer padrão de grupo e deve envolver qualquer tipo de padrão SPARQL. Se o grupo casar, a solução é estendida, senão, a solução original é dada (<a href="sparql_data/q-opt3.rq">q-opt-3.rq</a>).</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age . FILTER ( ?age > 24 ) }
-}
-</code></pre>
-<p>Portanto, se filtrarmos por idades maiores que 24 na parte opcional, nós ainda teremos quatro soluções (do padrão <code>vcard:FN</code>) mas somente pegaremos idades se elas passarem no teste.</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Becky Smith" | |
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>Idade não incluída para “Becky Smith” porque é menor que 24.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> . <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#b8860b">?age</span> <span style="color:#666">></span> <span style="color:#666">24</span> ) }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Portanto, se filtrarmos por idades maiores que 24 na parte opcional, nós ainda teremos quatro soluções (do padrão <code>vcard:FN</code>) mas somente pegaremos idades se elas passarem no teste.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Idade não incluída para “Becky Smith” porque é menor que 24.</p>
<p>Se a condição do filtro é movida para a parte opcional, então isso pode influenciar no número de soluções, mas deve ser necessário fazer um filtro mais complicado para permitir que a variável <code>age</code> seja não limitada (<a href="sparql_data/q-opt4.rq">q-opt4.rq</a>).</p>
-<pre><code>PREFIX info: <http://somewhere/peopleInfo#>
-PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name ?age
-WHERE
-{
- ?person vcard:FN ?name .
- OPTIONAL { ?person info:age ?age . }
- FILTER ( !bound(?age) || ?age > 24 )
-}
-</code></pre>
-<p>Se a solução tiver uma variável <code>age</code>, então ela deve ser maior que 24. Isso também pode ser não limitado. Agora há 3 soluções:</p>
-<pre><code>-----------------------
-| name | age |
-=======================
-| "Sarah Jones" | |
-| "John Smith" | 25 |
-| "Matt Jones" | |
------------------------
-</code></pre>
-<p>Avaliar uma expressão que tem variáveis não limitadas onde uma variável limitada é esperada causa uma exceção de avaliação e toda a expressão falha.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">info</span>: <span style="color:#a0a000"><http://somewhere/peopleInfo#></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vcard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span> <span style="color:#b8860b">?age</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">vcard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?person</span> <span style="color:#00f;font-weight:bold">info</span>:<span style="color:#008000;font-weight:bold">age</span> <span style="color:#b8860b">?age</span> . }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#666">!</span><span style="color:#00a000">bound</span>(<span style="color:#b8860b">?age</span>) <span style="color:#666">||</span> <span style="color:#b8860b">?age</span> <span style="color:#666">></span> <span style="color:#666">24</span> )
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Se a solução tiver uma variável <code>age</code>, então ela deve ser maior que 24. Isso também pode ser não limitado. Agora há 3 soluções:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">age</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=======================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#666">25</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Avaliar uma expressão que tem variáveis não limitadas onde uma variável limitada é esperada causa uma exceção de avaliação e toda a expressão falha.</p>
<h2 id="opcionais-e-consultas-dependentes-de-ordem">OPCIONAIS e consultas dependentes de ordem</h2>
<p>Uma coisa a se ter cuidado ao usar a mesma variável em duas ou mais cláusulas opcionais (e não em algum padrão básico também):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- ?x a foaf:Person .
- OPTIONAL { ?x foaf:name ?name }
- OPTIONAL { ?x vCard:FN ?name }
-}
-</code></pre>
-<p>Se a primeira opção liga <code>?name</code> e <code>?x</code> a algum valor, a segunda opção é uma tentativa de casar as outras triplas (<code>?x</code> e <code><kbd>?name</kbd></code> têm valor). Se a primeira opção não casar com a parte opcional, então a segunda é uma tentativa para casar a tripla com duas variáveis.</p>
-<p>
-<a href="sparql_union_pt.html">Próximo: União de Consultas</a></p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?x</span> <span style="color:#a2f;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">Person</span> .
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>Se a primeira opção liga <code>?name</code> e <code>?x</code> a algum valor, a segunda opção é uma tentativa de casar as outras triplas (<code>?x</code> e <code><kbd>?name</kbd></code> têm valor). Se a primeira opção não casar com a parte opcional, então a segunda é uma tentativa para casar a tripla com duas variáveis.</p>
+<p><a href="sparql_union_pt.html">Próximo: União de Consultas</a></p>
</article>
diff --git a/content/tutorials/sparql_pt.html b/content/tutorials/sparql_pt.html
index a55d8bdaa..51c71590a 100644
--- a/content/tutorials/sparql_pt.html
+++ b/content/tutorials/sparql_pt.html
@@ -185,7 +185,7 @@
<a href="https://www.w3.org/TR/sparql11-query/">linguagem de consulta</a> e um
<a href="https://www.w3.org/TR/rdf-sparql-protocol/">protocolo</a> para acesso a
RDF elaborado pelo
-<a href="https://www.w3.org/2001/sw/DataAccess/">W3C RDF Data Access Working Group</a>. </p>
+<a href="https://www.w3.org/2001/sw/DataAccess/">W3C RDF Data Access Working Group</a>.</p>
<p>Como uma linguagem de consulta, SPARQL é orientada a dados de forma que só consulta as informações presentes nos modelos, não há inferência propriamente dita nesta linguagem de consulta. Por acaso, os modelos de Jena são “inteligentes” quanto a isso, e nos dá a impressão de que certas triplas são criadas sob demanda, incluindo raciocínio OWL. SPARQL nada mais faz do que pegar a descrição do que a aplicação quer, na forma de uma consulta, e retornar a informação, na forma de um conjun [...]
<h2 id="tutorial-sparql">Tutorial SPARQL</h2>
<ol>
diff --git a/content/tutorials/sparql_query1.html b/content/tutorials/sparql_query1.html
index d292a69fa..4e2c66625 100644
--- a/content/tutorials/sparql_query1.html
+++ b/content/tutorials/sparql_query1.html
@@ -188,28 +188,26 @@
execute it with Jena.</p>
<h2 id="a-hello-world-of-queries">A “hello world” of queries</h2>
<p>The file “<a href="sparql_data/q1.rq">q1.rq</a>” contains the following query:</p>
-<pre><code>SELECT ?x
-WHERE { ?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> "John Smith" }
-</code></pre>
-<p>executing that query with the command line query application;</p>
-<pre><code>---------------------------------
-| x |
-=================================
-| <http://somewhere/JohnSmith/> |
----------------------------------
-</code></pre>
-<p>This works by matching the triple pattern in the <code>WHERE</code> clause
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?x</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span> { <span style="color:#b8860b">?x</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#FN></span> <span style="color:#b44">"John Smith"</span> }
+</span></span></code></pre></div><p>executing that query with the command line query application;</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">x</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>This works by matching the triple pattern in the <code>WHERE</code> clause
against the triples in the RDF graph. The predicate and object of
the triple are fixed values so the pattern is going to match only
triples with those values. The subject is a variable, and there are
no other restrictions on the variable. The pattern matches any
triples with these predicate and object values, and it matches with
solutions for <code>x</code>.</p>
-<p>The item enclosed in <> is a URI (actually, it’s an IRI) and the
+<p>The item enclosed in <code><\></code> is a URI (actually, it’s an IRI) and the
item enclosed in "" is a plain literal. Just like Turtle, N3 or
N-triples, typed literals are written with ^^ and language tags
can be added with @.</p>
-<p>?x is a variable called x. The ? does not form part of the name
+<p><code>?x</code> is a variable called x. The ? does not form part of the name
which is why it does not appear in the table output.</p>
<p>There is one match. The query returns the match in the <code>x</code> query
variable. The output shown was obtained by using one of ARQ’s
@@ -220,21 +218,18 @@ command line applications.</p>
command path.</p>
<h3 id="windows-setup">Windows setup</h3>
<p>Execute:</p>
-<pre><code>bat\sparql.bat --data=doc\Tutorial\vc-db-1.rdf --query=doc\Tutorial\q1.rq
-</code></pre>
-<p>You can just put the <code>bat/</code> directory on your classpath or copy the
+<pre tabindex="0"><code>> bat\sparql.bat --data=doc\Tutorial\vc-db-1.rdf --query=doc\Tutorial\q1.rq
+</code></pre><p>You can just put the <code>bat/</code> directory on your classpath or copy the
programs out of it.</p>
<h3 id="bash-scripts-for-linuxcygwinunix">bash scripts for Linux/Cygwin/Unix</h3>
<p>Execute:</p>
-<pre><code>bin/sparql --data=doc/Tutorial/vc-db-1.rdf --query=doc/Tutorial/q1.rq
-</code></pre>
-<h3 id="using-the-java-command-line-applications-directly">Using the Java command line applications directly</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ bin/sparql --data<span style="color:#666">=</span>doc/Tutorial/vc-db-1.rdf --query<span style="color:#666">=</span>doc/Tutorial/q1.rq
+</span></span></code></pre></div><h3 id="using-the-java-command-line-applications-directly">Using the Java command line applications directly</h3>
<p>(This is not necessary.)</p>
<p>You will need to set the classpath to include <em>all</em> the jar files
in the Jena distribution <code>lib/</code> directory.</p>
-<pre><code>java -cp 'DIST/lib/*' arq.sparql ...
-</code></pre>
-<p>where <code>DIST</code> is the <code>apache-jena-VERSION</code> directory.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ java -cp <span style="color:#b44">'DIST/lib/*'</span> arq.sparql ...
+</span></span></code></pre></div><p>where <code>DIST</code> is the <code>apache-jena-VERSION</code> directory.</p>
<p><a href="sparql_basic_patterns.html">Next: basic patterns</a></p>
</article>
diff --git a/content/tutorials/sparql_query1_pt.html b/content/tutorials/sparql_query1_pt.html
index 385861b30..29dbdaa49 100644
--- a/content/tutorials/sparql_query1_pt.html
+++ b/content/tutorials/sparql_query1_pt.html
@@ -176,7 +176,7 @@
<li><a href="#executando-a-consulta">Executando a consulta</a>
<ul>
<li><a href="#instalação-no-windows">Instalação no Windows</a></li>
- <li><a href="#scripts-bash-para-linuxcyquinunix">scripts bash para Linux/Cyquin/Unix</a></li>
+ <li><a href="#scripts-bash-para-linuxcyqwinunix">scripts bash para Linux/Cyqwin/Unix</a></li>
<li><a href="#usando-a-aplicação-de-linhas-de-comando-de-jena-diretamente">Usando a aplicação de linhas de comando de Jena diretamente</a></li>
</ul>
</li>
@@ -187,53 +187,46 @@
<p>Nesta sessão, vamos olhar para a primeira consulta simples e mostrar como executá-la em Jena.</p>
<h2 id="o-hello-world-de-consultas">O “hello world” de consultas</h2>
<p>O arquivo “<a href="sparql_data/q1.rq">q1.rq</a>” contem a seguinte consulta:</p>
-<pre><code>SELECT ?x
-WHERE { ?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> "John Smith" }
-</code></pre>
-<p>executando esta consulta com a aplicação de consultas em linhas de comando:</p>
-<pre><code>---------------------------------
-| x |
-=================================
-| <http://somewhere/JohnSmith/> |
----------------------------------
-</code></pre>
-<p>Isso funciona casando o padrão da tripla na clausula <code>WHERE</code> contra as triplas no grafo RDF. O predicado e o objeto da tripla são valores fixos, então o padrão vai casar somente triplas com estes valores. O sujeito é a variável, e não há outras restrições para a variável. O padrão casa qualquer tripla com aquele predicado e aquele objeto, e isso casa com soluções para <code>x</code>.</p>
-<p>O item entre <> é a URI (atualmente, é uma IRI) e o item entre "" é uma literal. Assim como Turtle, N3 ou N-Triplas, literais tipadas são escritas com ^^e tags de linguagem podem ser adicionadas com @.</p>
-<p>?x é uma variável chamada x. A ? não faz parte do nome e por conta disso não aparece nos resultados.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?x</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span> { <span style="color:#b8860b">?x</span> <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#FN></span> <span style="color:#b44">"John Smith"</span> }
+</span></span></code></pre></div><p>executando esta consulta com a aplicação de consultas em linhas de comando:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">x</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://somewhere/JohnSmith/></span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Isso funciona casando o padrão da tripla na clausula <code>WHERE</code> contra as triplas no grafo RDF. O predicado e o objeto da tripla são valores fixos, então o padrão vai casar somente triplas com estes valores. O sujeito é a variável, e não há outras restrições para a variável. O padrão casa qualquer tripla com aquele predicado e aquele objeto, e isso casa com soluções para <code>x</code>.</p>
+<p>O item entre <code><\></code> é a URI (atualmente, é uma IRI) e o item entre "" é uma literal. Assim como Turtle, N3 ou N-Triplas, literais tipadas são escritas com ^^e tags de linguagem podem ser adicionadas com @.</p>
+<p><code>?x</code> é uma variável chamada x. A ? não faz parte do nome e por conta disso não aparece nos resultados.</p>
<p>Há um casamento. A consulta retorna o casamento na variável x da consulta. A saída mostrada foi obtida usando uma das aplicações de ARQ em linhas de comando.</p>
<h2 id="executando-a-consulta">Executando a consulta</h2>
<p>Há <a href="/documentation/query/cmds.html">scripts de ajuda</a> nos diretórios de ARQ <code>bat/</code> e
<code>bin/</code> de sua distribuição. Eles podem não estar na distribuição do Jena. Você deve checar esses scripts antes de usá-los.</p>
<h3 id="instalação-no-windows">Instalação no Windows</h3>
<p>Aponte a variável de ambiente <code>ARQROOT</code> para a localização do arquivo na distribuição do ARQ.</p>
-<pre><code>set ARQROOT=c:\MyProjects\ARQ
-</code></pre>
-<p>A distribuição normalmente contém o número da versão no nome do diretório.</p>
+<pre tabindex="0"><code>> set ARQROOT=c:\MyProjects\ARQ
+</code></pre><p>A distribuição normalmente contém o número da versão no nome do diretório.</p>
<p>No diretório do ARQ, execute:</p>
-<pre><code>bat\sparql.bat --data=doc\Tutorial\vc-db-1.rdf --query=doc\Tutorial\q1.rq
-</code></pre>
-<p>Você pode simplesmente colocar o diretório <code>bat/</code> no seu classpath ou copiar os programas lá. Todos eles dependem de ARQROOT.</p>
-<h3 id="scripts-bash-para-linuxcyquinunix">scripts bash para Linux/Cyquin/Unix</h3>
+<pre tabindex="0"><code>> bat\sparql.bat --data=doc\Tutorial\vc-db-1.rdf --query=doc\Tutorial\q1.rq
+</code></pre><p>Você pode simplesmente colocar o diretório <code>bat/</code> no seu classpath ou copiar os programas lá. Todos eles dependem de ARQROOT.</p>
+<h3 id="scripts-bash-para-linuxcyqwinunix">scripts bash para Linux/Cyqwin/Unix</h3>
<p>Aponte a variável de ambiente <code>ARQROOT</code> para a localização do arquivo na distribuição do ARQ.</p>
-<pre><code>export ARQROOT=$HOME/MyProjects/ARQ
-</code></pre>
-<p>A distribuição normalmente contém o número da versão no nome do diretório.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ <span style="color:#a2f">export</span> <span style="color:#b8860b">ARQROOT</span><span style="color:#666">=</span><span style="color:#b8860b">$HOME</span>/MyProjects/ARQ
+</span></span></code></pre></div><p>A distribuição normalmente contém o número da versão no nome do diretório.</p>
<p>No diretório do ARQ, execute:</p>
-<pre><code>bin/sparql --data=doc/Tutorial/vc-db-1.rdf --query=doc/Tutorial/q1.rq
-</code></pre>
-<p>Você pode simplesmente colocar o diretório <code>bin/</code> no seu classpath ou copiar os programas lá. Todos eles dependem de ARQROOT.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ bin/sparql --data<span style="color:#666">=</span>doc/Tutorial/vc-db-1.rdf --query<span style="color:#666">=</span>doc/Tutorial/q1.rq
+</span></span></code></pre></div><p>Você pode simplesmente colocar o diretório <code>bin/</code> no seu classpath ou copiar os programas lá. Todos eles dependem de ARQROOT.</p>
<p><a href="https://www.cygwin.com/">Cygwin</a> é um ambiente Linux para Windows.</p>
<h3 id="usando-a-aplicação-de-linhas-de-comando-de-jena-diretamente">Usando a aplicação de linhas de comando de Jena diretamente</h3>
<p>Você precisará modificar o classpath para incluir <em>todos</em> os arquivos jar do diretório <code>lib/</code> do ARQ.</p>
<p>Por exemplo, no Windows:</p>
-<pre><code>ARQdir\lib\antlr-2.7.5.jar;ARQdir\lib\arq-extra.jar;ARQdir\lib\arq.jar;
+<pre tabindex="0"><code>ARQdir\lib\antlr-2.7.5.jar;ARQdir\lib\arq-extra.jar;ARQdir\lib\arq.jar;
ARQdir\lib\commons-logging-1.1.jar;ARQdir\lib\concurrent.jar;ARQdir\lib\icu4j_3_4.jar;
ARQdir\lib\iri.jar;ARQdir\lib\jena.jar;ARQdir\lib\jenatest.jar;
ARQdir\lib\json.jar;ARQdir\lib\junit.jar;ARQdir\lib\log4j-1.2.12.jar;
ARQdir\lib\lucene-core-2.2.0.jar;ARQdir\lib\stax-api-1.0.jar;
ARQdir\lib\wstx-asl-3.0.0.jar;ARQdir\lib\xercesImpl.jar;ARQdir\lib\xml-apis.jar
-</code></pre>
-<p>onde <code><i>ARQdir</i></code> é onde você descompactou o ARQ. Isso tudo precisa estar numa linha.</p>
+</code></pre><p>onde <code>ARQdir</code> é onde você descompactou o ARQ. Isso tudo precisa estar numa linha.</p>
<p>Os nomes dos arquivos JAR muitas vezes mudam e novos arquivos são adicionados – verifique essa lista com sua versão do ARQ.</p>
<p>Os comandos estão no pacote ARQ.</p>
<p><a href="sparql_basic_patterns_pt.html">Próximo: Padrões Básicos</a></p>
@@ -248,7 +241,7 @@ ARQdir\lib\wstx-asl-3.0.0.jar;ARQdir\lib\xercesImpl.jar;ARQdir\lib\xml-apis.jar
<li><a href="#executando-a-consulta">Executando a consulta</a>
<ul>
<li><a href="#instalação-no-windows">Instalação no Windows</a></li>
- <li><a href="#scripts-bash-para-linuxcyquinunix">scripts bash para Linux/Cyquin/Unix</a></li>
+ <li><a href="#scripts-bash-para-linuxcyqwinunix">scripts bash para Linux/Cyqwin/Unix</a></li>
<li><a href="#usando-a-aplicação-de-linhas-de-comando-de-jena-diretamente">Usando a aplicação de linhas de comando de Jena diretamente</a></li>
</ul>
</li>
diff --git a/content/tutorials/sparql_results.html b/content/tutorials/sparql_results.html
index b991f67fe..d60c21d0a 100644
--- a/content/tutorials/sparql_results.html
+++ b/content/tutorials/sparql_results.html
@@ -211,37 +211,35 @@ BY)</li>
and values.</li>
</ul>
<p>The solution modifiers OFFSET/LIMIT and ORDER BY always apply to
-all result forms. </p>
+all result forms.</p>
<h3 id="offset-and-limit">OFFSET and LIMIT</h3>
<p>A set of solutions can be abbreviated by specifying the offset (the
start index) and the limit (the number of solutions) to be
returned. Using LIMIT alone can be useful to ensure not too many
solutions are returned, to restrict the effect of some unexpected
-situation. LIMIT and OFFSET can be used in conjunction with
+situation. LIMIT and OFFSET can be used in conjunction with
sorting to take a defined slice through the solutions found.</p>
<h3 id="order-by">ORDER BY</h3>
<p>SPARQL solutions are sorted by expression, including custom
functions.</p>
-<pre><code>ORDER BY ?x ?y
-
-ORDER BY DESC(?x)
-
-ORDER BY x:func(?x) # Custom sorting condition
-</code></pre>
-<h3 id="distinct">DISTINCT</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#b8860b">?x</span> <span style="color:#b8860b">?y</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#a2f;font-weight:bold">DESC</span>(<span style="color:#b8860b">?x</span>)
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#00f;font-weight:bold">x</span>:<span style="color:#008000;font-weight:bold">func</span>(<span style="color:#b8860b">?x</span>) <span style="color:#080;font-style:italic"># Custom sorting condition</span>
+</span></span></code></pre></div><h3 id="distinct">DISTINCT</h3>
<p>The SELECT result form can take the DISTINCT modifier which ensures
that no two solutions returned are the same - this takes place
after projection to the requested variables.</p>
-<p> </p>
<h2 id="select">SELECT</h2>
<p>The <code>SELECT</code> result form is a projection, with DISTINCT applied, of
the solution set. <code>SELECT</code> identifies which named variables are in
-the result set. This may be “<code>*</code>” meaning “all named variables”
+the result set. This may be “<code>*</code>” meaning “all named variables”
(blank nodes in the query act like variables for matching but are
never returned).</p>
<h2 id="construct">CONSTRUCT</h2>
-<p>CONSTRUCT builds an RDF based on a graph template. The graph
-template can have variables which are bound by a WHERE clause. The
+<p>CONSTRUCT builds an RDF based on a graph template. The graph
+template can have variables which are bound by a WHERE clause. The
effect is to calculate the graph fragment, given the template, for
each solution from the WHERE clause, after taking into account any
solution modifiers. The graph fragments, one per solution, are
diff --git a/content/tutorials/sparql_results_pt.html b/content/tutorials/sparql_results_pt.html
index 7afb53493..b2031ab38 100644
--- a/content/tutorials/sparql_results_pt.html
+++ b/content/tutorials/sparql_results_pt.html
@@ -208,15 +208,13 @@
<p>Um conjunto de soluções pode ser abreviado especificando o deslocamento (índice inicial) e o limite (número de soluções) a ser retornados. Usando apenas LIMIT é útil para garantir que nem tantas soluções vão ser retornadas, para restringir o efeito de uma situação inesperada. LIMIT e OFFSET pode ser usado em conjunção com ordenamento para pegar um fatia definida dentre as soluções encontradas.</p>
<h3 id="order-by">ORDER BY</h3>
<p>Soluções SPARQL são ordenadas por expressões, incluindo funções padrões.</p>
-<pre><code>ORDER BY ?x ?y
-
-ORDER BY DESC(?x)
-
-ORDER BY x:func(?x) # Custom sorting condition
-</code></pre>
-<h3 id="distinct">DISTINCT</h3>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#b8860b">?x</span> <span style="color:#b8860b">?y</span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#a2f;font-weight:bold">DESC</span>(<span style="color:#b8860b">?x</span>)
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">ORDER BY</span> <span style="color:#00f;font-weight:bold">x</span>:<span style="color:#008000;font-weight:bold">func</span>(<span style="color:#b8860b">?x</span>) <span style="color:#080;font-style:italic"># Custom sorting condition</span>
+</span></span></code></pre></div><h3 id="distinct">DISTINCT</h3>
<p>O SELECT pode usar o modificador DISTINCT para garantir que duas soluções retornadas sejam diferentes.</p>
-<p> </p>
<h2 id="select">SELECT</h2>
<p>O <code>SELECT</code> é uma projeção, com DISTINCT aplicado, do conjunto solução. <code>SELECT</code> identifica quais variáveis nomeadas estão no conjunto resultado. Isso pode ser um “*” significando que “todas as variáveis” (blank nodes na consulta atuam como variáveis para casamento, mas nada é retornado).</p>
<h2 id="construct">CONSTRUCT</h2>
diff --git a/content/tutorials/sparql_union.html b/content/tutorials/sparql_union.html
index 3d143af94..e245633cc 100644
--- a/content/tutorials/sparql_union.html
+++ b/content/tutorials/sparql_union.html
@@ -184,59 +184,55 @@ for one of a number of possibilities. This section covers <code>UNION</code>
patterns, where one of a number of possibilities is tried.</p>
<h2 id="union---two-ways-to-the-same-data">UNION - two ways to the same data</h2>
<p>Both the vCard vocabulary and the FOAF vocabulary have properties
-for people’s names. In vCard, it is vCard:FN, the “formatted
+for people’s names. In vCard, it is vCard:FN, the “formatted
name”, and in FOAF, it is foaf:name. In this section, we will look
at a small set of data where the names of people can be given by
either the FOAF or the vCard vocabulary.</p>
<p>Suppose we have <a href="sparql_data/vc-db-3.ttl">an RDF graph</a> that contains name
information using both the vCard and FOAF vocabularies.</p>
-<pre><code>@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-
-_:a foaf:name "Matt Jones" .
-
-_:b foaf:name "Sarah Jones" .
-
-_:c vcard:FN "Becky Smith" .
-
-_:d vcard:FN "John Smith" .
-</code></pre>
-<p>A query to access the name information, when it can be in either
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://xmlns.com/foaf/0.1/></span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">c</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">d</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span></code></pre></div><p>A query to access the name information, when it can be in either
form, could be (<a href="sparql_data/q-union1.rq">q-union1.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- { [] foaf:name ?name } UNION { [] vCard:FN ?name }
-}
-</code></pre>
-<p>This returns the results:</p>
-<pre><code>-----------------
-| name |
-=================
-| "Matt Jones" |
-| "Sarah Jones" |
-| "Becky Smith" |
-| "John Smith" |
------------------
-</code></pre>
-<p>It didn’t matter which form of expression was used for the name,
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { [] <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { [] <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>This returns the results:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>It didn’t matter which form of expression was used for the name,
the ?name variable is set. This can be achieved using a <code>FILTER</code> as
this query (<a href="sparql_data/q-union1alt.rq">q-union-1alt.rq</a>) shows:</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- [] ?p ?name
- FILTER ( ?p = foaf:name || ?p = vCard:FN )
-}
-</code></pre>
-<p>testing whether the property is one URI or another. The solutions
-may not come out in the same order. The first form is more likely
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> [] <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#b8860b">?p</span> <span style="color:#666">=</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#666">||</span> <span style="color:#b8860b">?p</span> <span style="color:#666">=</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight: [...]
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>testing whether the property is one URI or another. The solutions
+may not come out in the same order. The first form is more likely
to be faster, depending on the data and the storage used, because
the second form may have to get all the triples from the graph to
match the triple pattern with unbound variables (or blank nodes) in
@@ -249,25 +245,23 @@ the storage layer.</p>
<p>The example above used the same variable in each branch. If
different variables are used, the application can discover which
sub-pattern caused the match (<a href="sparql_data/q-union2.rq">q-union2.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name1 ?name2
-WHERE
-{
- { [] foaf:name ?name1 } UNION { [] vCard:FN ?name2 }
-}
-
----------------------------------
-| name1 | name2 |
-=================================
-| "Matt Jones" | |
-| "Sarah Jones" | |
-| | "Becky Smith" |
-| | "John Smith" |
----------------------------------
-</code></pre>
-<p>This second query has retained information of where the name of the
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name1</span> <span style="color:#b8860b">?name2</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { [] <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name1</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { [] <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name2</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>This second query has retained information of where the name of the
person came from by assigning the name to different variables.</p>
<h2 id="optional-and-union">OPTIONAL and UNION</h2>
<p>In practice, <code>OPTIONAL</code> is more common than <code>UNION</code> but they both
@@ -276,27 +270,25 @@ found, <code>UNION</code> is useful for concatenating the solutions from two
possibilities. They don’t necessary return the information in the
same way:</p>
<p>Query(<a href="sparql_data/q-union3.rq">q-union3.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name1 ?name2
-WHERE
-{
- ?x a foaf:Person
- OPTIONAL { ?x foaf:name ?name1 }
- OPTIONAL { ?x vCard:FN ?name2 }
-}
-
----------------------------------
-| name1 | name2 |
-=================================
-| "Matt Jones" | |
-| "Sarah Jones" | |
-| | "Becky Smith" |
-| | "John Smith" |
----------------------------------
-</code></pre>
-<p>but beware of using <code>?name</code> in each <code>OPTIONAL</code> because that is an
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name1</span> <span style="color:#b8860b">?name2</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?x</span> <span style="color:#a2f;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">Person</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name1</span> }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name2</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>but beware of using <code>?name</code> in each <code>OPTIONAL</code> because that is an
order-dependent query.</p>
<p><a href="sparql_datasets.html">Next: Named Graphs</a></p>
diff --git a/content/tutorials/sparql_union_pt.html b/content/tutorials/sparql_union_pt.html
index f975ba4af..97a46e9d7 100644
--- a/content/tutorials/sparql_union_pt.html
+++ b/content/tutorials/sparql_union_pt.html
@@ -183,94 +183,86 @@
<h2 id="union---duas-maneiras-para-o-mesmo-dado">UNION - duas maneiras para o mesmo dado</h2>
<p>Ambos os vocabulários de vcard e de FOAF possuem propriedades para nome de pessoas. Em vcard, é vcard:FN, o nome formatado, e em FOAF, é foaf:name. Nesta sessão, vamos olhar um pequeno conjunto de dados onde o nome das pessoas podem ser dados por ambos os vocabulários de FOAF e vcard.</p>
<p>Suponha que temos um <a href="sparql_data/vc-db-3.ttl">an RDF graph</a> que contém a informação de nome usando os vocabulários de vcard e FOAF.</p>
-<pre><code>@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
-
-_:a foaf:name "Matt Jones" .
-
-_:b foaf:name "Sarah Jones" .
-
-_:c vcard:FN "Becky Smith" .
-
-_:d vcard:FN "John Smith" .
-</code></pre>
-<p>Uma consulta para acessar a informação do nome, poderia ser (<a href="sparql_data/q-union1.rq">q-union1.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- { [] foaf:name ?name } UNION { [] vCard:FN ?name }
-}
-</code></pre>
-<p>isso retorna:</p>
-<pre><code>-----------------
-| name |
-=================
-| "Matt Jones" |
-| "Sarah Jones" |
-| "Becky Smith" |
-| "John Smith" |
------------------
-</code></pre>
-<p>Não importa que forma de expressão usasse para o nome, a variável ?name é preenchida. Isso pode ser obtido usando um <code>FILTER</code> como mostra essa consulta (<a href="sparql_data/q-union1alt.rq">q-union-1alt.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name
-WHERE
-{
- [] ?p ?name
- FILTER ( ?p = foaf:name || ?p = vCard:FN )
-}
-</code></pre>
-<p>testando se a propriedade é uma URI ou a outra. As soluções podem não vir na mesma ordem. A primeira forma é conhecida como a mais rápida, dependendo dos dados e do armazenamento utilizado, porque a segunda forma tem que pegar todas as triplas do grafo para casar com o padrão da tripla com variáveis não ligadas (ou blank nodes) em cada slot, então testa cada ?p para ver se casa com algum dos valores. Isso vai depender da sofisticação do otimizador de consultas para saber se ele vai e [...]
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://xmlns.com/foaf/0.1/></span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#a2f;font-weight:bold">@prefix</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#bbb"> </span><span style="color:#b8860b"><http://www.w3.org/2001/vcard-rdf/3.0#></span><span style="color:#bbb"> </span>.<span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">a</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">b</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">foaf:</span><span style="color:#008000;font-weight:bold">name</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">c</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span>.<span style="c [...]
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">_</span><span style="color:#00f;font-weight:bold">:</span><span style="color:#008000;font-weight:bold">d</span><span style="color:#bbb"> </span><span style="color:#00f;font-weight:bold">vcard:</span><span style="color:#008000;font-weight:bold">FN</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span>.<span style="co [...]
+</span></span></span></code></pre></div><p>Uma consulta para acessar a informação do nome, poderia ser (<a href="sparql_data/q-union1.rq">q-union1.rq</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { [] <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { [] <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>isso retorna:</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">-----------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">name</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">-----------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Não importa que forma de expressão usasse para o nome, a variável ?name é preenchida. Isso pode ser obtido usando um <code>FILTER</code> como mostra essa consulta (<a href="sparql_data/q-union1alt.rq">q-union-1alt.rq</a>):</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> [] <span style="color:#b8860b">?p</span> <span style="color:#b8860b">?name</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">FILTER</span> ( <span style="color:#b8860b">?p</span> <span style="color:#666">=</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#666">||</span> <span style="color:#b8860b">?p</span> <span style="color:#666">=</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight: [...]
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><p>testando se a propriedade é uma URI ou a outra. As soluções podem não vir na mesma ordem. A primeira forma é conhecida como a mais rápida, dependendo dos dados e do armazenamento utilizado, porque a segunda forma tem que pegar todas as triplas do grafo para casar com o padrão da tripla com variáveis não ligadas (ou blank nodes) em cada slot, então testa cada ?p para ver se casa com algum dos valores. Isso vai depender da sofisticação do otimizador de [...]
<h2 id="union---relembrando-onde-o-dado-foi-encontrado">Union - relembrando onde o dado foi encontrado.</h2>
<p>O exemplo acima usou a mesma variável em cada ramo. Se diferentes variáveis forem usadas, a aplicação pode descobrir que sub-padrão causou o casamento (<a href="sparql_data/q-union2.rq">q-union2.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name1 ?name2
-WHERE
-{
- { [] foaf:name ?name1 } UNION { [] vCard:FN ?name2 }
-}
-
----------------------------------
-| name1 | name2 |
-=================================
-| "Matt Jones" | |
-| "Sarah Jones" | |
-| | "Becky Smith" |
-| | "John Smith" |
----------------------------------
-</code></pre>
-<p>Essa segunda consulta guardou informação sobre onde o name da pessoa se originou atribuindo o nome para diferentes variáveis.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name1</span> <span style="color:#b8860b">?name2</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> { [] <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name1</span> } <span style="color:#a2f;font-weight:bold">UNION</span> { [] <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name2</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Essa segunda consulta guardou informação sobre onde o name da pessoa se originou atribuindo o nome para diferentes variáveis.</p>
<h2 id="optional-e-union">OPTIONAL e UNION</h2>
<p>Na prática, <code>OPTIONAL</code> é mais comum que <code>UNION</code> mas ambas têm seu uso. <code>OPTIONAL</code> é útil para aumentar as soluções encontradas, <code>UNION</code> é útil para concatenar soluções de diferentes possibilidades. Eles não retornam necessariamente a informação da mesma maneira.</p>
<p>Consulta(<a href="sparql_data/q-union3.rq">q-union3.rq</a>):</p>
-<pre><code>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
-
-SELECT ?name1 ?name2
-WHERE
-{
- ?x a foaf:Person
- OPTIONAL { ?x foaf:name ?name1 }
- OPTIONAL { ?x vCard:FN ?name2 }
-}
-
----------------------------------
-| name1 | name2 |
-=================================
-| "Matt Jones" | |
-| "Sarah Jones" | |
-| | "Becky Smith" |
-| | "John Smith" |
----------------------------------
-</code></pre>
-<p>Mas cuidado ao usar <code>?name</code> em cada <code>OPTIONAL</code> porque isso é uma consulta dependente da ordem.</p>
+<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sparql" data-lang="sparql"><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">foaf</span>: <span style="color:#a0a000"><http://xmlns.com/foaf/0.1/></span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">PREFIX</span> <span style="color:#00f;font-weight:bold">vCard</span>: <span style="color:#a0a000"><http://www.w3.org/2001/vcard-rdf/3.0#></span>
+</span></span><span style="display:flex;"><span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">SELECT</span> <span style="color:#b8860b">?name1</span> <span style="color:#b8860b">?name2</span>
+</span></span><span style="display:flex;"><span><span style="color:#a2f;font-weight:bold">WHERE</span>
+</span></span><span style="display:flex;"><span>{
+</span></span><span style="display:flex;"><span> <span style="color:#b8860b">?x</span> <span style="color:#a2f;font-weight:bold">a</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">Person</span>
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">foaf</span>:<span style="color:#008000;font-weight:bold">name</span> <span style="color:#b8860b">?name1</span> }
+</span></span><span style="display:flex;"><span> <span style="color:#a2f;font-weight:bold">OPTIONAL</span> { <span style="color:#b8860b">?x</span> <span style="color:#00f;font-weight:bold">vCard</span>:<span style="color:#008000;font-weight:bold">FN</span> <span style="color:#b8860b">?name2</span> }
+</span></span><span style="display:flex;"><span>}
+</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-turtle" data-lang="turtle"><span style="display:flex;"><span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e1</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">nam</span><span style="color:#666">e2</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">=================================</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Matt Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Sarah Jones"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"Becky Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">|</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb"> </span><span style="color:#b44">"John Smith"</span><span style="color:#bbb"> </span><span style="">|</span><span style="color:#bbb">
+</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="">---------------------------------</span><span style="color:#bbb">
+</span></span></span></code></pre></div><p>Mas cuidado ao usar <code>?name</code> em cada <code>OPTIONAL</code> porque isso é uma consulta dependente da ordem.</p>
<p><a href="sparql_datasets_pt.html">Próximo: Grafos Nomeados</a></p>
</article>