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 14 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
49 changes: 49 additions & 0 deletions spec/sections/11-geometry_extension.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,8 @@ Implementations shall support the functions
<<Function: geof:boundingCircle, `geof:boundingCircle`>>,
<<Function: geof:metricBuffer, `geof:metricBuffer`>>,
<<Function: geof:buffer, `geof:buffer`>>,
<<Function: geof:metricDWithin, `geof:metricDWithin`>>,
<<Function: geof:DWithin, `geof:DWithin`>>,
<<Function: geof:centroid, `geof:centroid`>>,
<<Function: geof:convexHull, `geof:convexHull`>>,
<<Function: geof:concaveHull, `geof:concaveHull`>>,
Expand All @@ -1217,6 +1219,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 @@ -1256,6 +1259,7 @@ Implementations shall support the functions
<<Function: geof:numPatches, `geof:numPatches`>>,
<<Function: geof:numPoints, `geof:numPoints`>>,
<<Function: geof:startPoint, `geof:startPoint`>>,
<<Function: geof:simplifyDP, `geof:simplifyDP`>>,
<<Function: geof:X, `geof:X`>>,
<<Function: geof:Y, `geof:Y`>>,
<<Function: geof:Z, `geof:Z`>>,
Expand Down Expand Up @@ -1445,6 +1449,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:metricDWithin

```
geof:metricDWithin (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:sfDWithin

```
geof:sfDWithin (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 @@ -1577,6 +1599,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 @@ -1832,6 +1862,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:simplifyDP

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

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


==== Function: geof:transform

[%unnumbered]
Expand Down Expand Up @@ -1919,6 +1959,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 Down Expand Up @@ -1952,6 +1993,14 @@ 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]
Expand Down
119 changes: 118 additions & 1 deletion vocabularies/functions.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,75 @@ geofp:distance_param3 a fno:Parameter ;
geofo:distance_output a fno:Parameter ;
fno:required "true"^^xsd:boolean ;
fno:type xsd:double .

funcs:dWithin
a sd:Function, fno:Function ;
dcterms:source <http://www.opengis.net/doc/geosparql/1.2> ;
policy:status status:valid ;
fno:expects (funcs:dWithin_param1 funcs:dWithin_param2 funcs:dWithin_param3 funcs:dWithin_param4 ) ;
fno:returns (funcs:dWithin_output ) ;
rdfs:isDefinedBy <http://www.opengis.net/spec/geosparql/1.2/req/geometry-extension/query-functions> ;
rdfs:seeAlso <http://www.opengis.net/doc/geosparql/1.2> ;
skos:definition "A query function that returns true if the second goemetry is within the given distance of the first geometry."@en ;
skos:example spec11:B.2.2.4 ;
skos:prefLabel "dWithin"@en ;
.

funcs:dWithin_param1 a fno:Parameter ;
fno:type geo:wktLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom1"@en .

funcs:dWithin_param2 a fno:Parameter ;
fno:type geo:wktLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom2"@en .

funcs:dWithin_param3 a fno:Parameter ;
fno:type xsd:double ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "distance"@en .

funcs:dWithin_param4 a fno:Parameter ;
fno:type xsd:anyURI ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "unit"@en .

funcs:dWithin_output a fno:Output ;
fno:required "true"^^xsd:boolean ;
fno:type xsd:boolean .

funcs:metricDWithin
a sd:Function, fno:Function ;
dcterms:source <http://www.opengis.net/doc/geosparql/1.2> ;
policy:status status:valid ;
fno:expects (funcs:metricDWithin_param1 funcs:metricDWithin_param2 funcs:metricDWithin_param3 ) ;
fno:returns (funcs:metricDWithin_output ) ;
rdfs:isDefinedBy <http://www.opengis.net/spec/geosparql/1.2/req/geometry-extension/query-functions> ;
rdfs:seeAlso <http://www.opengis.net/doc/geosparql/1.2> ;
skos:definition "A query function that returns true if the second goemetry is within the given metric distance of the first geometry."@en ;
skos:example spec11:B.2.2.4 ;
skos:prefLabel "metricDWithin"@en ;
.

funcs:metricDWithin_param1 a fno:Parameter ;
fno:type geo:wktLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom1"@en .

funcs:metricDWithin_param2 a fno:Parameter ;
fno:type geo:wktLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom2"@en .

funcs:metricDWithin_param3 a fno:Parameter ;
fno:type xsd:double ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "distance"@en .

funcs:metricDWithin_output a fno:Output ;
fno:required "true"^^xsd:boolean ;
fno:type xsd:boolean .

geof:ehContains
a sd:Function, fno:Function , skos:Concept ;
Expand Down Expand Up @@ -1495,7 +1564,55 @@ geofp:isClosed_param1 a fno:Parameter ;

geofo:isClosed_output a fno:Output ;
fno:required "true"^^xsd:boolean ;
fno:type xsd:boolean
fno:type xsd:boolean .

geof:isCollection
a sd:Function, fno:Function ;
dcterms:source <http://www.opengis.net/doc/geosparql/1.2> ;
policy:status status:valid ;
fno:expects (geofp:isCollection_param1 ) ;
fno:returns (geofo:isCollection_output ) ;
rdfs:isDefinedBy <http://www.opengis.net/spec/geosparql/1.1/req/geometry-extension/query-functions> ;
rdfs:seeAlso <http://www.opengis.net/doc/geosparql/1.1> ;
skos:definition "A query function that returns true if the literal of the geometry encodes a GeometryCollection."@en ;
skos:prefLabel "isCollection"@en ;
.

geofp:isCollection_param1 a fno:Parameter ;
fno:type geo:wktLiteral, geo:ewkbLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom1"@en .

geofo:isCollection_output a fno:Output ;
fno:required "true"^^xsd:boolean ;
fno:type xsd:boolean .

geof:simplifyDP
a sd:Function, fno:Function , skos:Concept ;
skos:inScheme cs: ;
dcterms:source <http://www.opengis.net/doc/geosparql/1.1> ;
policy:status status:valid ;
fno:expects (geofp:simplifyDP_param1, geofp:simplifyDP_param2 ) ;
fno:returns (geofo:simplifyDP_output ) ;
rdfs:isDefinedBy <http://www.opengis.net/spec/geosparql/1.1/req/geometry-extension/query-functions> ;
rdfs:seeAlso <http://www.opengis.net/doc/geosparql/1.1> ;
skos:definition "A query function that simplifies a given geometry using the Douglas-Peucker algorithm."@en ;
skos:prefLabel "simplifyDP"@en ;
.

geofp:simplifyDP_param1 a fno:Parameter ;
fno:type geo:wktLiteral, geo:ewkbLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "geom1"@en .

geofp:simplifyDP_param2 a fno:Parameter ;
fno:type xsd:double ;
fno:required "true"^^xsd:boolean ;
skos:prefLabel "tolerance"@en .

geofo:simplifyDP_output a fno:Parameter ;
fno:required "true"^^xsd:boolean ;
fno:type geo:wktLiteral, geo:ewkbLiteral, geo:gmlLiteral, geo:geoJSONLiteral, geo:kmlLiteral, geo:dggsLiteral .

geof:isEmpty
a sd:Function, fno:Function , skos:Concept ;
Expand Down