Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including common Non SFA functions #536

Open
wants to merge 28 commits into
base: geosparql-1.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
09f1f93
Update 11-Part-08.adoc
situx Jun 1, 2022
bbf34f7
Update 11-Part-08.adoc
situx Jun 1, 2022
9e74ce6
Non SFA functions for GeoSPARQL 1.2
situx Mar 15, 2023
425469b
Added simplifyDP function
situx Mar 16, 2023
bdd054d
Added isCollection function
situx Mar 16, 2023
fe41ae9
Merge pull request #415 from opengeospatial/situx-patch-dwithin
situx Mar 16, 2023
eef73d7
Add DWithin to funcsrules
situx Mar 16, 2023
d15b067
Merge branch 'master' into situx-patch-6
situx Mar 22, 2023
2ae2822
Merge branch 'master' into situx-patch-6
situx Nov 24, 2023
cd76660
Merge branch 'master' into situx-patch-6
situx Jan 23, 2024
f580f57
Merge branch 'geosparql-1.3' into situx-patch-6
situx Jul 12, 2024
699615f
Update 11-geometry_extension.adoc
situx Jul 12, 2024
e274933
Update functions.ttl
situx Jul 12, 2024
fc0555b
Update functions.ttl
situx Jul 12, 2024
b4f6b14
Update functions.ttl
situx Aug 8, 2024
456a429
Update 11-geometry_extension.adoc
situx Aug 8, 2024
402ab7f
Update az-bibliography.adoc
situx Aug 8, 2024
fd7ec1d
Update 11-geometry_extension.adoc
situx Aug 8, 2024
54562ce
Update 11-geometry_extension.adoc
situx Aug 8, 2024
2672416
Merge branch 'geosparql-1.3' into nonsffunctions
nicholascar Aug 14, 2024
b40f337
Update 11-geometry_extension.adoc
situx Sep 19, 2024
c5cbafb
Update 01-preface.adoc
situx Sep 19, 2024
8509daa
Update 07-conventions.adoc
situx Sep 19, 2024
ef6106a
Update 11-geometry_extension.adoc
situx Oct 2, 2024
51b95c3
Update 07-conventions.adoc
situx Jan 15, 2025
2bc05f3
Update 11-geometry_extension.adoc
situx Jan 15, 2025
6cfe262
Update 11-geometry_extension.adoc
situx Jan 15, 2025
6e13ea7
Update 11-geometry_extension.adoc
situx Feb 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions spec/sections/01-preface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The suggested prefix for this namespace is `geo`
The namespace for the GeoSPARQL functions is `http://www.opengis.net/def/function/geosparql/`

The suggested prefix for this namespace is `geof`

The namespace for the GeoSPARQL RIF rules is `http://www.opengis.net/def/rule/geosparql/`

The suggested prefix for this namespace is `geor`
====

[.preface]
Expand Down
6 changes: 6 additions & 0 deletions spec/sections/07-conventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ The following IRI namespace prefixes are used throughout this document:

All of these namespace prefixes in the previous section resolve to resources that contain their namespace content except for `eg:` (`http://example.com/`), which is used just for examples, and `ogc:` (`http://www.opengis.net/`), which is used in requirement specifications as a placeholder for the geometry literal serialization used in a fully-qualified conformance class, e.g. http://www.opengis.net/ont/geosparql#wktLiteral[`+<http://www.opengis.net/ont/geosparql#wktLiteral>+`].

=== Data Types for Spatial Aggregate Functions

In this specification we use the placeholder URI ogc:geomLiteral to describe any geometry literal which is defined in this specification.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which -> that

To express a list of such literals, for example as input parameters for spatial aggregate functions, we use the notation ogc:geomLiteral[].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to put ogc:geomLiteral[] in some code markers? (I'm not familiar with adoc)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think so. However, should we find it disturbing we can still correct the styling later on

We do not define the order of ogc:geomLiteral[]. The order is to be determined by implementers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand that. A "list" is ordered, so how do you mean implementers can change it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A list is ordered. But how it is ordered, e.g., by URI alphabetically or not at all, should be up to the implementers.


=== RDF Serializations

Three RDF serializations are used in this document. Terse RDF Triple Language (turtle) <<TURTLE>> is used for RDF snippets placed within the main body of the document, and turtle, JSON-LD <<JSON-LD>> & RDF/XML <<RDFXML>> is used for the examples in <<GeoSPARQL Examples>>.
Expand Down
67 changes: 58 additions & 9 deletions spec/sections/11-geometry_extension.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,8 @@ Implementations shall support the functions
<<Function: geof:boundingCircle, `geof:boundingCircle`>>,
<<Function: geof:metricBuffer, `geof:metricBuffer`>>,
<<Function: geof:buffer, `geof:buffer`>>,
<<Function: geof:metricWithinDistance, `geof:metricWithinDistance`>>,
<<Function: geof:withinDistance, `geof:withinDistance`>>,
<<Function: geof:centroid, `geof:centroid`>>,
<<Function: geof:convexHull, `geof:convexHull`>>,
<<Function: geof:concaveHull, `geof:concaveHull`>>,
Expand All @@ -1214,6 +1216,7 @@ Implementations shall support the functions
<<Function: geof:envelope, `geof:envelope`>>,
<<Function: geof:geometryType, `geof:geometryType`>>,
<<Function: geof:intersection, `geof:intersection`>>,
<<Function: geof:isCollection, `geof:isCollection`>>,
<<Function: geof:is3D, `geof:is3D`>>,
<<Function: geof:isEmpty, `geof:isEmpty`>>,
<<Function: geof:isClosed, `geof:isClosed`>>,
Expand Down Expand Up @@ -1253,6 +1256,7 @@ Implementations shall support the functions
<<Function: geof:numPatches, `geof:numPatches`>>,
<<Function: geof:numPoints, `geof:numPoints`>>,
<<Function: geof:startPoint, `geof:startPoint`>>,
<<Function: geof:simplify, `geof:simplify`>>,
<<Function: geof:X, `geof:X`>>,
<<Function: geof:Y, `geof:Y`>>,
<<Function: geof:Z, `geof:Z`>>,
Expand Down Expand Up @@ -1442,6 +1446,24 @@ geof:coordinateDimension (geom: ogc:geomLiteral): xsd:integer

The function http://www.opengis.net/def/function/geosparql/coordinateDimension[`geof:coordinateDimension`] returns the coordinate dimension of `geom`.

==== Function: geof:metricWithinDistance

```
geof:metricWithinDistance (geom1: ogc:geomLiteral, geom2: ogc:geomLiteral,
distance: xsd:double): xsd:boolean
```

Returns true if `geom2` is within a given distance of `geom1`. Calculations are according to the units in the spatial reference system of `geom1`. The triple store implementation needs to take care of a conversion between meter and the unit of the spatial reference system.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"given distance of geom1" -> add "in meters"


==== Function: geof:withinDistance

```
geof:withinDistance (geom: ogc:geomLiteral, geom2: ogc:geomLiteral,
distance: xsd:double, units: xsd:anyURI): xsd:boolean
```

Returns true if `geom2` is within a given distance of `geom1`. Calculations are in the spatial reference system of `geom1`. The triple store implementation needs to take care of a conversion between the unit given as a parameter and the unit of the spatial reference system.

==== Function: geof:difference

[%unnumbered]
Expand Down Expand Up @@ -1574,6 +1596,14 @@ geof:is3D (geom: ogc:geomLiteral): xsd:boolean

The function http://www.opengis.net/def/function/geosparql/is3D[`geof:is3D`] Returns true if `geom` has z coordinate values.

==== Function: geof:isCollection

```
geof:isCollection (geom: ogc:geomLiteral): xsd:boolean
```

Returns true if the literal describing `geom` represents a GeometryCollection.

==== Function: geof:isClosed

----
Expand Down Expand Up @@ -1837,6 +1867,16 @@ geof:symDifference (geom1: ogc:geomLiteral,

The function http://www.opengis.net/def/function/geosparql/symDifference[`geof:symDifference`] returns a geometric object that represents all Points in the set symmetric difference of `geom1` with `geom2`. Calculations are in the spatial reference system of `geom1`.


==== Function: geof:simplify

```
geof:simplify (geom: ogc:geomLiteral, tolerance: xsd:double): ogc:geomLiteral
```

The function http://www.opengis.net/def/function/geosparql/simplify[geof:simplify] simplifies `geom` by applying the Douglas-Peucker algorithm <<DOUGLASPEUCKER>>.


==== Function: geof:transform

[%unnumbered]
Expand Down Expand Up @@ -1877,23 +1917,23 @@ The function http://www.opengis.net/def/function/geosparql/X[`geof:X`] returns t
geof:Y (geom: ogc:geomLiteral): xsd:double
----

The function http://www.opengis.net/def/function/geosparql/Y[`geof:Y`] returns the Y coordinate if `geom` is a point geometry. The Y coordinate is determined by the X axis definition of its SRS.
The function http://www.opengis.net/def/function/geosparql/Y[`geof:Y`] returns the Y coordinate if `geom` is a point geometry. The Y coordinate is determined by the Y axis definition of its SRS.

==== Function: geof:Z

----
geof:Z (geom: ogc:geomLiteral): xsd:double
----

The function http://www.opengis.net/def/function/geosparql/Z[`geof:Z`] returns the Z coordinate if `geom` is a point geometry. The Z coordinate is determined by the X axis definition of its SRS.
The function http://www.opengis.net/def/function/geosparql/Z[`geof:Z`] returns the Z coordinate if `geom` is a point geometry. The Z coordinate is determined by the Z axis definition of its SRS.

==== Function: geof:M

----
geof:M (geom: ogc:geomLiteral): xsd:double
----

The function http://www.opengis.net/def/function/geosparql/M[`geof:M`] returns the M coordinate if `geom` is a point geometry. The M coordinate is determined by the X axis definition of its SRS.
The function http://www.opengis.net/def/function/geosparql/M[`geof:M`] returns the M coordinate if `geom` is a point geometry. The M coordinate is determined by the M coordinate definition of its SRS.

[#req_geometry_extension_srid-function]
[requirement,identifier="/req/geometry-extension/srid-function"]
Expand Down Expand Up @@ -1924,6 +1964,7 @@ Implementations shall support
<<Function: geof:aggBoundingBox,`geof:aggBoundingBox`>>,
<<Function: geof:aggBoundingCircle,`geof:aggBoundingCircle`>>,
<<Function: geof:aggCentroid,`geof:aggCentroid`>>,
<<Function: geof:aggCollect,`geof:aggCollect`>>,
<<Function: geof:aggConcaveHull,`geof:aggConcaveHull`>>,
<<Function: geof:aggConvexHull,`geof:aggConvexHull`>> and
<<Function: geof:aggUnion,`geof:aggUnion`>>
Expand All @@ -1934,7 +1975,7 @@ as a SPARQL extension functions.
[%unnumbered]
[source,turtle]
----
geof:aggBoundingBox (geom: ogc:geomLiteral): ogc:geomLiteral
geof:aggBoundingBox (geom: ogc:geomLiteral[]): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggBoundingBox[`geof:aggBoundingBox`] calculates a minimum bounding box - rectangle - of the set of given geometries.
Expand All @@ -1943,7 +1984,7 @@ The function http://www.opengis.net/def/function/geosparql/aggBoundingBox[`geof:
[%unnumbered]
[source,turtle]
----
geof:aggBoundingCircle (geom: ogc:geomLiteral): ogc:geomLiteral
geof:aggBoundingCircle (geom: ogc:geomLiteral[]): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggBoundingCircle[`geof:aggBoundingCircle`] calculates a minimum bounding circle of the set of given geometries.
Expand All @@ -1952,16 +1993,24 @@ The function http://www.opengis.net/def/function/geosparql/aggBoundingCircle[`ge
[%unnumbered]
[source,turtle]
----
geof:aggCentroid (geom: ogc:geomLiteral): ogc:geomLiteral
geof:aggCentroid (geom: ogc:geomLiteral[]): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggCentroid[`geof:aggCentroid`] calculates the centroid of the set of given geometries.

==== Function: geof:aggCollect

```
geof:aggCollect (geom: ogc:geomLiteral[]): ogc:geomLiteral
```

The function http://www.opengis.net/def/function/geosparql/aggCollect[`geof:aggCollect`] calculates creates a GeometryCollection literal out of a set of geometries.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "calculates creates"

Copy link
Collaborator

@VladimirAlexiev VladimirAlexiev Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does geom: ogc:geomLiteral indicate that it's an array/set?

Copy link
Collaborator Author

@situx situx Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a set of ogc:geomLiterals in practice likely bound to a SPARQL variable like in other functions too.
The content of the ogc:geomLiterals could be arrays, e.g. a WKT GeometryCollection could be considered as an array.
Does that answer your question or would you have a different idea how to mark an array/set?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@situx I saw your answer in another issue that one geomLiteral can carry a collection.
But I think this is different: aggregates work on a resultset of multiple geomLiterals, so the function signature should indicate an array. Eg use geomLiteral*

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment is answered. But @mperry455 's comment not answered yet


==== Function: geof:aggConcaveHull
[%unnumbered]
[source,turtle]
----
geof:aggConcaveHull (geom: ogc:geomLiteral, targetPercent: xsd:double): ogc:geomLiteral
geof:aggConcaveHull (geom: ogc:geomLiteral[], targetPercent: xsd:double): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggConcaveHull[`geof:aggConcaveHull`] calculates the concave hull of the set of given geometries.
Expand All @@ -1971,7 +2020,7 @@ The function http://www.opengis.net/def/function/geosparql/aggConcaveHull[`geof:
[%unnumbered]
[source,turtle]
----
geof:aggConvexHull (geom: ogc:geomLiteral): ogc:geomLiteral
geof:aggConvexHull (geom: ogc:geomLiteral[]): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggConvexHull[`geof:aggConvexHull`] calculates the convex hull of the set of given geometries.
Expand All @@ -1986,7 +2035,7 @@ This function is similar in name to <<Function: geof:convexHull, geof:convexHull
[%unnumbered]
[source,turtle]
----
geof:aggUnion (geom: ogc:geomLiteral): ogc:geomLiteral
geof:aggUnion (geom: ogc:geomLiteral[]): ogc:geomLiteral
----

The function http://www.opengis.net/def/function/geosparql/aggUnion[`geof:aggUnion`] calculates the union of the set of given geometries.
Expand Down
2 changes: 2 additions & 0 deletions spec/sections/az-bibliography.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ architecture. http://www.opengis.net/doc/is/sfa/1.2.1
* [[[JSON-LD, JSON-LD]]] World Wide Web Consortium: _JSON-LD 1.1: A JSON-based Serialization for Linked Data_, W3C Recommendation (16 July 2020). https://www.w3.org/TR/json-ld11/

* [[[SPARQLSERVDESC, SPARQLSERVDESC]]] Word Wide Web Consortium: _SPARQL 1.1 Service Description_, W3C Recommendation (21 March 2013). https://www.w3.org/TR/sparql11-service-description/

* [[[DOUGLASPEUCKER, DOUGLASPEUCKER]]] David Douglas, Thomas Peucker: _Algorithms for the reduction of the number of points required to represent a digitized line or its caricature_. In: The Canadian Cartographer. Band 10, Nr. 2, 1973, ISSN 0008-3127, S. 112–122.
Loading