This appendix provides reference information for SPARQL extension functions for performing spatial queries in SEM_MATCH. To use these functions, you must understand the concepts explained in Section 1.6.11, "Spatial Support".
Note:
Throughout this appendixgeomLiteral
is used as a placeholder for both orageo:WKTLiteral
and ogc:wktLiteral
, which can be used interchangeably, in format representations and parameter descriptions. (However, orageo:WKTLiteral
or ogc:wktLiteral
is used in actual examples.)This appendix includes the following GeoSPARQL and Oracle-specific functions:
GeoSPARQL functions:
Oracle-specific functions:
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the boundaries of U.S. Congressional district polygons.
SELECT cb
FROM table(sem_match(
'SELECT (ogcf:boundary(?cgeom) AS ?cb)
WHERE
{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Radius value used to define the buffer.
Unit of measurement: a URI of the form <http://xmlns.oracle.com/rdf/geo/uom/{SDO_UNIT}>
(for example, <http://xmlns.oracle.com/rdf/geo/uom/KM>
). Any SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table will be recognized. See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons that are within a 100 kilometer buffer around a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (
ogcf:sfWithin(?cgeom,
ogcf:buffer("POINT(-71.46444 42.7575)"^^ogc:wktLiteral,
100,
<http://xmlns.oracle.com/rdf/geo/uom/KM>)) }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Returns a polygon geometry that represents the convex hull of geom. (The convex hull is a simple convex polygon that completely encloses the geometry object, using as few straight-line sides as possible to create the smallest polygon that completely encloses the geometry object.)
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons whose convex hull contains a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfContains(ogcf:convexHull(?cgeom),
"POINT(-71.46444 42.7575)"^^ogc:wktLiteral)) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological difference (MINUS operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons whose centroid is within the difference of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfWithin(orageo:centroid(?cgeom),
ogcf:difference("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^ogc:wktLiteral))) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Unit of measurement: a URI of the form <http://xmlns.oracle.com/rdf/geo/uom/{SDO_UNIT}>
(for example, <http://xmlns.oracle.com/rdf/geo/uom/KM>
). Any SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table will be recognized. See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example orders U.S. Congressional districts based on distance from a specified point.
SELECT name, cdist
FROM table(sem_match(
'SELECT ?name ?cdist
WHERE
{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
}
ORDER BY ASC(ogcf:distance(?cgeom,
"POINT(-71.46444 42.7575)"^^ogc:wktLiteral,
<http://xmlns.oracle.com/rdf/geo/uom/KM>))'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '))
ORDER BY sem$rownum;
Returns the minimum bounding rectangle (MBR) of geom
, that is, the single rectangle that minimally encloses geom
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons whose minimum bounding rectangle contains a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfContains(ogcf:envelope(?cgeom),
"POINT(-71.46444 42.7575)"^^ogc:wktLiteral)) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds spatial reference system URIs for U.S. Congressional district polygons.
SELECT csrid
FROM table(sem_match(
'SELECT (ogcf:getSRID(?cgeom) AS ?csrid)
WHERE
{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological intersection (AND operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons whose centroid is within the intersection of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfWithin(orageo:centroid(?cgeom),
ogcf:intersection("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^ogc:wktLiteral))) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
ogcf:relate(geom1 : geomLiteral, geom2 : geomLiteral, pattern-matrix : xsd:string) : xsd:boolean
Returns true
if the topological relationship between geom1
and geom2
satisfies the specified DE-9IM pattern-matrix. Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
A dimensionally extended 9-intersection model (DE-9IM) intersection pattern string consisting of T
(true) and F
(false) values. A DE-9IM pattern string describes the intersections between the interiors, boundaries, and exteriors of two geometries.
When invoking ogcf:relate
with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:relate
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:relate
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See the OGC Simple Features Specification (OGC 06-103r3) for a detailed description of DE-9IM intersection patterns. See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district that contains a specified point.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:relate(?cgeom, "POINT(-71.46444 42.7575)"^^ogc:wktLiteral, "TTTFFTFFT")) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T ' ));
Returns true
if geom1
spatially contains geom2
as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfContains
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfContains
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that spatially contain a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfContains(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if geom1
spatially crosses geom2
as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfCrosses
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfCrosses
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that spatially cross a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfCrosses(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if the two geometries are spatially disjoint as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
The ogcf:sfDisjoint
filter cannot use a spatial index for evaluation, so performance will probably be much worse than with other simple features spatial functions.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that are spatially disjoint from a constant polygon.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfDisjoint(?cgeom,
"Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Returns true
if the two geometries are spatially equal as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfEquals
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfEquals
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that are spatially equal to a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfEquals(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if the two geometries are not disjoint as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfIntersects
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfIntersects
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that intersect a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfIntersects(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if geom1
spatially overlaps geom2
as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfOverlaps
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfOverlaps
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that spatially overlap a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfOverlaps(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if the two geometries spatially touch as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfTouches
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfTouches
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that spatially touch a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfTouches(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if geom1
is spatially within geom2
as defined by the OGC Simple Features specification (OGC 06-103r3). Returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the ogcf:sfWithin
spatial filter).
It is recommended to use a LEADING(?var)
HINT0 hint when the query involves a restrictive ogcf:sfWithin
spatial filter on ?var
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds U.S. Congressional district polygons that are spatially within a constant polygon.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (ogcf:sfWithin(?cgeom, "Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral)) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/') ) ,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological symmetric difference (XOR operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons that are within a 100 kilometer buffer around a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfWithin(orageo:centroid(?cgeom),
ogcf:symDifference("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^ogc:wktLiteral))) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological union (OR operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the OGC GeoSPARQL specification.
The following example finds the U.S. Congressional district polygons whose centroid is within the union of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (ogcf:sfWithin(orageo:centroid(?cgeom),
ogcf:union("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^ogc:wktLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^ogc:wktLiteral))) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')
)
,null, null, null, ' ALLOW_DUP=T '));
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Unit of measurement: a quoted string with an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table (for example, "unit=SQ_KM"
). See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_AREA function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons with areas greater than 10,000 square kilometers.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:area(?cgeom, "unit=SQ_KM") > 10000) }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Distance value. Distance value. If the value is positive, the buffer is generated around geom1
; if the value is negative (valid only for polygons), the buffer is generated inside geom1
.
Unit of measurement: a quoted string with an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table (for example, "unit=KM"
). See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_BUFFER function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons that are completely inside a 100 kilometer buffer around a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (
orageo:relate(?cgeom,
orageo:buffer("POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
100, "unit=KM"),
"mask=inside")) }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Returns a point geometry that is the centroid of geom1
. (The centroid is also known as the "center of gravity.")
For an input geometry consisting of multiple objects, the result is weighted by the area of each polygon in the geometry objects. If the geometry objects are a mixture of polygons and points, the points are not used in the calculation of the centroid. If the geometry objects are all points, the points have equal weight.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_CENTROID function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons with centroids within 200 kilometers of a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:withinDistance(orageo:centroid(?cgeom),
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
"distance=200 unit=KM")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Returns a polygon-type object that represents the convex hull of geom1
. (The convex hull is a simple convex polygon that completely encloses the geometry object, using as few straight-line sides as possible to create the smallest polygon that completely encloses the geometry object.)
A convex hull is a convenient way to get an approximation of a complex geometry object.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_CONVEX_HULL function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose convex hull contains a specified point.
SELECT name, cdist FROM table(sem_match( '{ ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (orageo:relate(orageo:convexHull(?cgeom), "POINT(-71.46444 42.7575)"^^orageo:WKTLiteral, "mask=contains")) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')) ,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological difference (MINUS operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_UNION function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose centroid is inside the difference of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:relate(orageo:centroid(?cgeom),
orageo:difference("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^orageo:WKTLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^orageo:WKTLiteral),
"mask=inside")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Returns the distance between the nearest pair of points or segments of geom1
and geom2
in terms of the specified unit of measure.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Unit of measurement: a quoted string with an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table (for example, "unit=KM"
). See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
Use orageo:withinDistance
instead of orageo:distance
whenever possible, because orageo:withinDistance has a more efficient index-based implementation.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_DISTANCE function in Oracle Spatial and Graph Developer's Guide.
The following example finds the ten nearest U.S. Congressional districts to a specified point and orders them by distance from the point.
SELECT name, cdist
FROM table(sem_match(
'SELECT ?name ?cdist
WHERE
{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:nearestNeighbor(?cgeom,
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
"sdo_num_res=10")) }
ORDER BY ASC(orageo:distance(?cgeom,
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
"unit=KM"))'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '))
ORDER BY sem$rownum;
Returns a geometry object that is the topological intersection (AND operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_INTERSECTION function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose centroid is inside the intersection of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:relate(orageo:centroid(?cgeom),
orageo:intersection("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^orageo:WKTLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^orageo:WKTLiteral),
"mask=inside")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Unit of measurement: a quoted string with an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table (for example, "unit=KM"
). See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_LENGTH function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons with lengths (perimeters) greater than 1000 kilometers.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:legnth(?cgeom, "unit=KM") > 1000) }'
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Returns the minimum bounding rectangle of geom1
, that is, the single rectangle that minimally encloses geom1
.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_MBR function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose minimum bounding rectangle contains a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:relate(orageo:mbr(?cgeom),
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
"mask=contains")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
orageo:nearestNeighbor(geom1: geomLiteral, geom2 : geomLiteral, param : Literal) : xsd:boolean
Returns true
if geom1
is a nearest neighbor of geom2
, where the size of the nearest neighbors set is specified by param
; returns false
otherwise.
Geometry object. Specified as a query variable.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Determines the behavior of the operator. See the Usage Notes for the available keyword-value pairs.
In the param parameter, the available keyword-value pairs are:
distance=
n
specifies the maximum allowable distance for the nearest neighbor search.
sdo_num_res=
n
specifies the size of the set for the nearest neighbor search.
unit=
unit
specifies the unit of measurement to use with distance
value. If you do not specify a value, the unit of measurement associated with the data is used.
geom1
must be a local variable (that is, a variable that appears in the basic graph pattern that contains the orageo:nearestNeighbor
spatial filter).
It is a good idea to use a 'LEADING(?var)' HINT0
hint when your query involves a restrictive orageo:relate
spatial filter on ?var.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_NN operator in Oracle Spatial and Graph Developer's Guide.
The following example finds the ten nearest U.S. Congressional districts to a specified point.
SELECT name, cdist FROM table(sem_match( '{ # HINT0={LEADING(?cgeom)} ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (orageo:nearestNeighbor(?cgeom, "POINT(-71.46444 42.7575)"^^orageo:WKTLiteral, "sdo_num_res=10")) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')) ,null, null, null, ' ALLOW_DUP=T '));
Returns true
if geom1
and geom2
satisfy the topological spatial relation specified by the param
parameter; returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Specifies a list of mask relationships to check. See the list of keywords in the Usage Notes.
The following param
values (mask relationships) can be tested:
ANYINTERACT: Returns TRUE if the objects are not disjoint.
CONTAINS: Returns CONTAINS if the second object is entirely within the first object and the object boundaries do not touch; otherwise, returns FALSE.
COVEREDBY: Returns COVEREDBY if the first object is entirely within the second object and the object boundaries touch at one or more points; otherwise, returns FALSE.
COVERS: Returns COVERS if the second object is entirely within the first object and the boundaries touch in one or more places; otherwise, returns FALSE.
DISJOINT: Returns DISJOINT if the objects have no common boundary or interior points; otherwise, returns FALSE.
EQUAL: Returns EQUAL if the objects share every point of their boundaries and interior, including any holes in the objects; otherwise, returns FALSE.
INSIDE: Returns INSIDE if the first object is entirely within the second object and the object boundaries do not touch; otherwise, returns FALSE.
ON: Returns ON if the boundary and interior of a line (the first object) is completely on the boundary of a polygon (the second object); otherwise, returns FALSE.
OVERLAPBDYDISJOINT: Returns OVERLAPBDYDISJOINT if the objects overlap, but their boundaries do not interact; otherwise, returns FALSE.
OVERLAPBDYINTERSECT: Returns OVERLAPBDYINTERSECT if the objects overlap, and their boundaries intersect in one or more places; otherwise, returns FALSE.
TOUCH: Returns TOUCH if the two objects share a common boundary point, but no interior points; otherwise, returns FALSE.
Values for param
can be combined using the logical Boolean operator OR. For example, 'INSIDE + TOUCH' returns INSIDE+TOUCH
if the relationship between the geometries is INSIDE or TOUCH or both INSIDE and TOUCH; it returns FALSE
if the relationship between the geometries is neither INSIDE nor TOUCH.
When invoking orageo:relate
with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the orageo:relate
spatial filter).
It is a good idea to use a 'LEADING(?var)' HINT0
hint when your query involves a restrictive orageo:relate
spatial filter on ?var.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_RELATE operator in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district that contains a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:relate(?cgeom,
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
"mask=contains")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '
));
Returns a geometry object that is the topological union (OR operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_UN ION function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose centroid is inside the union of two specified polygons.
SELECT name, cdist FROM table(sem_match( '{ ?person usgovt:name ?name . ?person pol:hasRole ?role . ?role pol:forOffice ?office . ?office pol:represents ?cdist . ?cdist orageo:hasExactGeometry ?cgeom FILTER (orageo:relate(orageo:centroid(?cgeom), orageo:union("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5, -83.6 34.5, -83.6 34.1))"^^orageo:WKTLiteral, "Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5, -83.2 34.5, -83.2 34.3))"^^orageo:WKTLiteral), "mask=inside")) } ' ,sem_models('gov_all_vm'), null, ,sem_aliases( sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'), sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/')) ,null, null, null, ' ALLOW_DUP=T '));
orageo:withinDistance(geom1 : geomLiteral, geom2 : geomLiteral, distance : xsd:decimal, unit : Literal) : xsd:boolean
Returns true
if the distance between geom1
and geom2
is less than or equal to distance
when measured in unit
; returns false
otherwise.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Distance value.
Unit of measurement: a quoted string with an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table (for example, "unit=KM"
). See the section about unit of measurement support in Oracle Spatial and Graph Developer's Guide for more information about unit of measurement specification.
When invoking this function with a query variable and a constant geometry, always use the query variable as the first parameter and the constant geometry as the second parameter.
For best performance, geom1
should be a local variable (that is, a variable that appears in the basic graph pattern that contains the orageo:withinDistance
spatial filter).
It is a good idea to use a 'LEADING(?var)' HINT0
hint when your query involves a restrictive orageo:withinDistance
spatial filter on ?var.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_WITHIN_DISTANCE operator in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional districts that are within 100 kilometers of a specified point.
SELECT name, cdist
FROM table(sem_match(
'{ # HINT0={LEADING(?cgeom)}
?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:withinDistance(?cgeom,
"POINT(-71.46444 42.7575)"^^orageo:WKTLiteral,
100, "KM")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));
Returns a geometry object that is the topological symmetric difference (XOR operation) of geom1
and geom2
.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
Geometry object. Specified as a query variable or a constant geomLiteral
value.
See Section 1.6.11 for information about representing , indexing, and querying spatial data in RDF.
See also the SDO_GEOM.SDO_XOR function in Oracle Spatial and Graph Developer's Guide.
The following example finds the U.S. Congressional district polygons whose centroid is inside the symmetric difference of two specified polygons.
SELECT name, cdist
FROM table(sem_match(
'{ ?person usgovt:name ?name .
?person pol:hasRole ?role .
?role pol:forOffice ?office .
?office pol:represents ?cdist .
?cdist orageo:hasExactGeometry ?cgeom
FILTER (orageo:relate(orageo:centroid(?cgeom),
orageo:xor("Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,
-83.6 34.5, -83.6 34.1))"^^orageo:WKTLiteral,
"Polygon((-83.2 34.3, -83.0 34.3, -83.0 34.5,
-83.2 34.5, -83.2 34.3))"^^orageo:WKTLiteral),
"mask=inside")) } '
,sem_models('gov_all_vm'), null,
,sem_aliases(
sem_alias('usgovt','http://www.rdfabout.com/rdf/schema/usgovt/'),
sem_alias('pol','http://www.rdfabout.com/rdf/schema/politico/'))
,null, null, null, ' ALLOW_DUP=T '));