query-67c858ee8efe5a88d56433f3c35cdf2e
Elasticsearch is being used only during the call to the wikibase:mwapi SERVICE.
Everything happening outside this call is handled by Blazegraph, such as MINUS.
SELECT ?item ?itemLabel WHERE { SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint "www.wikidata.org"; wikibase:api "EntitySearch"; mwapi:search "front matter"; # Search for things named "front matter" mwapi:language "en". ?item wikibase:apiOutputItem mwapi:item. } MINUS { ?item wdt:P31 wd:Q13442814 . # but MINUS any of those things that are instances of scholarly article } SERVICE wikibase:label {bd:serviceParam wikibase:language "en".} }
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Elasticsearch is being used only during the call to the wikibase:mwapi SERVICE.
# Everything happening outside this call is handled by Blazegraph, such as MINUS.
SELECT ?item ?itemLabel WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "www.wikidata.org";
wikibase:api "EntitySearch";
mwapi:search "front matter"; # Search for things named "front matter"
mwapi:language "en".
?item wikibase:apiOutputItem mwapi:item.
}
MINUS {
?item wdt:P31 wd:Q13442814 . # but MINUS any of those things that are instances of scholarly article
}
SERVICE wikibase:label {bd:serviceParam wikibase:language "en".}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
c4(["www.wikidata.org"]):::literal
c8(["front matter"]):::literal
c12(["mwapi:item"]):::iri
c10(["en"]):::literal
c2(["bd:serviceParam"]):::iri
c6(["EntitySearch"]):::literal
c14(["wd:Q13442814"]):::iri
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:endpoint"--> c4
c2 --"mwapi:api"--> c6
c2 --"mwapi:search"--> c8
c2 --"mwapi:language"--> c10
v1 --"mwapi:apiOutputItem"--> c12
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P31"--> c14
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c10
end