如何将简单的词汇线与 GeoSPARQL:sfWithin 和多边形一起使用?

发布于 2025-01-14 06:01:55 字数 1195 浏览 4 评论 0原文

RDF:

prefix ex: <http://www.example.org/> 
prefix geo: <http://www.opengis.net/ont/geosparql#> 

ex:b7 a sf:Line ;
geo:asWKT "<http://www.opengis.net/def/crs/EPSG/0/4326> LINESTRING(55.3 -160.5,55.3 -160.5)^^geo:wktLiteral .

SPARQL 查询:

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix geo: <http://www.opengis.net/ont/geosparql#> 
prefix geof: <http://www.opengis.net/def/function/geosparql/>
prefix sf: <http://www.opengis.net/ont/sf#> 
prefix ex: <http://www.example.org/> 
prefix ogis: <http://www.opengis.net/def/uom/OGC/1.0/>

select * where {
  ?a a sf:Line .
  FILTER (geo:sfWithin(?a, "<http://www.opengis.net/def/crs/EPSG/0/4326> POLYGON((50 -170, 50 -140, 60 -140, 60 -170))"^^geo:wktLiteral))
}

在 Virtuoso 的开源版本中,这会导致错误:

Virtuoso 42000 Error RDFGE: RDF box with a geometry RDF type and a non-geometry content

该行是否还需要声明为 geo:Geometry

编辑: sf:Linegeo:Geometry 的子类,所以我认为它可以以相同的方式使用。

RDF:

prefix ex: <http://www.example.org/> 
prefix geo: <http://www.opengis.net/ont/geosparql#> 

ex:b7 a sf:Line ;
geo:asWKT "<http://www.opengis.net/def/crs/EPSG/0/4326> LINESTRING(55.3 -160.5,55.3 -160.5)^^geo:wktLiteral .

SPARQL query:

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix geo: <http://www.opengis.net/ont/geosparql#> 
prefix geof: <http://www.opengis.net/def/function/geosparql/>
prefix sf: <http://www.opengis.net/ont/sf#> 
prefix ex: <http://www.example.org/> 
prefix ogis: <http://www.opengis.net/def/uom/OGC/1.0/>

select * where {
  ?a a sf:Line .
  FILTER (geo:sfWithin(?a, "<http://www.opengis.net/def/crs/EPSG/0/4326> POLYGON((50 -170, 50 -140, 60 -140, 60 -170))"^^geo:wktLiteral))
}

In open-source edition of Virtuoso this results in the error:

Virtuoso 42000 Error RDFGE: RDF box with a geometry RDF type and a non-geometry content

Does the line also need to be declared as a geo:Geometry?

Edit: sf:Line is a subclass of geo:Geometry, so I assumed it could be used in the same fashion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文