如何将简单的词汇线与 GeoSPARQL:sfWithin 和多边形一起使用?
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:Line
是 geo: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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论