query-191e7952176462a1c08eab5762ea88b6
1000 items with a P279 but without a P31 neither a P279
The request spends 39 seconds without the ORDER RAND() and 10 seconds with
SELECT DISTINCT ?item ?itemLabel WHERE { # Items with a BnF identifier ?item wdt:P268 [] .
# Without a P31 neither a P279 MINUS { ?item wdt:P31 [] } MINUS { ?item wdt:P279 [] }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en" } } ORDER BY RAND() LIMIT 1000
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# 1000 items with a P279 but without a P31 neither a P279
# The request spends 39 seconds without the ORDER RAND() and 10 seconds with
SELECT DISTINCT ?item ?itemLabel
WHERE
{
# Items with a BnF identifier
?item wdt:P268 [] .
# Without a P31 neither a P279
MINUS { ?item wdt:P31 [] }
MINUS { ?item wdt:P279 [] }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en" }
}
ORDER BY RAND()
LIMIT 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
a1((" "))
a2((" "))
a3((" "))
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,fr,en"]):::literal
v1 --"wdt:P268"--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P31"--> a2
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P279"--> a3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end