我正在尝试使用RDFLIB Python执行Geosparql查询...但是我得到的是空结果.... RDFLIB Python是否支持Geosparql查询?请就此建议我。下面是我的存储三元组并查询执行的代码。
from rdflib import Graph, Literal, URIRef, Namespace, RDFS
from rdflib.plugins.stores import sparqlstore
g1 = Graph()
g1.bind("geo", GEO)
x = URIRef("x:")
example = Namespace("http://example.org/#")
g1.add((x, GEO["asWKT"], Literal("LINESTRING (0 0, 0 10)", datatype=GEO.wktLiteral)))
g1.serialize(format="turtle").decode("utf-8")
qres = g1.query(
"""SELECT *
WHERE {
?s ?p ?o FILTER (geo:sfEquals(?o, "LINESTRING (0 0, 0 5, 0 10)"^^geo:wktLiteral)) .
}""")
print(g1.serialize(format="turtle").decode("utf-8"))
for row in qres:
print(row)
以上代码总是返回空结果。
答案 0 :(得分:0)
对不起,RDFLlib没有内置的GeoSPARQL扩展,只有SPARQL1.1。
我们-RDFlib开发人员-希望有人提供GeoSPARQL处理!