Any suggestion on how to optimize this type of query.
it is very slow in stardog 4.2.3.
Apparently the chain from country -> state -> municipality is what makes it slow.
SELECT ?fa ?building ?fa_id ?net_floor_area ?actual_purpose ?country_id ?state_id ?municipality_id ?lat ?long ?building_id ?construction_year ?availability
WHERE {
?fa realestate:building_detail ?building .
?fa ontologies:id ?fa_id .
?fa realestate:net_floor_area ?net_floor_area .
?fa realestate:actual_purpose ?actual_purpose .
?building gn:locatedIn ?country .
?country ontologies:id ?country_id .
?country a geospatial:country .
?building gn:locatedIn ?state .
?state ontologies:id ?state_id .
?state a geotmp:state .
?building gn:locatedIn ?municipality .
?municipality ontologies:id ?municipality_id .
?municipality a geotmp:municipality .
?building wgs84:lat ?lat .
?building wgs84:long ?long .
?building ontologies:id ?building_id .
?building realestate:construction_year ?construction_year .
VALUES ?fa
{
http://geophy.io/functionalareas/131071
http://geophy.io/functionalareas/131072
http://geophy.io/functionalareas/131073
http://geophy.io/functionalareas/131074
}
}