Author: buildbot
Date: Thu May 30 17:37:57 2019
New Revision: 1045734
Log:
Staging update by buildbot for jena
Added:
websites/staging/jena/trunk/content/documentation/geosparql/
websites/staging/jena/trunk/content/documentation/geosparql/geosparql-fuseki.html
websites/staging/jena/trunk/content/documentation/geosparql/index.html
Modified:
websites/staging/jena/trunk/content/ (props changed)
Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu May 30 17:37:57 2019
@@ -1 +1 @@
-1860403
+1860412
Added:
websites/staging/jena/trunk/content/documentation/geosparql/geosparql-fuseki.html
==============================================================================
---
websites/staging/jena/trunk/content/documentation/geosparql/geosparql-fuseki.html
(added)
+++
websites/staging/jena/trunk/content/documentation/geosparql/geosparql-fuseki.html
Thu May 30 17:37:57 2019
@@ -0,0 +1,343 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE- 2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <title>Apache Jena - GeoSPARQL Fuseki</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+ <link href="/css/bootstrap-extension.css" rel="stylesheet" type="text/css">
+ <link href="/css/jena.css" rel="stylesheet" type="text/css">
+ <link rel="shortcut icon" href="/images/favicon.ico" />
+
+ <script
+ src="https://code.jquery.com/jquery-2.2.4.min.js"
+ integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
+ crossorigin="anonymous"></script>
+ <script src="/js/jena-navigation.js" type="text/javascript"></script>
+ <script src="/js/bootstrap.min.js" type="text/javascript"></script>
+ <script src="/js/breadcrumbs.js" type="text/javascript"></script>
+
+ <script src="/js/improve.js" type="text/javascript"></script>
+
+
+ <!-- Uncomment to enable code coloring <link href="/css/codehilite.css"
rel="stylesheet" type="text/css"> -->
+
+</head>
+
+<body>
+
+
+
+<nav class="navbar navbar-default" role="navigation">
+<div class="container">
+ <div class="navbar-header">
+
+ <button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-ex1-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/index.html">
+ <img class="logo-menu" src="/images/jena-logo/jena-logo-notext-small.png"
alt="jena logo">Apache Jena</a>
+ </div>
+
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <ul class="nav navbar-nav">
+ <li id="homepage"><a href="/index.html"><span class="glyphicon
glyphicon-home"></span> Home</a></li>
+ <li id="download"><a href="/download/index.cgi"><span
class="glyphicon glyphicon-download-alt"></span> Download</a></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-book"></span> Learn <b
class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li class="dropdown-header">Tutorials</li>
+ <li><a href="/tutorials/index.html">Overview</a></li>
+ <li><a href="/tutorials/rdf_api.html">RDF core API
tutorial</a></li>
+ <li><a href="/tutorials/sparql.html">SPARQL tutorial</a></li>
+ <li><a
href="/documentation/query/manipulating_sparql_using_arq.html">Manipulating
SPARQL using ARQ</a></li>
+ <li><a href="/tutorials/using_jena_with_eclipse.html">Using
Jena with Eclipse</a></li>
+ <li><a
href="/documentation/notes/index.html">How-To's</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">References</li>
+ <li><a href="/documentation/index.html">Overview</a></li>
+ <li><a href="/documentation/javadoc/">Javadoc</a></li>
+ <li><a href="/documentation/rdf/index.html">RDF API</a></li>
+ <li><a href="/documentation/io/">RDF I/O</a></li>
+ <li><a href="/documentation/query/index.html">ARQ
(SPARQL)</a></li>
+ <li><a href="/documentation/rdfconnection/">RDF Connection -
SPARQL API</a></li>
+ <li><a href="/documentation/hadoop/index.html">Elephas -
tools for RDF on Hadoop</a></li>
+ <li><a href="/documentation/query/text-query.html">Text
Search</a></li>
+ <li><a href="/documentation/tdb/index.html">TDB</a></li>
+ <li><a href="/documentation/sdb/index.html">SDB</a></li>
+ <li><a href="/documentation/jdbc/index.html">SPARQL over
JDBC</a></li>
+ <li><a
href="/documentation/fuseki2/index.html">Fuseki</a></li>
+ <li><a
href="/documentation/permissions/index.html">Permissions</a></li>
+ <li><a
href="/documentation/assembler/index.html">Assembler</a></li>
+ <li><a href="/documentation/ontology/">Ontology API</a></li>
+ <li><a href="/documentation/inference/index.html">Inference
API</a></li>
+ <li><a href="/documentation/tools/index.html">Command-line
tools</a></li>
+ <li><a
href="/documentation/extras/index.html">Extras</a></li>
+ </ul>
+ </li>
+
+ <li class="drop down">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-book"></span> Javadoc
<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="/documentation/javadoc/jena/">Jena Core</a></li>
+ <li><a href="/documentation/javadoc/arq/">ARQ</a></li>
+ <li><a href="/documentation/javadoc/tdb/">TDB</a></li>
+ <li><a href="/documentation/javadoc/fuseki2/">Fuseki</a></li>
+ <li><a
href="/documentation/javadoc/elephas/">Elephas</a></li>
+ <li><a href="/documentation/javadoc/text/">Text
Search</a></li>
+ <li><a href="/documentation/javadoc/spatial/">Spatial
Search</a></li>
+ <li><a
href="/documentation/javadoc/permissions/">Permissions</a></li>
+ <li><a href="/documentation/javadoc/jdbc/">JDBC</a></li>
+ <li><a href="/documentation/javadoc/">All Javadoc</a></li>
+ </ul>
+ </li>
+
+ <li id="ask"><a href="/help_and_support/index.html"><span
class="glyphicon glyphicon-question-sign"></span> Ask</a></li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-bullhorn"></span> Get
involved <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a
href="/getting_involved/index.html">Contribute</a></li>
+ <li><a
href="/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">Project</li>
+ <li><a href="/about_jena/about.html">About Jena</a></li>
+ <li><a href="/about_jena/roadmap.html">Roadmap</a></li>
+ <li><a
href="/about_jena/architecture.html">Architecture</a></li>
+ <li><a href="/about_jena/team.html">Project team</a></li>
+ <li><a href="/about_jena/contributions.html">Related
projects</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">ASF</li>
+ <li><a href="http://www.apache.org/">Apache Software
Foundation</a></li>
+ <li><a
href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+ <li><a
href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+ <li><a
href="http://www.apache.org/foundation/sponsorship.html">Become a
Sponsor</a></li>
+ <li><a
href="http://www.apache.org/security/">Security</a></li>
+ </ul>
+ </li>
+
+ <li id="edit"><a
href="javascript:improveThisPage(location.href);" title="Improve this Page (Use
username anonymous and empty password)"><span class="glyphicon
glyphicon-pencil"></span> Improve this Page</a></li>
+ </ul>
+ </div>
+</div>
+</nav>
+
+
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <div id="breadcrumbs"></div>
+ <h1 class="title">GeoSPARQL Fuseki</h1>
+ <style type="text/css">
+/* The following code is added by mdx_elementid.py
+ It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+ visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink,
h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink,
dt:hover > .elementid-permalink { visibility: visible }</style>
+<p>This application provides a HTTP server compliant with the GeoSPARQL
standard.
+It uses the embedded server Fuseki from Apache Jena and provides additional
parameters for dataset loading.</p>
+<p>The project uses the GeoSPARQL implementation from the <a
href="index">GeoSPARQL Jena project</a>.
+Currently, there is no GUI interface as provided in the Fuseki
distribution.</p>
+<p>A subset of the EPSG spatial/coordinate reference systems are included by
default from the Apache SIS project (http://sis.apache.org).
+The full EPSG dataset is not distributed due to the the EPSG terms of use
being incompatible with the Apache Licence.
+Several options are available to include the EPSG dataset by setting the
<code>SIS_DATA</code> environment variable
(http://sis.apache.org/epsg.html).</p>
+<p>It is expected that at least one Geometry Literal or Geo Predicate is
present in a dataset.
+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>
+<h2 id="getting-started">Getting Started<a class="headerlink"
href="#getting-started" title="Permanent link">¶</a></h2>
+<p>GeoSPARQL Fuskei 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">GeoSPARQL Jena project</a>.</p>
+<p><code><dependency>
+ <groupId>org.apache.jena</groupId>
+ <artifactId>fuseki-geosparql</artifactId>
+ <version>...</version>
+</dependency></code></p>
+<h3 id="command-line">Command Line<a class="headerlink" href="#command-line"
title="Permanent link">¶</a></h3>
+<p>Run from the command line (see <code>releases</code> tab) and send queries
over HTTP.</p>
+<p>Get Started Example:
+<code>.\geosparql-fuseki.bat -rf "geosparql_test.rdf>xml" -i</code></p>
+<p>The example file <code>geosparql_test.rdf</code> in the GitHub repository
contains several geometries in geodectic WGS84 (EPSG:4326).
+The example file <code>geosparql_test_27700.rdf</code> is identical but in the
projected OSGB36 (EPSG:27770) used in the United Kingdom.
+Both will return the same results as GeoSPARQL treats all SRS as being
projected.
+RDFS inferencing is applied using the GeoSPARQL schema to infer additional
relationships (which aren't asserted in the example files) that are used in the
spatial operations and data retrieval.</p>
+<p>Examples:</p>
+<ul>
+<li>
+<p>Load RDF file (XML format) into memory and run server:
<code>.\geosparql-fuseki.bat -rf "test.rdf>xml"</code></p>
+</li>
+<li>
+<p>Load RDF file (TTL format: default) into memory, apply GeoSPARQL schema
with RDFS inferencing and run server: <code>.\geosparql-fuseki.bat -rf
"test.rdf" -i</code></p>
+</li>
+<li>
+<p>Load RDF file into memory, write spatial index to file and run server:
<code>.\geosparql-fuseki.bat -rf "test.rdf" -si "spatial.index"</code></p>
+</li>
+<li>
+<p>Load RDF file into persistent TDB and run server:
<code>.\geosparql-fuseki.bat -rf "test.rdf>xml" -t ".\TestTDB"</code></p>
+</li>
+<li>
+<p>Load from persistent TDB and run server: <code>.\geosparql-fuseki.bat -t
".\TestTDB"</code></p>
+</li>
+<li>
+<p>Load from persistent TDB, change port and run server:
<code>.\geosparql-fuseki.bat -t ".\TestTDB" -p 3030</code></p>
+</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>xml""". 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 .bat
exceeds the character limit and needs shortening.</p>
+<h3 id="embedded-server">Embedded Server<a class="headerlink"
href="#embedded-server" title="Permanent link">¶</a></h3>
+<p>Run within a Java application to provide GeoSPARQL support over HTTP to
other applications:</p>
+<p><code>GeosparqlServer server = new GeosparqlServer(portNumber, datasetName,
isLoopbackOnly, dataset, isUpdate);</code></p>
+<h2 id="sparql-query-example">SPARQL Query Example<a class="headerlink"
href="#sparql-query-example" title="Permanent link">¶</a></h2>
+<p>Once the default server is running it can be queried using Apache Jena as
follows:</p>
+<p><code>String service = "http://localhost:3030/ds";
+String query = ....;
+try (QueryExecution qe = QueryExecutionFactory.sparqlService(service, query)) {
+ ResultSet rs = qe.execSelect();
+ ResultSetFormatter.outputAsTSV(rs);
+}</code></p>
+<p>The server will respond to any valid SPARQL HTTP so an alternative SPARQL
framework can be used.
+More information on SPARQL querying using Apache Jena can be found on their
website (https://jena.apache.org/tutorials/sparql.html).</p>
+<h2 id="sis_data-environment-variable">SIS_DATA Environment Variable<a
class="headerlink" href="#sis_data-environment-variable" title="Permanent
link">¶</a></h2>
+<p>The Apache SIS library is used to support the recognition and
transformation of Coordinate/Spatial Reference Systems.
+These Reference Systems are published as the EPSG dataset.
+The full EPSG dataset is not distributed due to the EPSG terms of use being
incompatible with the Apache Licence.
+A subset of the EPSG spatial/coordinate reference systems are included by
default but the wider dataset may be required.
+Several options are available to include the EPSG dataset by setting the
<code>SIS_DATA</code> environment variable
(http://sis.apache.org/epsg.html).</p>
+<p>An embedded EPSG dataset can be included in an application by adding the
following dependency:</p>
+<ul>
+<li>
+<p>Gradle dependency in <code>build.gradle</code>
+<code>ext.sisVersion = "0.8"
+implementation
"org.apache.sis.non-free:sis-embedded-data:$sisVersion"</code></p>
+</li>
+<li>
+<p>Maven dependency in <code>pom.xml</code>
+<code><dependency>
+ <groupId>org.apache.sis.non-free</groupId>
+ <artifactId>sis-embedded-data</artifactId>
+ <version>0.8</version>
+</dependency></code></p>
+</li>
+</ul>
+<h2 id="command-line-arguments">Command Line Arguments<a class="headerlink"
href="#command-line-arguments" title="Permanent link">¶</a></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<a class="headerlink" href="#1-port" title="Permanent
link">¶</a></h3>
+<p><code>--port, -p</code></p>
+<p>The port number of the server. Default: 3030</p>
+<h3 id="2-dataset-name">2) Dataset name<a class="headerlink"
href="#2-dataset-name" title="Permanent link">¶</a></h3>
+<p><code>--dataset, -d</code></p>
+<p>The name of the dataset used in the URL. Default: ds</p>
+<h3 id="3-loopback-only">3) Loopback only<a class="headerlink"
href="#3-loopback-only" title="Permanent link">¶</a></h3>
+<p><code>--loopback, -l</code></p>
+<p>The server only accepts local host loopback requests. Default: true</p>
+<h3 id="4-sparql-update-allowed">4) SPARQL update allowed<a class="headerlink"
href="#4-sparql-update-allowed" title="Permanent link">¶</a></h3>
+<p><code>--update, -u</code></p>
+<p>The server accepts updates to modify the dataset. Default: false</p>
+<h3 id="5-tdb-folder">5) TDB folder<a class="headerlink" href="#5-tdb-folder"
title="Permanent link">¶</a></h3>
+<p><code>--tdb, -t</code></p>
+<p>An existing or new TDB folder used for the dataset. Default set to memory
dataset.
+If accessing a dataset for the first time with GeoSPARQL then consider the
<code>--inference</code>, <code>--default_geometry</code> and
<code>--validate</code> options. These operations may add additional statements
to the dataset.</p>
+<h3 id="6-load-rdf-file-into-dataset">6) Load RDF file into dataset<a
class="headerlink" href="#6-load-rdf-file-into-dataset" title="Permanent
link">¶</a></h3>
+<p><code>--rdf_file, -rf</code></p>
+<p>Comma separated list of [RDF file path#graph name&RDF format] to load
into dataset. Graph name is optional and will use default graph. RDF format is
optional (default: ttl) or select from one of the following: json-ld, json-rdf,
nt, nq, thrift, trig, trix, ttl, ttl-pretty, xml, xml-plain, xml-pretty.
+e.g. <code>test.rdf#test&xml,test2.rdf</code> will load <em>test.rdf</em>
file into <em>test</em> graph as <em>RDF/XML</em> and <em>test2.rdf</em> into
<em>default</em> graph as <em>TTL</em>.</p>
+<p>Consider the <code>--inference</code>, <code>--default_geometry</code> and
<code>--validate</code> options. These operations may add additional statements
to the dataset.</p>
+<h3 id="7-load-tabular-file-into-dataset">7) Load Tabular file into dataset<a
class="headerlink" href="#7-load-tabular-file-into-dataset" title="Permanent
link">¶</a></h3>
+<p><code>--tabular_file, -tf</code></p>
+<p>Comma separated list of [Tabular file path#graph name|delimiter] to load
into dataset. See RDF Tables for table formatting. Graph name is optional and
will use default graph. Column delimiter is optional and will default to COMMA.
Any character except ':', '^' and '|'. Keywords TAB, SPACE and COMMA are also
supported.
+e.g. <code>test.rdf#test|TAB,test2.rdf</code> will load <em>test.rdf</em> file
into <em>test</em> graph as <em>TAB</em> delimited and <em>test2.rdf</em> into
<em>default</em> graph as <em>COMMA</em> delimited.</p>
+<p>See RDF Tables project (https://github.com/galbiston/rdf-tables) for more
details on tabular format.</p>
+<p>Consider the <code>--inference</code>, <code>--default_geometry</code> and
<code>--validate</code> options. These operations may add additional statements
to the dataset.</p>
+<h3 id="8-geosparql-rdfs-inference">8) GeoSPARQL RDFS inference<a
class="headerlink" href="#8-geosparql-rdfs-inference" title="Permanent
link">¶</a></h3>
+<p><code>--inference, -i</code></p>
+<p>Enable GeoSPARQL RDFS schema and inferencing (class and property
hierarchy). Inferences will be applied to the dataset. Updates to dataset may
require server restart. Default: false</p>
+<h3 id="9-apply-hasdefaultgeometry">9) Apply hasDefaultGeometry<a
class="headerlink" href="#9-apply-hasdefaultgeometry" title="Permanent
link">¶</a></h3>
+<p><code>--default_geometry, -dg</code></p>
+<p>Apply hasDefaultGeometry to single Feature hasGeometry Geometry statements.
Additional properties will be added to the dataset. Default: false</p>
+<h3 id="10-validate-geometry-literals">10) Validate Geometry Literals<a
class="headerlink" href="#10-validate-geometry-literals" title="Permanent
link">¶</a></h3>
+<p><code>--validate, -v</code></p>
+<p>Validate that the Geometry Literals in the dataset are valid. Default:
false</p>
+<h3 id="11-convert-geo-predicates">11) Convert Geo predicates<a
class="headerlink" href="#11-convert-geo-predicates" title="Permanent
link">¶</a></h3>
+<p><code>--convert_geo, -c</code></p>
+<p>Convert Geo predicates in the data to Geometry with WKT WGS84 Point
GeometryLiteral. Default: false</p>
+<h3 id="12-remove-geo-predicates">12) Remove Geo predicates<a
class="headerlink" href="#12-remove-geo-predicates" title="Permanent
link">¶</a></h3>
+<p><code>--remove_geo, -rg</code></p>
+<p>Remove Geo predicates in the data after combining to Geometry.</p>
+<h3 id="13-query-rewrite-enabled">13) Query Rewrite enabled<a
class="headerlink" href="#13-query-rewrite-enabled" title="Permanent
link">¶</a></h3>
+<p><code>--rewrite, -r</code></p>
+<p>Enable query rewrite extension of GeoSPARQL standard to simplify queries,
which relies upon the 'hasDefaultGeometry' property. The 'default_geometry' may
be useful for adding the 'hasDefaultGeometry' to a dataset. Default: true</p>
+<h3 id="14-indexing-enabled">14) Indexing enabled<a class="headerlink"
href="#14-indexing-enabled" title="Permanent link">¶</a></h3>
+<p><code>--index, -x</code></p>
+<p>Enable caching of re-usable data to improve query performance. Default: true
+See <a href="index">GeoSPARQL Jena project</a> for more details.</p>
+<h3 id="15-index-sizes">15) Index sizes<a class="headerlink"
href="#15-index-sizes" title="Permanent link">¶</a></h3>
+<p><code>--index_sizes, -xs</code></p>
+<p>List of Index item sizes: [Geometry Literal, Geometry Transform, Query
Rewrite]. Unlimited: -1, Off: 0 Unlimited: -1, Off: 0, Default: -1,-1,-1</p>
+<h3 id="16-index-expiries">16) Index expiries<a class="headerlink"
href="#16-index-expiries" title="Permanent link">¶</a></h3>
+<p><code>--index_expiry, -xe</code></p>
+<p>List of Index item expiry in milliseconds: [Geometry Literal, Geometry
Transform, Query Rewrite]. Off: 0, Minimum: 1001, Default: 5000,5000,5000</p>
+<h3 id="17-spatial-index-file">17) Spatial Index file<a class="headerlink"
href="#17-spatial-index-file" title="Permanent link">¶</a></h3>
+<p><code>--spatial_index, -si</code></p>
+<p>File to load or store the spatial index. Default to "spatial.index" in TDB
folder if using TDB and not set. Otherwise spatial index is not stored.</p>
+<h3 id="18-properties-file">18) Properties File<a class="headerlink"
href="#18-properties-file" title="Permanent link">¶</a></h3>
+<p>Supply the above parameters as a file:
+<code>console
+$ java Main @/tmp/parameters</code></p>
+<h2 id="future-work">Future Work<a class="headerlink" href="#future-work"
title="Permanent link">¶</a></h2>
+<ul>
+<li>GUI to assist users when querying a dataset.</li>
+</ul>
+<p><img alt="Powered by Apache Jena"
src="https://www.apache.org/logos/comdev-test/poweredby/jena.png"
title="Powered by Apache Jena" /></p>
+ </div>
+</div>
+
+</div><!--/.container -->
+
+ <footer class="footer">
+ <div class="container">
+ <p>Copyright © 2011–2019 The Apache Software Foundation,
Licensed under
+ the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
License, Version 2.0</a>.
+ </p>
+ <p>
+ Apache Jena, Jena, the Apache Jena project logo,
+ Apache and the Apache feather logos are trademarks of The Apache
Software Foundation.
+ </p>
+ </div>
+ </footer>
+
+ <!-- for marking links as active in the navbar-menu -->
+ <script type="text/javascript">
+ var link = $('a[href="' + this.location.pathname + '"]');
+ if (link != undefined)
+ link.parents('li,ul').addClass('active');
+ </script>
+
+</body>
+</html>
Added: websites/staging/jena/trunk/content/documentation/geosparql/index.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/geosparql/index.html
(added)
+++ websites/staging/jena/trunk/content/documentation/geosparql/index.html Thu
May 30 17:37:57 2019
@@ -0,0 +1,822 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE- 2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <title>Apache Jena - Apache Jena GeoSPARQL</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+ <link href="/css/bootstrap-extension.css" rel="stylesheet" type="text/css">
+ <link href="/css/jena.css" rel="stylesheet" type="text/css">
+ <link rel="shortcut icon" href="/images/favicon.ico" />
+
+ <script
+ src="https://code.jquery.com/jquery-2.2.4.min.js"
+ integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
+ crossorigin="anonymous"></script>
+ <script src="/js/jena-navigation.js" type="text/javascript"></script>
+ <script src="/js/bootstrap.min.js" type="text/javascript"></script>
+ <script src="/js/breadcrumbs.js" type="text/javascript"></script>
+
+ <script src="/js/improve.js" type="text/javascript"></script>
+
+
+ <!-- Uncomment to enable code coloring <link href="/css/codehilite.css"
rel="stylesheet" type="text/css"> -->
+
+</head>
+
+<body>
+
+
+
+<nav class="navbar navbar-default" role="navigation">
+<div class="container">
+ <div class="navbar-header">
+
+ <button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-ex1-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/index.html">
+ <img class="logo-menu" src="/images/jena-logo/jena-logo-notext-small.png"
alt="jena logo">Apache Jena</a>
+ </div>
+
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <ul class="nav navbar-nav">
+ <li id="homepage"><a href="/index.html"><span class="glyphicon
glyphicon-home"></span> Home</a></li>
+ <li id="download"><a href="/download/index.cgi"><span
class="glyphicon glyphicon-download-alt"></span> Download</a></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-book"></span> Learn <b
class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li class="dropdown-header">Tutorials</li>
+ <li><a href="/tutorials/index.html">Overview</a></li>
+ <li><a href="/tutorials/rdf_api.html">RDF core API
tutorial</a></li>
+ <li><a href="/tutorials/sparql.html">SPARQL tutorial</a></li>
+ <li><a
href="/documentation/query/manipulating_sparql_using_arq.html">Manipulating
SPARQL using ARQ</a></li>
+ <li><a href="/tutorials/using_jena_with_eclipse.html">Using
Jena with Eclipse</a></li>
+ <li><a
href="/documentation/notes/index.html">How-To's</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">References</li>
+ <li><a href="/documentation/index.html">Overview</a></li>
+ <li><a href="/documentation/javadoc/">Javadoc</a></li>
+ <li><a href="/documentation/rdf/index.html">RDF API</a></li>
+ <li><a href="/documentation/io/">RDF I/O</a></li>
+ <li><a href="/documentation/query/index.html">ARQ
(SPARQL)</a></li>
+ <li><a href="/documentation/rdfconnection/">RDF Connection -
SPARQL API</a></li>
+ <li><a href="/documentation/hadoop/index.html">Elephas -
tools for RDF on Hadoop</a></li>
+ <li><a href="/documentation/query/text-query.html">Text
Search</a></li>
+ <li><a href="/documentation/tdb/index.html">TDB</a></li>
+ <li><a href="/documentation/sdb/index.html">SDB</a></li>
+ <li><a href="/documentation/jdbc/index.html">SPARQL over
JDBC</a></li>
+ <li><a
href="/documentation/fuseki2/index.html">Fuseki</a></li>
+ <li><a
href="/documentation/permissions/index.html">Permissions</a></li>
+ <li><a
href="/documentation/assembler/index.html">Assembler</a></li>
+ <li><a href="/documentation/ontology/">Ontology API</a></li>
+ <li><a href="/documentation/inference/index.html">Inference
API</a></li>
+ <li><a href="/documentation/tools/index.html">Command-line
tools</a></li>
+ <li><a
href="/documentation/extras/index.html">Extras</a></li>
+ </ul>
+ </li>
+
+ <li class="drop down">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-book"></span> Javadoc
<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="/documentation/javadoc/jena/">Jena Core</a></li>
+ <li><a href="/documentation/javadoc/arq/">ARQ</a></li>
+ <li><a href="/documentation/javadoc/tdb/">TDB</a></li>
+ <li><a href="/documentation/javadoc/fuseki2/">Fuseki</a></li>
+ <li><a
href="/documentation/javadoc/elephas/">Elephas</a></li>
+ <li><a href="/documentation/javadoc/text/">Text
Search</a></li>
+ <li><a href="/documentation/javadoc/spatial/">Spatial
Search</a></li>
+ <li><a
href="/documentation/javadoc/permissions/">Permissions</a></li>
+ <li><a href="/documentation/javadoc/jdbc/">JDBC</a></li>
+ <li><a href="/documentation/javadoc/">All Javadoc</a></li>
+ </ul>
+ </li>
+
+ <li id="ask"><a href="/help_and_support/index.html"><span
class="glyphicon glyphicon-question-sign"></span> Ask</a></li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown"><span class="glyphicon glyphicon-bullhorn"></span> Get
involved <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a
href="/getting_involved/index.html">Contribute</a></li>
+ <li><a
href="/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">Project</li>
+ <li><a href="/about_jena/about.html">About Jena</a></li>
+ <li><a href="/about_jena/roadmap.html">Roadmap</a></li>
+ <li><a
href="/about_jena/architecture.html">Architecture</a></li>
+ <li><a href="/about_jena/team.html">Project team</a></li>
+ <li><a href="/about_jena/contributions.html">Related
projects</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-header">ASF</li>
+ <li><a href="http://www.apache.org/">Apache Software
Foundation</a></li>
+ <li><a
href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+ <li><a
href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+ <li><a
href="http://www.apache.org/foundation/sponsorship.html">Become a
Sponsor</a></li>
+ <li><a
href="http://www.apache.org/security/">Security</a></li>
+ </ul>
+ </li>
+
+ <li id="edit"><a
href="javascript:improveThisPage(location.href);" title="Improve this Page (Use
username anonymous and empty password)"><span class="glyphicon
glyphicon-pencil"></span> Improve this Page</a></li>
+ </ul>
+ </div>
+</div>
+</nav>
+
+
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <div id="breadcrumbs"></div>
+ <h1 class="title">Apache Jena GeoSPARQL</h1>
+ <style type="text/css">
+/* The following code is added by mdx_elementid.py
+ It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+ visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink,
h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink,
dt:hover > .elementid-permalink { visibility: visible }</style>
+<p>An implementation of GeoSPARQL 1.0 standard for SPARQL query or API.</p>
+<h2 id="features">Features<a class="headerlink" href="#features"
title="Permanent link">¶</a></h2>
+<p>This implementation follows the 11-052r4 OGC GeoSPARQL standard
(http://www.opengeospatial.org/standards/geosparql).
+The implementation is pure Java and does not require any set-up or
configuration of any third party relational databases and geospatial
extensions.</p>
+<p>It implements the six Conformance Classes described in the GeoSPARQL
document:</p>
+<ul>
+<li>Core</li>
+<li>Topology Vocabulary</li>
+<li>Geometry Extension</li>
+<li>Geometry Topology</li>
+<li>RDFS Entailment Extension</li>
+<li>Query Rewrite Extension</li>
+</ul>
+<p>The WKT (as described in 11-052r4) and GML 2.0 Simple Features Profile
(10-100r3) serialisations are supported.
+Additional serialisations can be implemented by extending the
+<code>org.apache.jena.geosparql.implementation.datatype.GeometryDatatype</code>
+and registering with Apache Jena's
<code>org.apache.jena.datatypes.TypeMapper</code>.</p>
+<p>All three spatial relation families are supported: <em>Simple Feature</em>,
<em>Egenhofer</em> and <em>RCC8</em>.</p>
+<p>Indexing and caching of spatial objects and relations is performed
<em>on-demand</em> during query execution.
+Therefore, set-up delays should be minimal.</p>
+<p>Benchmarking of the implementation against Strabon and Parliament has found
it to be comparable or quicker.
+The benchmarking used was the Geographica query and dataset
(http://geographica.di.uoa.gr/).
+Publication of the benchmarking results are forthcoming.</p>
+<h2 id="additional-features">Additional Features<a class="headerlink"
href="#additional-features" title="Permanent link">¶</a></h2>
+<p>The following additional features are also provided:</p>
+<ul>
+<li>Geometry properties are automatically calculated and do not need to be
asserted in the dataset.</li>
+<li>Conversion between EPSG spatial/coordinate reference systems is applied
automatically. Therefore, mixed datasets or querying can be applied. This is
reliance upon local installation of Apache SIS EPSG dataset, see <strong>Key
Dependencies</strong>.</li>
+<li>Units of measure are automatically converted to the appropriate units for
the coordinate reference system.</li>
+<li>Geometry, transformation and spatial relation results are stored in
persistent and configurable time-limited caches to improve response times and
reduce recalculations.</li>
+<li>Dataset conversion between serialisations and spatial/coordinate reference
systems. Tabular data can also be loaded, see RDF Tables project
(https://github.com/galbiston/rdf-tables).</li>
+<li>Functions to test Geometry properties directly on Geometry Literals have
been included for convenience.</li>
+</ul>
+<h2 id="getting-started">Getting Started<a class="headerlink"
href="#getting-started" title="Permanent link">¶</a></h2>
+<p>GeoSPARQL Jena can be accessed as a library using Maven etc. from Maven
Central.</p>
+<p><code><dependency>
+ <groupId>org.apache.jena</groupId>
+ <artifactId>jena-geosparql</artifactId>
+ <version>...</version>
+</dependency></code></p>
+<p>A HTTP server (SPARQL endpoint) using is available - for details, see the
<a href="geosparql-fuseki">Geosparql Fuseki documentation</a>.</p>
+<h3 id="sparql-query-configuration">SPARQL Query Configuration<a
class="headerlink" href="#sparql-query-configuration" title="Permanent
link">¶</a></h3>
+<p>Using the library for SPARQL querying requires one line of code.
+All indexing and caching is performed during query execution and so there
should be minimal delay during initialisation.
+This will register the Property Functions with ARQ query engine and configures
the <em>indexes</em> used for time-limited caching.</p>
+<p>There are three <em>indexes</em> which can be configured independently or
switched off.
+These <em>indexes</em> retain data that may be required again when a query is
being executed but may not be required between different queries.
+Therefore, the memory usage will grow during query execution and then recede
as data is not re-used.
+All the <em>indexes</em> support concurrency and can be set to a maximum size
or allowed to increase capacity as required.</p>
+<ul>
+<li><em>Geometry Literal</em>: Geometry objects following de-serialisation
from <code>Geometry Literal</code>.</li>
+<li><em>Geometry Transform</em>: Geometry objects resulting from coordinate
transformations between spatial reference systems.</li>
+<li><em>Query Rewrite</em>: results of spatial relations between
<code>Feature</code> and <code>Geometry</code> spatial objects.</li>
+</ul>
+<p>Testing has found up to 20% improvement in query completion durations using
the indexes.
+The <em>indexes</em> can be configured by size, retention duration and
frequency of clean up.</p>
+<ul>
+<li>
+<p>Basic setup with default values:
<code>GeoSPARQLConfig.setupMemoryIndex()</code></p>
+</li>
+<li>
+<p>Indexes set to maximum sizes:
<code>GeoSPARQLConfig.setupMemoryIndexSize(50000, 50000, 50000)</code></p>
+</li>
+<li>
+<p>Indexes set to remove objects not used after 5 seconds:
<code>GeoSPARQLConfig.setupMemoryIndexExpiry(5000, 5000, 5000)</code></p>
+</li>
+<li>
+<p>No indexes setup (Query rewrite still performed but results not stored) :
<code>GeoSPARQLConfig.setupNoIndex()</code></p>
+</li>
+<li>
+<p>No indexes and no query rewriting:
<code>GeoSPARQLConfig.setupNoIndex(false)</code></p>
+</li>
+<li>
+<p>Reset indexes and other stored data:
<code>GeoSPARQLConfig.reset()</code></p>
+</li>
+</ul>
+<p>A variety of configuration methods are provided in
+<code>org.apache.jena.geosparql.configuration.GeoSPARQLConfig</code>.
+Caching of 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>
+<p>```
+PREFIX geo: <a
href="http://www.opengis.net/ont/geosparql#">http://www.opengis.net/ont/geosparql#</a></p>
+<p>SELECT ?obj
+WHERE{
+ ?subj geo:sfContains ?obj
+}ORDER by ?obj
+```</p>
+<h3 id="querying-datasets-models-with-sparql">Querying Datasets & Models
with SPARQL<a class="headerlink" href="#querying-datasets-models-with-sparql"
title="Permanent link">¶</a></h3>
+<p>The setup of GeoSPARQL Jena only needs to be performed once in an
application.
+After it is setup querying is performed using Apache Jena's standard query
methods.</p>
+<p>To query a Model with GeoSPARQL or standard SPARQL:</p>
+<p>```
+GeoSPARQLConfig.setupMemoryIndex();
+Model model = .....;
+String query = ....;</p>
+<p>try (QueryExecution qe = QueryExecutionFactory.create(query, model)) {
+ ResultSet rs = qe.execSelect();
+ ResultSetFormatter.outputAsTSV(rs);
+}
+```</p>
+<p>More information on SPARQL querying using Apache Jena can be found on their
website (https://jena.apache.org/tutorials/sparql.html).
+If your dataset needs to be separate from your application and accessed over
HTTP then you probably need
+the <a href="geosparql-fuseki">GeoSPARQL Fuseki project</a>.
+The GeoSPARQL functionality needs to be setup in the application or Fuseki
server where the dataset is located.</p>
+<p>It is <strong>recommended</strong> that <code>hasDefaultGeometry</code>
properties are included in the dataset to access all functionality.
+It is <strong>necessary</strong> that <code>SpatialObject</code> classes are
asserted or inferred (i.e. a reasoner with the GeoSPARQL schema is applied) in
the dataset.
+Methods to prepare a dataset can be found in
<code>org.apache.jena.geosparql.configuration.GeoSPARQLOperations</code>.</p>
+<h3 id="api">API<a class="headerlink" href="#api" title="Permanent
link">¶</a></h3>
+<p>The library can be used as an API in Java.
+The main class to handle geometries and their spatial relations is the
<code>GeometryWrapper</code>.
+This can be obtained by parsing the string representation of a geometry using
the appropriate datatype (e.g. WKT or GML).
+Alternatively, a Literal can be extracted automatically using the
<code>GeometryWrapper.extract()</code> method and registered datatypes.
+The <code>GeometryWrapperFactory</code> can be used to directly construct a
<code>GeometryWrapper</code>.
+There is overlap between spatial relation families so repeated methods are not
specified.</p>
+<ul>
+<li>
+<p>Parse a <code>Geometry Literal</code>: <code>GeometryWrapper
geometryWrapper = WKTDatatype.INSTANCE.parse("POINT(1 1)");</code></p>
+</li>
+<li>
+<p>Extract from a Jena Literal: <code>GeometryWrapper geometryWrapper =
GeometryWrapper.extract(geometryLiteral);</code></p>
+</li>
+<li>
+<p>Create from a JTS Geometry: <code>GeometryWrapper geometryWrapper =
GeometryWrapperFactory.createGeometry(geometry, srsURI,
geometryDatatypeURI);</code></p>
+</li>
+<li>
+<p>Create from a JTS Point Geometry: <code>GeometryWrapper geometryWrapper =
GeometryWrapperFactory.createPoint(coordinate, srsURI,
geometryDatatypeURI);</code></p>
+</li>
+<li>
+<p>Convert CRS/SRS: <code>GeometryWrapper otherGeometryWrapper =
geometryWrapper.convertCRS("http://www.opengis.net/def/crs/EPSG/0/27700")</code></p>
+</li>
+<li>
+<p>Spatial Relation: <code>boolean isCrossing =
geometryWrapper.crosses(otherGeometryWrapper);</code></p>
+</li>
+<li>
+<p>DE-9IM Intersection Pattern: <code>boolean isRelated =
geometryWrapper.relate(otherGeometryWrapper, "TFFFTFFFT");</code></p>
+</li>
+<li>
+<p>Geometry Property: <code>boolean isEmpty =
geometryWrapper.isEmpty();</code></p>
+</li>
+</ul>
+<p>The GeoSPARQL standard specifies that WKT Geometry Literals without an SRS
URI are defaulted to CRS84
<code>http://www.opengis.net/def/crs/OGC/1.3/CRS84</code>.</p>
+<h2 id="key-dependencies">Key Dependencies<a class="headerlink"
href="#key-dependencies" title="Permanent link">¶</a></h2>
+<h3 id="geosparql">GeoSPARQL<a class="headerlink" href="#geosparql"
title="Permanent link">¶</a></h3>
+<p>The OGC GeoSPARQL standard supports representing and querying geospatial
data on the Semantic Web.
+GeoSPARQL defines a vocabulary for representing geospatial data in RDF, and it
defines an extension to the SPARQL query language for processing geospatial
data.
+In addition, GeoSPARQL is designed to accommodate systems based on qualitative
spatial reasoning and systems based on quantitative spatial computations.</p>
+<p>The GeoSPARQL standard is based upon the OGC Simple Features standard
(http://www.opengeospatial.org/standards/sfa) used in relational databases.
+Modifications and enhancements have been made for usage with RDF and SPARQL.
+The Simple Features standard, and by extension GeoSPARQL, simplify
calculations to Euclidean planer geometry.
+Therefore, datasets using a geographic spatial/coordinate reference system,
which are based on latitude and longitude on an ellipsoid, e.g. WGS84, will
have minor error introduced.
+This error has been deemed acceptable due to the simplification in calculation
it offers.</p>
+<h3 id="apache-jena">Apache Jena<a class="headerlink" href="#apache-jena"
title="Permanent link">¶</a></h3>
+<p>A Java framework for building Semantic Web and Linked Data applications.
+The framework provides standard compliance for RDF and SPARQL and include
extensions for persistent storage (TDB) and HTTP server (Fuseki).</p>
+<h3 id="apache-sissis_data-environment-variable">Apache SIS/SIS_DATA
Environment Variable<a class="headerlink"
href="#apache-sissis_data-environment-variable" title="Permanent
link">¶</a></h3>
+<p>Apache Spatial Information System (SIS) is a free software, Java language
library for developing geospatial applications.
+SIS provides data structures for geographic features and associated meta-data
along with methods to manipulate those data structures.
+The library is an implementation of GeoAPI 3.0 interfaces and can be used for
desktop or server applications.</p>
+<p>A subset of the EPSG spatial/coordinate reference systems are included by
default.
+The full EPSG dataset is not distributed due to the EPSG terms of use being
incompatible with the Apache Licence.
+Several options are available to include the EPSG dataset by setting the
<code>SIS_DATA</code> environment variable
(http://sis.apache.org/epsg.html).</p>
+<p>An embedded EPSG dataset can be included in a Gradle application by adding
the following dependency to <code>build.gradle</code>:
+<code>ext.sisVersion = "0.8"
+implementation
"org.apache.sis.non-free:sis-embedded-data:$sisVersion"</code></p>
+<h3 id="java-topology-suite">Java Topology Suite<a class="headerlink"
href="#java-topology-suite" title="Permanent link">¶</a></h3>
+<p>The JTS Topology Suite is a Java library for creating and manipulating
vector geometry.</p>
+<h2 id="note">Note<a class="headerlink" href="#note" title="Permanent
link">¶</a></h2>
+<p>The following are implementation points that may be useful during usage.</p>
+<h3 id="geosparql-schema">GeoSPARQL Schema<a class="headerlink"
href="#geosparql-schema" title="Permanent link">¶</a></h3>
+<p>An RDF/XML schema has been published for the GeoSPARQL v1.0 standard
(v1.0.1 - http://schemas.opengis.net/geosparql/1.0/geosparql_vocab_all.rdf).
+This can be applied to Jena Models
(https://jena.apache.org/documentation/inference/) to provide RDFS and OWL
inferencing on a GeoSPARQL conforming dataset.
+However, the published schema does not conform with the standard.</p>
+<p>The property <code>hasDefaultGeometry</code> is missing from the schema and
instead the <code>defaultGeometry</code> property is stated.</p>
+<p>This prevents RDFS inferencing being performed correctly and has been
reported to the OGC Standards Tracker.
+A corrected version of the schema is available in the <code>Resources</code>
folder.</p>
+<h3 id="spatial-relations">Spatial Relations<a class="headerlink"
href="#spatial-relations" title="Permanent link">¶</a></h3>
+<p>The GeoSPARQL and Simple Features standard both define the DE-9IM
intersection patterns for the three spatial relation families.
+However, these patterns are not always consistent with the patterns stated by
the JTS library for certain relations.</p>
+<p>For example, GeoSPARQL/Simple Features use <code>TFFFTFFFT</code>
<em>equals</em> relations in <em>Simple Feature</em>, <em>Egenhofer</em> and
<em>RCC8</em>.
+However, this does not yield the usually expected result when comparing a pair
of point geometries.
+The Simple Features standard states that the boundary of a point is empty.
+Therefore, the boundary intersection of two points would also be empty so give
a negative comparison result.</p>
+<p>JTS, and other libraries, use the alternative intersection pattern of
<code>T*F**FFF*</code>.
+This is a combination of the <em>within</em> and <em>contains</em> relations
and yields the expected results for all geometry types.</p>
+<p>The spatial relations utilised by JTS have been implemented as the
extension <code>spatial:equals</code> filter and property functions.
+A user can also supply their own DE-9IM intersection patterns by using the
<code>geof:relate</code> filter function.</p>
+<h3 id="spatial-relations-and-geometry-shapestypes">Spatial Relations and
Geometry Shapes/Types<a class="headerlink"
href="#spatial-relations-and-geometry-shapestypes" title="Permanent
link">¶</a></h3>
+<p>The spatial relations for the three spatial families do not apply to all
combinations of the geometry shapes (<code>Point</code>,
<code>LineString</code>, <code>Polygon</code>) and their collections
(<code>MultiPoint</code>, <code>MultiLineString</code>,
<code>MultiPolygon</code>).
+Therefore, some queries may not produce all the results that may initially be
expected.</p>
+<p>Some examples are:
+<em> In some relations there may only be results when a collection of shapes
is being used, e.g. two multi-points can overlap but two points cannot.
+</em> A relation may only apply for one combination but not its reciprocal,
e.g. a line may cross a polygon but a polygon may not cross a line.
+* The <em>RCC8</em> family only applies to <code>Polygon</code> and
<code>MultiPolygon</code> types.</p>
+<p>Refer to pages 8-10 of 11-052r4 GeoSPARQL standard for more details.</p>
+<h3 id="equals-relations">Equals Relations<a class="headerlink"
href="#equals-relations" title="Permanent link">¶</a></h3>
+<p>The three equals relations (<em>sfEquals</em>, <em>ehEquals</em> and
<em>rccEquals</em>) use spatial equality and not lexical equality.
+Therefore, some comparisons using these relations may not be as expected.</p>
+<p>The JTS description of <em>sfEquals</em> is:
+* True if two geometries have at least one point in common and no point of
either geometry lies in the exterior of the other geometry.</p>
+<p>Therefore, two empty geometries will return false as they are not spatially
equal.
+Shapes which differ in the number of points but have the same geometry are
equal and will return true.</p>
+<p>e.g. <code>LINESTRING (0 0, 0 10)</code> and <code>LINESTRING (0 0, 0 5, 0
10)</code> are spatially equal.</p>
+<h3 id="query-rewrite-extension">Query Rewrite Extension<a class="headerlink"
href="#query-rewrite-extension" title="Permanent link">¶</a></h3>
+<p>The Query Rewrite Extension provides for simpler querying syntax.
+<code>Feature</code> and <code>Geometry</code> can be used in spatial
relations without needing the relations to be asserted in the dataset.
+This also means the <code>Geometry Literal</code> does not need 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>
+<p>```
+ ?subj geo:hasDefaultGeometry ?subjGeom .
+ ?subjGeom geo:hasSerialization ?subjLit .</p>
+<div class="codehilite"><pre>?<span class="n">obj</span> <span
class="n">geo</span><span class="p">:</span><span
class="n">hasDefaultGeometry</span> ?<span class="n">objGeom</span> <span
class="p">.</span>
+?<span class="n">objGeom</span> <span class="n">geo</span><span
class="p">:</span><span class="n">hasSerialization</span> ?<span
class="n">objLit</span> <span class="p">.</span>
+
+<span class="n">FILTER</span><span class="p">(</span><span
class="n">geof</span><span class="p">:</span><span
class="n">sfContains</span><span class="p">(</span>?<span
class="n">subjLit</span><span class="p">,</span> ?<span
class="n">objLit</span><span class="p">))</span>
+</pre></div>
+
+
+<p>```</p>
+<p>becomes:</p>
+<p><code>?subj geo:sfContains ?obj .</code></p>
+<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> and <code>Geometry</code> in the results.
+e.g. FeatureA is bound in a query on a dataset only containing FeatureA and
GeometryA. The results FeatureA and GeometryA are returned rather than no
results.
+Therefore, filtering using <code>FILTER(!sameTerm(?subj, ?obj))</code> etc.
may be needed in some cases.
+The query rewrite functionality can be switched off in the library
configuration, see
<code>org.apache.jena.geosparql.configuration.GeoSPARQLConfig</code>.</p>
+<p>Each dataset is assigned a Query Rewrite Index to store the results of
previous tests.
+There is the potential that relations are tested multiple times in a query
(i.e. <em>Feature-Feature</em>, <em>Feature-Geometry</em>,
<em>Geometry-Geometry</em>, <em>Geometry-Feature</em>).
+Therefore, it is useful to retain the results for at least a short period of
time.</p>
+<p>Iterating through all combinations of spatial relations for a dataset
containing <em>n</em> Geometry Literals will produce 27<em>n</em>^2 true/false
results (asserting the true result statements in a dataset would be a subset).
+Control is given on a dataset basis to allow choice in when and how storage of
rewrite results is applied, e.g. store all found results on a small dataset but
on demand for a large dataset.</p>
+<p>This index can be configured on a global and individual dataset basis for
the maximum size and duration until unused items are removed.
+Query rewriting can 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>
+<h3 id="dataset-conversion">Dataset Conversion<a class="headerlink"
href="#dataset-conversion" title="Permanent link">¶</a></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>
+<p>The following list shows some of the operations that can be performed.
+Once these operations have been performed they can be serialised to file or
stored in a Jena TDB to remove the need to reprocess.</p>
+<ul>
+<li>
+<p>Load a Jena Model from file: <code>Model dataModel =
RDFDataMgr.loadModel("data.ttl");</code></p>
+</li>
+<li>
+<p>Convert <code>Feature-GeometryLiteral</code> to the GeoSPARQL
<code>Feature-Geometry-GeometryLiteral</code> structure: <code>Model
geosparqlModel =
GeoSPARQLOperations.convertGeometryStructure(dataModel);</code></p>
+</li>
+<li>
+<p>Convert <code>Feature-Lat, Feature-Lon</code> Geo predicates to the
GeoSPARQL <code>Feature-Geometry-GeometryLiteral</code> structure, with option
to remove Geo predicates: <code>Model geosparqlModel =
GeoSPARQLOperations.convertGeoPredicates(dataModel, true);</code></p>
+</li>
+<li>
+<p>Assert additional <code>hasDefaultGeometry</code> statements for single
<code>hasGeometry</code> triples, used in Query Rewriting:
<code>GeoSPARQLOperations.applyDefaultGeometry(geosparqlModel);</code></p>
+</li>
+<li>
+<p>Convert Geometry Literals to the WGS84 spatial reference system and WKT
datatype: <code>Model model = GeoSPARQLOperations.convert(geosparqlModel,
"http://www.opengis.net/def/crs/EPSG/0/4326",
"http://www.opengis.net/ont/geosparql#wktLiteral");</code></p>
+</li>
+<li>
+<p>Apply GeoSPARQL schema with RDFS inferencing and assert additional
statements in the Model:
<code>GeoSPARQLOperations.applyInferencing(model);</code></p>
+</li>
+<li>
+<p>Apply commonly used GeoSPARQL prefixes for URIs to the model:
<code>GeoSPARQLOperations.applyPrefixes(model);</code></p>
+</li>
+<li>
+<p>Create Spatial Index for a Model within a Dataset for spatial querying:
<code>Dataset dataset = SpatialIndex.wrapModel(model);</code></p>
+</li>
+</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 for querying.</p>
+<h3 id="spatial-index">Spatial Index<a class="headerlink"
href="#spatial-index" title="Permanent link">¶</a></h3>
+<p>A Spatial Index can be created to improve searching of a dataset.
+The Spatial Index is expected to be unique to the dataset and should not be
shared between 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 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 for building, loading and saving Spatial Indexes are
provided in <code>org.apache.jena.geosparql.spatial.SpatialIndex</code>.</p>
+<h3 id="units-uri">Units URI<a class="headerlink" href="#units-uri"
title="Permanent link">¶</a></h3>
+<p>Spatial/coordinate reference systems use a variety of measuring systems for
defining distances.
+These can be specified using a URI identifier, as either 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
(additonal 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 here use the prefix
<code>units</code>.</p>
+<table class="table">
+<thead>
+<tr>
+<th>URI</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>units:kilometre or units:kilometer</td>
+<td>Kilometres</td>
+</tr>
+<tr>
+<td>units:metre or units:meter</td>
+<td>Metres</td>
+</tr>
+<tr>
+<td>units:mile or units:statuteMile</td>
+<td>Miles</td>
+</tr>
+<tr>
+<td>units:degree</td>
+<td>Degrees</td>
+</tr>
+<tr>
+<td>units:radian</td>
+<td>Radians</td>
+</tr>
+</tbody>
+</table>
+<p>Full listing of default Units can be found in
<code>org.apache.jena.geosparql.implementation.vocabulary.Unit_URI</code>.</p>
+<h2 id="geography-markup-language-support-gml">Geography Markup Language
Support (GML)<a class="headerlink"
href="#geography-markup-language-support-gml" title="Permanent
link">¶</a></h2>
+<p>The supported GML profile is GML 2.0 Simple Features Profile (10-100r3),
which is a profile of GML 3.2.1 (07-036r1).
+The profile restricts the geometry shapes permitted in GML 3.2.1 to a subset,
see 10-100r3 page 22.
+The profile supports Points, LineString and Polygon shapes used in WKT. There
are also additional shape serialisations available in the profile that do not
exist in WKT or JTS to provide simplified representations which would otherwise
use LineStrings or Polygons.
+Curves can be described by LineStringSegment, Arc, Circle and
CircleByCenterPoint. Surfaces can be formed similarly to Polygons or using
Curves.
+These additional shapes can be read as part of a dataset or query but will not
be produced if the SRS of the shape is transformed, instead a LineString or
Polygon representation will be produced.</p>
+<p>Details of the GML structure for these shapes can be found in the <a
href="http://www.datypic.com/sc/niem21/s-geometryPrimitives.xsd.html">geometryPrimitives.xsd</a>,
<a
href="http://www.datypic.com/sc/niem21/s-geometryBasic0d1d.xsd.html">geometryBasic0d1d.xsd</a>,
<a
href="http://www.datypic.com/sc/niem21/s-geometryBasic2d.xsd.html">geometryBasic2d.xsd</a>
and <a
href="http://www.datypic.com/sc/niem21/s-geometryAggregates.xsd.html">geometryAggregates.xsd</a>
schemas.</p>
+<p>The labelling of collections is as follows:</p>
+<table class="table">
+<thead>
+<tr>
+<th>Collection</th>
+<th>Geometry</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>MultiPoint</td>
+<td>Point</td>
+</tr>
+<tr>
+<td>MultiCurve</td>
+<td>LineString, Curve</td>
+</tr>
+<tr>
+<td>MultiSurface</td>
+<td>Polygon, Surface</td>
+</tr>
+<tr>
+<td>MultiGeometry</td>
+<td>Point, LineString, Curve, Polygon, Surface</td>
+</tr>
+</tbody>
+</table>
+<h2 id="apache-jena-spatial-functionswgs84-geo-predicates">Apache Jena Spatial
Functions/WGS84 Geo Predicates<a class="headerlink"
href="#apache-jena-spatial-functionswgs84-geo-predicates" title="Permanent
link">¶</a></h2>
+<p>The <code>jena-spatial</code> module contains several SPARQL functions for
querying datasets using the WGS84 Geo predicates for latitude
(<code>http://www.w3.org/2003/01/geo/wgs84_pos#lat</code>) and longitude
(<code>http://www.w3.org/2003/01/geo/wgs84_pos#long</code>).
+These <code>jena-spatial</code> functions are supported for both Geo
predicates and Geometry Literals, i.e. a GeoSPARQL dataset.
+Additional SPARQL filter functions have been provided to convert Geo predicate
properties into WKT strings and calculate Great Circle and Euclidean
distances.</p>
+<h3 id="supported-features">Supported Features<a class="headerlink"
href="#supported-features" title="Permanent link">¶</a></h3>
+<p>The Geo predicate form of spatial representation is restricted to only
'Point' shapes in the WGS84 spatial/coordinate reference system.
+The Geo predicates are properties of the <code>Feature</code> and do not use
the properties and structure of the GeoSPARQL standard, including Geometry
Literals.
+Methods are available to convert datasets from Geo predicates to GeoSPARQL
structure, see:
<code>org.apache.jena.geosparql.configuration.GeoSPARQLOperations</code></p>
+<p>The spatial relations and query re-writing of GeoSPARQL outlined previously
has been implemented for Geo predicates.
+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>
+<p><code>?subj wgs:lat ?lat .
+ ?subj wgs:long ?lon .
+ BIND(spatialF:convertLatLon(?lat, ?lon) as ?point) .
+
BIND("POLYGON((...))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
AS ?box) . #Coordinate order is Lon/Lat without stated SRS URI.
+ FILTER(geof:sfContains(?box, ?point))</code></p>
+<p>Alternatively, utilising more shapes, relations and spatial reference
systems can be achieved by converting the dataset to the GeoSPARQL
structure.</p>
+<p><code>?subj geo:hasGeometry ?geom .
+ ?geom geo:hasSerialization ?geomLit .
+
BIND("POLYGON((...))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
AS ?box) . #Coordinate order is Lon/Lat without stated SRS URI.
+ FILTER(geof:sfContains(?box, ?geomLit))</code></p>
+<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.
+Therefore, it is <strong>not</strong> recommended to insert new Geo predicate
properties after a dataset has been converted to GeoSPARQL structure (unless
corresponding Geometry and Geometry Literals are included).</p>
+<h3 id="filter-functions">Filter Functions<a class="headerlink"
href="#filter-functions" title="Permanent link">¶</a></h3>
+<p>These filter functions are available in the
<code>http://jena.apache.org/function/spatial#</code> namespace and here use
the prefix <code>spatialF</code>.</p>
+<table class="table">
+<thead>
+<tr>
+<th>Function Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><em>?wktString</em> <strong>spatialF:convertLatLon</strong>(<em>?lat</em>,
<em>?lon</em>)</td>
+<td>Converts Lat and Lon double values into WKT string of a Point with WGS84
SRS.</td>
+</tr>
+<tr>
+<td><em>?wktString</em>
<strong>spatialF:convertLatLonBox</strong>(<em>?latMin</em>, <em>?lonMin</em>,
<em>?latMax</em>, <em>?lonMax</em>)</td>
+<td>Converts Lat and Lon double values into WKT string of a Polygon forming a
box with WGS84 SRS.</td>
+</tr>
+<tr>
+<td><em>?boolean</em> <strong>spatialF:equals</strong>(<em>?geomLit1</em>,
<em>?geomLit2</em>)</td>
+<td>True, if <em>geomLit1</em> is spatially equal to <em>geomLit2</em>.</td>
+</tr>
+<tr>
+<td><em>?boolean</em> <strong>spatialF:nearby</strong>(<em>?geomLit1</em>,
<em>?geomLit2</em>, <em>?distance</em>, <em>?unitsURI</em>)</td>
+<td>True, if <em>geomLit1</em> is within <em>distance</em> of
<em>geomLit2</em> using the distance <em>units</em>.</td>
+</tr>
+<tr>
+<td><em>?boolean</em>
<strong>spatialF:withinCircle</strong>(<em>?geomLit1</em>, <em>?geomLit2</em>,
<em>?distance</em>, <em>?unitsURI</em>)</td>
+<td>True, if <em>geomLit1</em> is within <em>distance</em> of
<em>geomLit2</em> using the distance <em>units</em>.</td>
+</tr>
+<tr>
+<td><em>?radians</em> <strong>spatialF:angle</strong>(<em>?x1</em>,
<em>?y1</em>, <em>?x2</em>, <em>?y2</em>)</td>
+<td>Angle clockwise from y-axis from Point(x1,y1) to Point (x2,y2) in 0 to 2Ï
radians.</td>
+</tr>
+<tr>
+<td><em>?degrees</em> <strong>spatialF:angleDeg</strong>(<em>?x</em>,
<em>?y1</em>, <em>?x2</em>, <em>?y2</em>)</td>
+<td>Angle clockwise from y-axis from Point(x1,y1) to Point (x2,y2) in 0 to 360
degrees.</td>
+</tr>
+<tr>
+<td><em>?distance</em> <strong>spatialF:distance</strong>(<em>?geomLit1</em>,
<em>?geomLit2</em>, <em>?unitsURI</em>)</td>
+<td>Distance between two Geometry Literals in distance <em>units</em>. Chooses
distance measure based on SRS type. Great Circle distance for Geographic SRS
and Euclidean otherwise.</td>
+</tr>
+<tr>
+<td><em>?radians</em> <strong>spatialF:azimuth</strong>(<em>?lat1</em>,
<em>?lon1</em>, <em>?lat2</em>, <em>?lon2</em>)</td>
+<td>Forward azimuth clockwise from North between two Lat/Lon Points in 0 to
2Ï radians.</td>
+</tr>
+<tr>
+<td><em>?degrees</em> <strong>spatialF:azimuthDeg</strong>(<em>?lat1</em>,
<em>?lon1</em>, <em>?lat2</em>, <em>?lon2</em>)</td>
+<td>Forward azimuth clockwise from North between two Lat/Lon Points in 0 to
360 degrees.</td>
+</tr>
+<tr>
+<td><em>?distance</em> <strong>spatialF:greatCircle</strong>(<em>?lat1</em>,
<em>?lon1</em>, <em>?lat2</em>, <em>?lon2</em>, <em>?unitsURI</em>)</td>
+<td>Great Circle distance (Vincenty formula) between two Lat/Lon Points in
distance <em>units</em>.</td>
+</tr>
+<tr>
+<td><em>?distance</em>
<strong>spatialF:greatCircleGeom</strong>(<em>?geomLit1</em>,
<em>?geomLit2</em>, <em>?unitsURI</em>)</td>
+<td>Great Circle distance (Vincenty formula) between two Geometry Literals in
distance <em>units</em>. Use
<code>http://www.opengis.net/def/function/geosparql/distance</code> from
GeoSPARQL standard for Euclidean distance.</td>
+</tr>
+<tr>
+<td><em>?geomLit2</em> <strong>spatialF:transform</strong>(<em>?geomLit1</em>,
<em>?datatypeURI</em>, <em>?srsURI</em>)</td>
+<td>Transform Geometry Literal by Datatype and SRS.</td>
+</tr>
+<tr>
+<td><em>?geomLit2</em>
<strong>spatialF:transformDatatype</strong>(<em>?geomLit1</em>,
<em>?datatypeURI</em>)</td>
+<td>Transform Geometry Literal by Datatype.</td>
+</tr>
+<tr>
+<td><em>?geomLit2</em>
<strong>spatialF:transformSRS</strong>(<em>?geomLit1</em>,
<em>?srsURI</em>)</td>
+<td>Transform Geometry Literal by SRS.</td>
+</tr>
+</tbody>
+</table>
+<h3 id="property-functions">Property Functions<a class="headerlink"
href="#property-functions" title="Permanent link">¶</a></h3>
+<p>These property functions are available in the
<code>http://jena.apache.org/spatial#</code> namespace and here use the prefix
<code>spatial</code>.
+This is the same namespace as the <code>jena-spatial</code> functions utilise
and these form direct replacements.
+The subject <code>Feature</code> may be bound, to test the pattern is true, or
unbound, to find all cases the pattern is true.
+These property functions require a <code>Spatial Index</code> to be setup for
the dataset.</p>
+<p>The optional <em>?limit</em> parameter restricts the number of results
returned. The default value is -1 which returns all results. No guarantee is
given for ordering of results.
+The optional <em>?unitsURI</em> parameter specifies the units of a distance.
The default value is kilometres through the string or resource
<code>http://www.opengis.net/def/uom/OGC/1.0/kilometre</code>.</p>
+<p>The <code>spatial:equals</code> property function behaves the same way as
the main GeoSPARQL property functions. Either, both or neither of the subject
and object can be bound. A <code>Spatial Index</code> is <strong>not</strong>
required for the dataset with the <code>spatial:equals</code> property
function.</p>
+<table class="table">
+<thead>
+<tr>
+<th>Function Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><em>?spatialObject1</em> <strong>spatial:equals</strong>
<em>?spatialObject2</em></td>
+<td>Find <em>spatialObjects</em> (i.e. <em>features</em> or
<em>geometries</em>) that are spatially equal.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:intersectBox</strong>(<em>?latMin</em>
<em>?lonMin</em> <em>?latMax</em> <em>?lonMax</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that intersect the provided box, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em>
<strong>spatial:intersectBoxGeom</strong>(<em>?geomLit1</em> <em>?geomLit2</em>
[ <em>?limit</em>])</td>
+<td>Find <em>features</em> that intersect the provided box, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:withinBox</strong>(<em>?latMin</em>
<em>?lonMin</em> <em>?latMax</em> <em>?lonMax</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that intersect the provided box, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em>
<strong>spatial:withinBoxGeom</strong>(<em>?geomLit1</em> <em>?geomLit2</em> [
<em>?limit</em>])</td>
+<td>Find <em>features</em> that are within the provided box, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:nearby</strong>(<em>?lat</em>
<em>?lon</em> <em>?radius</em> [ <em>?unitsURI</em> [ <em>?limit</em>]])</td>
+<td>Find <em>features</em> that are within <em>radius</em> of the
<em>distance</em> units, up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:nearbyGeom</strong>(<em>?geomLit</em>
<em>?radius</em> [ <em>?unitsURI</em> [ <em>?limit</em>]])</td>
+<td>Find <em>features</em> that are within <em>radius</em> of the
<em>distance</em> units, up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:withinCircle</strong>(<em>?lat</em>
<em>?lon</em> <em>?radius</em> [ <em>?unitsURI</em> [ <em>?limit</em>]])</td>
+<td>Find <em>features</em> that are within <em>radius</em> of the
<em>distance</em> units, up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em>
<strong>spatial:withinCircleGeom</strong>(<em>?geomLit</em> <em>?radius</em> [
<em>?unitsURI</em> [ <em>?limit</em>]])</td>
+<td>Find <em>features</em> that are within <em>radius</em> of the
<em>distance</em> units, up to the <em>limit</em>.</td>
+</tr>
+</tbody>
+</table>
+<p>The Cardinal Functions find all <code>Features</code> that are present in
the specified direction.
+In Geographic spatial reference systems (SRS), e.g. WGS84 and CRS84, the
East/West directions wrap around.
+Therefore, a search is made from the shape's edge for up to half the range of
the SRS (i.e. 180 degrees in WGS84) and will continue across the East/West
boundary if necessary.
+In other SRS, e.g. Projected onto a flat plane, the East/West check is made
from the shape's edge to the farthest limit of the SRS range, i.e. there is no
wrap around.</p>
+<table class="table">
+<thead>
+<tr>
+<th>Cardinal Function Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><em>?feature</em> <strong>spatial:north</strong>(<em>?lat</em>
<em>?lon</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that are North of the Lat/Lon point (point to +90
degrees), up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:northGeom</strong>(<em>?geomLit</em> [
<em>?limit</em>])</td>
+<td>Find <em>features</em> that are North of the Geometry Literal, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:south</strong>(<em>?lat</em>
<em>?lon</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that are South of the Lat/Lon point (point to -90
degrees), up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:southGeom</strong>(<em>?geomLit</em> [
<em>?limit</em>])</td>
+<td>Find <em>features</em> that are South of the Geometry Literal, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:east</strong>(<em>?lat</em>
<em>?lon</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that are East of the Lat/Lon point (point plus 180
degrees longitude, wrapping round), up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:eastGeom</strong>(<em>?geomLit</em> [
<em>?limit</em>])</td>
+<td>Find <em>features</em> that are East of the Geometry Literal, up to the
<em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:west</strong>(<em>?lat</em>
<em>?lon</em> [ <em>?limit</em>])</td>
+<td>Find <em>features</em> that are West of the Lat/Lon point (point minus 180
degrees longitude, wrapping round), up to the <em>limit</em>.</td>
+</tr>
+<tr>
+<td><em>?feature</em> <strong>spatial:westGeom</strong>(<em>?geomLit</em> [
<em>?limit</em>])</td>
+<td>Find <em>features</em> that are West of the Geometry Literal, up to the
<em>limit</em>.</td>
+</tr>
+</tbody>
+</table>
+<h2 id="geometry-property-filter-functions">Geometry Property Filter
Functions<a class="headerlink" href="#geometry-property-filter-functions"
title="Permanent link">¶</a></h2>
+<p>The GeoSPARQL standard provides a set of properties related to geometries,
see Section 8.4.
+These are applied on the Geometry resource and are automatically determined if
not asserted in the data.
+However, it may be necessary to retrieve the properties of a Geometry Literal
directly without an associated Geometry resource.
+Filter functions to do this have been included as part of the
<code>http://www.opengis.net/def/function/geosparql/</code> namespace as a
minor variation to the GeoSPARQL standard.
+The relevant functions using the <code>geof</code> prefix are:</p>
+<table class="table">
+<thead>
+<tr>
+<th>Geometry Property Filter Function Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><em>?integer</em>
<strong>geof:dimension</strong>(<em>?geometryLiteral</em>)</td>
+<td>Topological dimension, e.g. 0 for Point, 1 for LineString and 2 for
Polygon.</td>
+</tr>
+<tr>
+<td><em>?integer</em>
<strong>geof:coordinateDimension</strong>(<em>?geometryLiteral</em>)</td>
+<td>Coordinate dimension, e.g. 2 for XY coordinates and 4 for XYZM
coordinates.</td>
+</tr>
+<tr>
+<td><em>?integer</em>
<strong>geof:spatialDimension</strong>(<em>?geometryLiteral</em>)</td>
+<td>Spatial dimension, e.g. 2 for XY coordinates and 3 for XYZM
coordinates.</td>
+</tr>
+<tr>
+<td><em>?boolean</em>
<strong>geof:isEmpty</strong>(<em>?geometryLiteral</em>)</td>
+<td>True, if geometry is empty.</td>
+</tr>
+<tr>
+<td><em>?boolean</em>
<strong>geof:isSimple</strong>(<em>?geometryLiteral</em>)</td>
+<td>True, if geometry is simple.</td>
+</tr>
+<tr>
+<td><em>?boolean</em>
<strong>geof:isValid</strong>(<em>?geometryLiteral</em>)</td>
+<td>True, if geometry is topologically valid.</td>
+</tr>
+</tbody>
+</table>
+<p>A dataset that follows the GeoSPARQL Feature-Geometry-GeometryLiteral can
have simpler SPARQL queries without needing to use these functions by taking
advantage of the Query Rewriting functionality.
+The <code>geof:isValid</code> filter function and <code>geo:isValid</code>
property for a Geometry resource are not part of the GeoSPARQL standard but
have been included as a minor variation.</p>
+<h2 id="future-work">Future Work<a class="headerlink" href="#future-work"
title="Permanent link">¶</a></h2>
+<ul>
+<li>Implementing GeoJSON as a <code>GeometryLiteral</code> serialisation
(https://tools.ietf.org/html/rfc7946).</li>
+</ul>
+<h2 id="contributors">Contributors<a class="headerlink" href="#contributors"
title="Permanent link">¶</a></h2>
+<p>The following individuals have made contributions to this project:</p>
+<ul>
+<li>Greg Albiston</li>
+<li>Haozhe Chen</li>
+<li>Taha Osman</li>
+</ul>
+<h2 id="why-use-this-implementation">Why Use This Implementation?<a
class="headerlink" href="#why-use-this-implementation" title="Permanent
link">¶</a></h2>
+<p>There are several implementations of the GeoSPARQL standard.
+The conformance and completeness of these implementations is difficult to
ascertain and varies between features.</p>
+<p>However, the following may be of interest when considering whether to use
this implementation based on reviewing several alternatives.</p>
+<table class="table">
+<thead>
+<tr>
+<th>This Implementation</th>
+<th>Other Implementations</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Implements all six components of the GeoSPARQL standard.</td>
+<td>Generally partially implement the Geometry Topology and Geometry
Extensions. Do not implement the Query Rewrite Extension.</td>
+</tr>
+<tr>
+<td>Pure Java and does not require a supporting relational database.
Configuration requires a single line of code (although Apache SIS may need some
setting up, see above).</td>
+<td>Require setting up a database, configuring a geospatial extension and
setting environment variables.</td>
+</tr>
+<tr>
+<td>Uses Apache Jena, which conforms to the W3C standards for RDF and SPARQL.
New versions of the standards will quickly feed through.</td>
+<td>Not fully RDF and SPARQL compliant, e.g. RDFS/OWL inferencing or SPARQL
syntax. Adding your own schema may not produce inferences.</td>
+</tr>
+<tr>
+<td>Automatically determines geometry properties and handles mixed cases of
units or coordinate reference systems. The GeoSPARQL standard suggests this
approach but does not require it.</td>
+<td>Tend to produce errors or no results in these situations.</td>
+</tr>
+<tr>
+<td>Performs indexing and caching on-demand which reduces set-up time and only
performs calculations that are required.</td>
+<td>Perform indexing in the data loading phase and initialisation phase, which
can lead to lengthy delays (even on relatively small datasets).</td>
+</tr>
+<tr>
+<td>Uses JTS which does not truncate coordinate precision and applies spatial
equality.</td>
+<td>May truncate coordinate precision and apply lexical equality, which is
quicker but does not comply with the GeoSPARQL standard.</td>
+</tr>
+</tbody>
+</table>
+ </div>
+</div>
+
+</div><!--/.container -->
+
+ <footer class="footer">
+ <div class="container">
+ <p>Copyright © 2011–2019 The Apache Software Foundation,
Licensed under
+ the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
License, Version 2.0</a>.
+ </p>
+ <p>
+ Apache Jena, Jena, the Apache Jena project logo,
+ Apache and the Apache feather logos are trademarks of The Apache
Software Foundation.
+ </p>
+ </div>
+ </footer>
+
+ <!-- for marking links as active in the navbar-menu -->
+ <script type="text/javascript">
+ var link = $('a[href="' + this.location.pathname + '"]');
+ if (link != undefined)
+ link.parents('li,ul').addClass('active');
+ </script>
+
+</body>
+</html>