I am trying to execute Geosparql Queries using RDFLIB Python...But I am getting empty results....Is RDFLIB Python supports Geosparql queries ? Please suggest me regarding this. Below is my code to store tripples and query for execution.
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)
Above code always returns me empty results.