我在 Virtuoso 服务器上安装了一个本体。
在这个本体中,我有 2 类:
- 称为 POI 的兴趣点
- 区域称为 AREA
每个 POI 具有以下关系:
{ POI gis:hasGeometry ?xx .
?xx gis:asWKT ?WKTexpression }
例如,WKTExpression
可以是"POINT(11.2589271 43.8004469)"^^gis:wktLiteral
每个 AREA 具有以下关系:
{ AREA gis:hasGeometry ?xx .
?xx gis:asWKT ?WKTexpression }
--a在WKTexpression
哪里"POLYGON()"^^gis:wktLiteral
如何使用 GEOSPARQL 查询提取特定区域内的所有 POI?
我可以做这样的事情吗?
SELECT *
WHERE
{
?element gis:hasGeometry ?point .
?point <IS INSIDE> "POLYGON(...)"^^gis:wktLiteral
}
====================================
更新 1:我在 Virtuoso 7 中尝试这个查询:
SELECT *
WHERE {
?sensor <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?fWKT .
FILTER (ogcgsf:sfWithin(?fWKT, "POLYGON((11.170005798339842 43.845174931181276,11.157989501953123 43.83130720030931,11.152496337890625 43.82040886498103,11.160392761230469 43.78596696172772,11.172409057617186 43.75745685244749,11.179962158203125 43.74431283565997,11.215324401855467 43.72818887413058,11.244850158691406 43.72694838956602,11.27265930175781 43.74183250878846,11.299781799316404 43.76464763976463,11.331024169921873 43.79166735265696,11.29566192626953 43.824619821317356,11.216697692871094 43.841708300627744,11.172409057617186 43.84888895466105,11.170005798339842 43.845174931181276))"^^geo:wktLiteral))}
但我回来了:
Virtuoso 42001 Error SR185: Undefined procedure DB.DBA.http://www.opengis.net/def/function/geosparql/sfWithin.