query-c44682a1ac03b1defd0485ec51fd9308
Returns a list of Wikidata items for a given list of Wikipedia article names
List of Wikipedia article names (lemma) is like "WIKIPEDIA ARTICLE NAME"@LANGUAGE CODE with de for German, en for English, etc.
Language version and project is defined in schema:isPartOF with de.wikipedia.org for German Wikipedia, es.wikivoyage for Spanish Wikivoyage, etc.
SELECT ?lemma ?item WHERE { VALUES ?lemma { "Wikipedia"@de "Wikidata"@de "Berlin"@de "Technische Universität Berlin"@de } ?sitelink schema:about ?item; schema:isPartOf https://de.wikipedia.org/; schema:name ?lemma. }
Use at
- https://query.wikidata.org/sparql
PREFIX schema: <http://schema.org/>
# Returns a list of Wikidata items for a given list of Wikipedia article names
# List of Wikipedia article names (lemma) is like "WIKIPEDIA ARTICLE NAME"@LANGUAGE CODE with de for German, en for English, etc.
# Language version and project is defined in schema:isPartOF with de.wikipedia.org for German Wikipedia, es.wikivoyage for Spanish Wikivoyage, etc.
SELECT ?lemma ?item WHERE {
VALUES ?lemma {
"Wikipedia"@de
"Wikidata"@de
"Berlin"@de
"Technische Universität Berlin"@de
}
?sitelink schema:about ?item;
schema:isPartOf <https://de.wikipedia.org/>;
schema:name ?lemma.
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v1("?lemma"):::projected
v2("?sitelink")
c3([https://de.wikipedia.org/]):::iri
bind0[/VALUES ?lemma/]
bind0-->v1
bind00([sWikipedia^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"])
bind00 --> bind0
bind01([sWikidata^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"])
bind01 --> bind0
bind02([sBerlin^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"])
bind02 --> bind0
bind03([sTechnische Universität Berlin^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"])
bind03 --> bind0
v2 --"schema:about"--> v3
v2 --"schema:isPartOf"--> c3
v2 --"schema:name"--> v1