SmartDataAnalytics / Sparqlify

Sparql -> SQL Rewriter enabling virtual RDB -> RDF mappings
http://aksw.org/Projects/Sparqlify
124 stars 13 forks source link

Error in aggregate function #32

Open Aklakan opened 11 years ago

Aklakan commented 11 years ago

Executing this on LinkedGeoData gives:

Prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix ogc: <http://www.opengis.net/ont/geosparql#>
Prefix geom: <http://geovocab.org/geometry#>
Prefix lgdo: <http://linkedgeodata.org/ontology/>

Select ?class (COUNT(?class) as ?cnt) {
  ?type
    a ?class ;
    rdfs:label ?schoolLabel ;
    geom:geometry [
       ogc:asWKT ?typeGeo
    ] .
FILTER ( ?class != <http://geovocab.org/spatial#Feature> && ?class != <http://linkedgeodata.org/meta/Node> && ?class != <http://linkedgeodata.org/ontology/Amenity> && ?class !=<http://linkedgeodata.org/ontology/Shop> )
  Filter (
    bif:st_intersects (?typeGeo, bif:st_point (13.40826, 52.518749), 0.5)
  ) .
}
GROUP BY ?class
ORDER BY ?cnt

java.lang.RuntimeException: Could not decide on a best match from a set of candidates
    at org.aksw.sparqlify.core.algorithms.MappingOpsImpl.rewrite(MappingOpsImpl.java:2155)
Aklakan commented 11 years ago

The query seems to work in principle (gives timeout on LGD) if COUNT(?class) is replaced with COUNT(*). This makes somewhat sense, as there as at present count with arguments is not declared and/or implemented.