You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2019/06/01 13:19:41 UTC

svn commit: r1860481 - in /jena/site/trunk/content/documentation/geosparql: geosparql-fuseki.md index.md

Author: andy
Date: Sat Jun  1 13:19:41 2019
New Revision: 1860481

URL: http://svn.apache.org/viewvc?rev=1860481&view=rev
Log:
Fix code block formatting

Modified:
    jena/site/trunk/content/documentation/geosparql/geosparql-fuseki.md
    jena/site/trunk/content/documentation/geosparql/index.md

Modified: jena/site/trunk/content/documentation/geosparql/geosparql-fuseki.md
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/geosparql/geosparql-fuseki.md?rev=1860481&r1=1860480&r2=1860481&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/geosparql/geosparql-fuseki.md (original)
+++ jena/site/trunk/content/documentation/geosparql/geosparql-fuseki.md Sat Jun  1 13:19:41 2019
@@ -1,7 +1,7 @@
 Title: GeoSPARQL Fuseki
 
 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.
+It uses the embedded server Fuseki and provides additional parameters for dataset loading.
 
 The project uses the GeoSPARQL implementation from the [GeoSPARQL Jena project](index).
 Currently, there is no GUI interface as provided in the Fuseki distribution.
@@ -19,13 +19,11 @@ GeoSPARQL Fuskei can be accessed as an e
 SPARQL queries directly on Jena Datasets and Models can be done using
 the [GeoSPARQL Jena project](index).
 
-```
-<dependency>
-    <groupId>org.apache.jena</groupId>
-    <artifactId>fuseki-geosparql</artifactId>
-    <version>...</version>
-</dependency>
-```
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>fuseki-geosparql</artifactId>
+      <version>...</version>
+    </dependency>
 
 ### Command Line
 Run from the command line (see `releases` tab) and send queries over HTTP.
@@ -62,19 +60,17 @@ Run within a Java application to provide
 `GeosparqlServer server = new GeosparqlServer(portNumber, datasetName, isLoopbackOnly, dataset, isUpdate);`
 
 ## SPARQL Query Example
-Once the default server is running it can be queried using Apache Jena as follows:
+Once the default server is running it can be queried using Jena as follows:
 
-```
-String service = "http://localhost:3030/ds";
-String query = ....;
-try (QueryExecution qe = QueryExecutionFactory.sparqlService(service, query)) {
-    ResultSet rs = qe.execSelect();
-    ResultSetFormatter.outputAsTSV(rs);
-}
-```
+    String service = "http://localhost:3030/ds";
+    String query = ....;
+    try (QueryExecution qe = QueryExecutionFactory.sparqlService(service, query)) {
+        ResultSet rs = qe.execSelect();
+        ResultSetFormatter.outputAsTSV(rs);
+    }
 
 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).
+More information on SPARQL querying using Jena can be found on their website (https://jena.apache.org/tutorials/sparql.html).
 
 ## SIS_DATA Environment Variable
 The Apache SIS library is used to support the recognition and transformation of Coordinate/Spatial Reference Systems.
@@ -86,19 +82,17 @@ Several options are available to include
 An embedded EPSG dataset can be included in an application by adding the following dependency:
 
 * Gradle dependency in `build.gradle`
-```
-ext.sisVersion = "0.8"
-implementation "org.apache.sis.non-free:sis-embedded-data:$sisVersion"
-```
+
+    ext.sisVersion = "0.8"
+    implementation "org.apache.sis.non-free:sis-embedded-data:$sisVersion"
 
 * Maven dependency in `pom.xml`
-```
-<dependency>
-    <groupId>org.apache.sis.non-free</groupId>
-    <artifactId>sis-embedded-data</artifactId>
-    <version>0.8</version>
-</dependency>
-```
+
+    <dependency>
+      <groupId>org.apache.sis.non-free</groupId>
+      <artifactId>sis-embedded-data</artifactId>
+      <version>0.8</version>
+    </dependency>
 
 ## Command Line Arguments
 
@@ -106,45 +100,39 @@ Boolean options that have false defaults
 Release v1.0.6 and earlier use the form "--option true".
 
 ### 1) Port
-```
---port, -p
-```
+
+    --port, -p
 
 The port number of the server. Default: 3030
 
 ### 2) Dataset name
-```
---dataset, -d
-```
+
+    --dataset, -d
 
 The name of the dataset used in the URL. Default: ds
 
 ### 3) Loopback only
-```
---loopback, -l
-```
+
+    --loopback, -l
 
 The server only accepts local host loopback requests. Default: true
 
 ### 4) SPARQL update allowed
-```
---update, -u
-```
+
+    --update, -u
 
 The server accepts updates to modify the dataset. Default: false
 
 ### 5) TDB folder
-```
---tdb, -t
-```
+
+    --tdb, -t
 
 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 `--inference`, `--default_geometry` and `--validate` options. These operations may add additional statements to the dataset.
 
 ### 6) Load RDF file into dataset
-```
---rdf_file, -rf
-```
+
+    --rdf_file, -rf
 
 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. `test.rdf#test&xml,test2.rdf` will load _test.rdf_ file into _test_ graph as _RDF/XML_ and _test2.rdf_ into _default_ graph as _TTL_.
@@ -152,9 +140,8 @@ e.g. `test.rdf#test&xml,test2.rdf` will
 Consider the `--inference`, `--default_geometry` and `--validate` options. These operations may add additional statements to the dataset.
 
 ### 7) Load Tabular file into dataset
-```
---tabular_file, -tf
-```
+
+    --tabular_file, -tf
 
 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. `test.rdf#test|TAB,test2.rdf` will load _test.rdf_ file into _test_ graph as _TAB_ delimited and _test2.rdf_ into _default_ graph as _COMMA_ delimited.
@@ -164,83 +151,70 @@ See RDF Tables project (https://github.c
 Consider the `--inference`, `--default_geometry` and `--validate` options. These operations may add additional statements to the dataset.
 
 ### 8) GeoSPARQL RDFS inference
-```
---inference, -i
-```
+
+    --inference, -i
 
 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
 
 ### 9) Apply hasDefaultGeometry
-```
---default_geometry, -dg
-```
+
+    --default_geometry, -dg
 
 Apply hasDefaultGeometry to single Feature hasGeometry Geometry statements. Additional properties will be added to the dataset. Default: false
 
 ### 10) Validate Geometry Literals
-```
---validate, -v
-```
+
+    --validate, -v
 
 Validate that the Geometry Literals in the dataset are valid. Default: false
 
 ### 11) Convert Geo predicates
-```
---convert_geo, -c
-```
+
+    --convert_geo, -c
 
 Convert Geo predicates in the data to Geometry with WKT WGS84 Point GeometryLiteral. Default: false
 
 ### 12)  Remove Geo predicates
-```
---remove_geo, -rg
-```
+
+    --remove_geo, -rg
 
 Remove Geo predicates in the data after combining to Geometry.
 
 ### 13) Query Rewrite enabled
-```
---rewrite, -r
-```
+
+    --rewrite, -r
 
 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
 
 ### 14) Indexing enabled
-```
---index, -x
-```
+
+    --index, -x
 
 Enable caching of re-usable data to improve query performance. Default: true
 See [GeoSPARQL Jena project](index) for more details.
 
 ### 15) Index sizes
-```
---index_sizes, -xs
-```
+
+    --index_sizes, -xs
 
 List of Index item sizes: [Geometry Literal, Geometry Transform, Query Rewrite]. Unlimited: -1, Off: 0 Unlimited: -1, Off: 0, Default: -1,-1,-1
 
 ### 16) Index expiries
-```
---index_expiry, -xe
-```
 
-List of Index item expiry in milliseconds: [Geometry Literal, Geometry Transform, Query Rewrite]. Off: 0, Minimum: 1001, Default: 5000,5000,5000
+    --index_expiry, -xe
+
+List of Index item expiry in milliseconds: [Geometry Literal, Geometry Transform, Query Rewrite]. Off: 0, Minimum: 1001, Default: 5000,5000,500
 
 ### 17) Spatial Index file
-```
---spatial_index, -si
-```
+
+    --spatial_index, -si
 
 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.
 
 ### 18) Properties File
 Supply the above parameters as a file:
-```console
-$ java Main @/tmp/parameters
-```
+
+    $ java Main @/tmp/parameters
 
 ## Future Work
 * GUI to assist users when querying a dataset.
-
-![Powered by Apache Jena](https://www.apache.org/logos/comdev-test/poweredby/jena.png "Powered by Apache Jena")

Modified: jena/site/trunk/content/documentation/geosparql/index.md
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/geosparql/index.md?rev=1860481&r1=1860480&r2=1860481&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/geosparql/index.md (original)
+++ jena/site/trunk/content/documentation/geosparql/index.md Sat Jun  1 13:19:41 2019
@@ -18,7 +18,7 @@ It implements the six Conformance Classe
 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
 `org.apache.jena.geosparql.implementation.datatype.GeometryDatatype`
-and registering with Apache Jena's `org.apache.jena.datatypes.TypeMapper`.
+and registering with Jena's `org.apache.jena.datatypes.TypeMapper`.
 
 All three spatial relation families are supported: _Simple Feature_, _Egenhofer_ and _RCC8_.
 
@@ -42,13 +42,11 @@ The following additional features are al
 ## Getting Started
 GeoSPARQL Jena can be accessed as a library using Maven etc. from Maven Central.
 
-```
-<dependency>
-    <groupId>org.apache.jena</groupId>
-    <artifactId>jena-geosparql</artifactId>
-    <version>...</version>
-</dependency>
-```
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-geosparql</artifactId>
+      <version>...</version>
+    </dependency>
 
 A HTTP server (SPARQL endpoint) using is available - for details, see the [Geosparql Fuseki documentation](geosparql-fuseki).
 
@@ -87,34 +85,30 @@ Caching of frequently used but small qua
 
 Example GeoSPARQL query:
 
-```
-PREFIX geo: <http://www.opengis.net/ont/geosparql#>
-
-SELECT ?obj
-WHERE{
-    ?subj geo:sfContains ?obj
-}ORDER by ?obj
-```
+    PREFIX geo: <http://www.opengis.net/ont/geosparql#>
+    
+    SELECT ?obj
+    WHERE{
+        ?subj geo:sfContains ?obj
+    } ORDER by ?obj
 
 ### Querying Datasets & Models with SPARQL
 
 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.
+After it is setup querying is performed using Jena's standard query methods.
 
 To query a Model with GeoSPARQL or standard SPARQL:
 
-```
-GeoSPARQLConfig.setupMemoryIndex();
-Model model = .....;
-String query = ....;
-
-try (QueryExecution qe = QueryExecutionFactory.create(query, model)) {
-    ResultSet rs = qe.execSelect();
-    ResultSetFormatter.outputAsTSV(rs);
-}
-```
+    GeoSPARQLConfig.setupMemoryIndex();
+    Model model = .....;
+    String query = ....;
+    
+    try (QueryExecution qe = QueryExecutionFactory.create(query, model)) {
+        ResultSet rs = qe.execSelect();
+        ResultSetFormatter.outputAsTSV(rs);
+    }
 
-More information on SPARQL querying using Apache Jena can be found on their website (https://jena.apache.org/tutorials/sparql.html).
+More information on SPARQL querying using 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 [GeoSPARQL Fuseki project](geosparql-fuseki).
 The GeoSPARQL functionality needs to be setup in the application or Fuseki server where the dataset is located.
@@ -162,10 +156,6 @@ The Simple Features standard, and by ext
 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.
 
-### Apache Jena
-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).
-
 ### Apache SIS/SIS_DATA Environment Variable
 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.
@@ -176,10 +166,9 @@ The full EPSG dataset is not distributed
 Several options are available to include the EPSG dataset by setting the `SIS_DATA` environment variable (http://sis.apache.org/epsg.html).
 
 An embedded EPSG dataset can be included in a Gradle application by adding the following dependency to `build.gradle`:
-```
-ext.sisVersion = "0.8"
-implementation "org.apache.sis.non-free:sis-embedded-data:$sisVersion"
-```
+
+    ext.sisVersion = "0.8"
+    implementation "org.apache.sis.non-free:sis-embedded-data:$sisVersion"
 
 ### Java Topology Suite
 The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
@@ -243,21 +232,18 @@ In the case of `Features` this requires
 
 This means the query:
 
-```
-    ?subj geo:hasDefaultGeometry ?subjGeom .
-    ?subjGeom geo:hasSerialization ?subjLit .
-
-    ?obj geo:hasDefaultGeometry ?objGeom .
-    ?objGeom geo:hasSerialization ?objLit .
 
-    FILTER(geof:sfContains(?subjLit, ?objLit))
-```
+        ?subj geo:hasDefaultGeometry ?subjGeom .
+        ?subjGeom geo:hasSerialization ?subjLit .
+        
+        ?obj geo:hasDefaultGeometry ?objGeom .
+        ?objGeom geo:hasSerialization ?objLit .
+        
+        FILTER(geof:sfContains(?subjLit, ?objLit))
 
 becomes:
 
-```
-    ?subj geo:sfContains ?obj .
-```
+        ?subj geo:sfContains ?obj .
 
 Methods are available to apply the `hasDefaultGeometry` property to every `Geometry` with a single `hasGeometry`
 property, see `org.apache.jena.geosparql.configuration.GeoSPARQLOperations`.
@@ -366,22 +352,20 @@ Refer to pages 8-10 of 11-052r4 GeoSPARQ
 
 Geo predicates can be converted to Geometry Literals in query and then used with the GeoSPARQL filter functions.
 
-```
-    ?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))
-```
+      ?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))
 
 Alternatively, utilising more shapes, relations and spatial reference systems can be achieved by converting the dataset to the GeoSPARQL structure.
 
-```
-    ?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))
-```
+      ?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))
 
 Datasets can contain both Geo predicates and Geometry Literals without interference.
 However, a dataset containing both types will only examine those `Features` which have Geometry Literals for spatial relations, i.e. the check for Geo predicates is a fallback when Geometry Literals aren't found.
@@ -487,7 +471,7 @@ This Implementation|Other Implementation
 ---------- | ----------
 Implements all six components of the GeoSPARQL standard.|Generally partially implement the Geometry Topology and Geometry Extensions. Do not implement the Query Rewrite Extension.
 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).|Require setting up a database, configuring a geospatial extension and setting environment variables.
-Uses Apache Jena, which conforms to the W3C standards for RDF and SPARQL. New versions of the standards will quickly feed through.|Not fully RDF and SPARQL compliant, e.g. RDFS/OWL inferencing or SPARQL syntax. Adding your own schema may not produce inferences.
+Uses Jena, which conforms to the W3C standards for RDF and SPARQL. New versions of the standards will quickly feed through.|Not fully RDF and SPARQL compliant, e.g. RDFS/OWL inferencing or SPARQL syntax. Adding your own schema may not produce inferences.
 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.|Tend to produce errors or no results in these situations.
 Performs indexing and caching on-demand which reduces set-up time and only performs calculations that are required.|Perform indexing in the data loading phase and initialisation phase, which can lead to lengthy delays (even on relatively small datasets).
 Uses JTS which does not truncate coordinate precision and applies spatial equality.|May truncate coordinate precision and apply lexical equality, which is quicker but does not comply with the GeoSPARQL standard.