Closed momo54 closed 1 year ago
UNDEF
gives Service URI not bound: ?bgp2
. Considering second solution...
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT ?product ?label ?propertyTextual WHERE { VALUES ( ?bgp1 ?bgp2 ) { ( http://localhost:34202/sparql/?default-graph-uri=http://www.vendor9.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite52.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.vendor44.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite48.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.vendor17.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite33.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite64.fr/ UNDEF ) ( http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite61.fr/ UNDEF ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.vendor15.fr/ ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.vendor68.fr/ ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.vendor7.fr/ ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.vendor26.fr/ ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite2.fr/ ) ( UNDEF http://localhost:34202/sparql/?default-graph-uri=http://www.ratingsite61.fr/ ) } { SERVICE ?bgp1 { ?product rdfs:label ?label .
?product rdf:type ?localProductType .
?localProductType owl:sameAs bsbm:ProductType597 .
# const!* bsbm:ProductFeature18499
?product bsbm:productFeature ?localProductFeature1 .
?localProductFeature1 owl:sameAs bsbm:ProductFeature18499.
# const** bsbm:ProductFeature19842 != bsbm:ProductFeature18499
?product bsbm:productFeature ?localProductFeature2 .
?localProductFeature2 owl:sameAs bsbm:ProductFeature19842.
?product bsbm:productPropertyTextual1 ?propertyTextual .
?product bsbm:productPropertyNumeric1 ?p1 .
# const** "1002.0"^^xsd:double < ?p1
FILTER ( ?p1 > "1002.0"^^xsd:double )
}
} UNION {
SERVICE ?bgp2 {
?product rdfs:label ?label .
# const!* bsbm:ProductType597
?product rdf:type ?localProductType .
?localProductType owl:sameAs bsbm:ProductType597 .
# const!* bsbm:ProductFeature18499
?product bsbm:productFeature ?localProductFeature1 .
?localProductFeature1 owl:sameAs bsbm:ProductFeature18499 .
# const* bsbm:ProductFeature27760 != bsbm:ProductFeature19842, bsbm:ProductFeature18499
?product bsbm:productFeature ?localProductFeature3 .
?localProductFeature3 owl:sameAs bsbm:ProductFeature27760 .
?product bsbm:productPropertyTextual1 ?propertyTextual .
?product bsbm:productPropertyNumeric2 ?p2 .
# const "656.0"^^xsd:double < ?p2
FILTER ( ?p2 > "656.0"^^xsd:double )
}
}
} ORDER BY ?product ?label ?propertyTextual
LIMIT 10
Regarding your remark on "it returns too much data, " I think you are referring to querying against http://localhost:34202/sparql/?default-graph-uri=
which is a combination of all graphs. If so, we are querying against http://localhost:34202/sparql/?default-graph-uri=nan
, a non-existent endpoint that gives no results.
The q04 ARQ query is wrong (RSFB/experiments/bsbm/benchmark/evaluation/arq/q04/instance_5/batch_6/attempt_3/service.sparql):
A correct source selection for a union query should be like that:
another correct and more efficient rewriting can be: