Hi,

I want to write a Jena rule which could deduce the fact that 'Sheep have found 
in the field'. To do this, I have got only geometries of sheep in the form of 
GPS coordinates like Point(longitude latitude) e.g. POINT(-3.783065 53.202158). 
Similarly, I have got the geometries of the field in the same format. My 
question is how can I match the sheep's geometries with that of field 
geometries and deduce the said fact. In SPARQL, I have done the same task 
through the following SPARQL Query with the help of GeoSPARQL functions and it 
runs succesfully:

Query: Are sheep found in the field?

ASK WHERE {

       ?sheep rdf:type enviot:SheepNodeOutput ;
            geosparql:hasGeometry ?sgeo.
        ?sgeo geosparql:asWKT ?swkt.

        ?feature rdf:type enviot:Field;
    geosparql:hasGeometry ?fgeo.
        ?fgeo geosparql:asWKT ?fwkt.

    FILTER(geof:sfIntersects(?swkt, ?fwkt))

   }

By the way, my jsonld data borrows/uses the vocabulary from my ontology which 
uses the GeoSPARQL Ontology as well.

Can someone please give their thoughts/ideas about this issue/challenge? There 
is a built-in primitive in Jena i.e. equal(?x, ?y) but I don't know whether it 
works for comparing geo coordinates like Point(long lat) or not.

Many thanks in advance,

Izhar

Reply via email to