query-a8f6df0192a94bdedbd59f979992e057

rq turtle/ttl

Questions about correlating Wikipedia titles and Wikidata IDs[I'm new to this chat page. If there's a better place to ask this sort of question, please let me know.] the way it's done: I don't see Wikidata IDs in Wikipedia articles anywhere. (And indeed they'd be a nuisance to maintain, and subject to vandalism.) notI believe one of the first uses of Wikidata on the Wikipedias was to properly systematize interwiki language links. I always assumed this was done by having a template somewhere in each Wikipedia article containing its Wikidata ID, and then machinery somewhere used that Wikidata ID to look up the names of the articles in other language Wikipedias on the same topic. But that's evidently So I guess that when displaying interwiki language links, a query is first done to discover the Wikidata ID corresponding to the original article's name. Am I correct? Anyway, that's by way of background. I've been wanting to look up Wikidata IDs corresponding to Wikipedia article names myself. I finally constructed this SPARQL query:

Use at

PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?id WHERE {
    ?article schema:about ?id; schema:inLanguage "en"; schema:name "Boston"@en .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?article") v2("?id"):::projected c3(["en"]):::literal c5([sBoston^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal v1 --"schema:about"--> v2 v1 --"schema:inLanguage"--> c3 v1 --"schema:name"--> c5