Closed mhoangvslev closed 1 year ago
injected
queries (if any)provenance
queries (if any)sameAs
as late as possible.DEFINE sql:select-option "order"
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT ?product ?localProductLabel
WHERE {
{
# const ?ProductXYZ
?localProductXYZ owl:sameAs ?ProductXYZ .
?localProductXYZ bsbm:productFeature ?localProdFeatureXYZ .
?localProdFeatureXYZ owl:sameAs ?prodFeature .
?localProductXYZ bsbm:productPropertyNumeric1 ?origProperty1 .
?localProductXYZ bsbm:productPropertyNumeric2 ?origProperty2 .
} .
{
?localProduct owl:sameAs ?product .
FILTER (?ProductXYZ != ?product)
?localProduct rdfs:label ?localProductLabel .
?localProduct bsbm:productFeature ?localProdFeature .
?localProdFeature owl:sameAs ?prodFeature .
?localProduct bsbm:productPropertyNumeric1 ?simProperty1 .
?localProduct bsbm:productPropertyNumeric2 ?simProperty2 .
} .
# Values are pre-determined because we knew the boundaries from the normal distribution
FILTER(?simProperty1 < (?origProperty1 + 20) && ?simProperty1 > (?origProperty1 - 20))
FILTER(?simProperty2 < (?origProperty2 + 70) && ?simProperty2 > (?origProperty2 - 70))
}
# ORDER BY ?localProductLabel
LIMIT 5
Given the query below:
This query takes forever to evaluate, even on batch 0. Some join order optimization is needed here.