query-4e0a7714559591fd607f548567c6a7a7
Items with Internet Encyclopedia of Ukraine ID but no IEU identifier in en.Wikipedia
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?IEU_link ?enarticle WHERE {
BIND('en' AS ?lang). BIND(CONCAT(?lang, '.wikipedia.org') AS ?project).
?item wdt:P9070 ?IEU_ID . # item’s IEU ID wd:P9070 wdt:P1630 ?formatterurl . # get its formatter
?enarticle schema:about ?item ; schema:inLanguage ?lang ; schema:isPartOf https://en.wikipedia.org/ ; schema:name ?enname .
FILTER BOUND(?enarticle) # Safeguard to not get a timeout from unbound items when using ?enarticle below
MINUS {
# en.Wikipedia articles in Category:Wikipedia articles with IEU identifiers
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint ?project; # Set the project here
wikibase:api "Generator";
mwapi:generator "categorymembers"; # Selects the content from a category
mwapi:gcmtitle "Category:Wikipedia articles with IEU identifiers";. # Specifies the category
?enarticle wikibase:apiOutputItem mwapi:item.
}
}
# derive the IEU URL BIND(IRI(REPLACE( REPLACE(?IEU_ID, '\', '%5C', 'q'), # percent-encode backslash '^(.+)$', REPLACE(?formatterurl, '\', '%5C', 'q') # percent-encode backslash )) AS ?IEU_link) .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Items with Internet Encyclopedia of Ukraine ID but no IEU identifier in en.Wikipedia
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?IEU_link ?enarticle WHERE {
BIND('en' AS ?lang).
BIND(CONCAT(?lang, '.wikipedia.org') AS ?project).
?item wdt:P9070 ?IEU_ID . # item’s IEU ID
wd:P9070 wdt:P1630 ?formatterurl . # get its formatter
?enarticle schema:about ?item ;
schema:inLanguage ?lang ;
schema:isPartOf <https://en.wikipedia.org/> ;
schema:name ?enname .
FILTER BOUND(?enarticle) # Safeguard to not get a timeout from unbound items when using ?enarticle below
MINUS {
# en.Wikipedia articles in Category:Wikipedia articles with IEU identifiers
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint ?project; # Set the project here
wikibase:api "Generator";
mwapi:generator "categorymembers"; # Selects the content from a category
mwapi:gcmtitle "Category:Wikipedia articles with IEU identifiers";. # Specifies the category
?enarticle wikibase:apiOutputItem mwapi:item.
}
}
# derive the IEU URL
BIND(IRI(REPLACE(
REPLACE(?IEU_ID, '\\', '%5C', 'q'), # percent-encode backslash
'^(.+)$',
REPLACE(?formatterurl, '\\', '%5C', 'q') # percent-encode backslash
)) AS ?IEU_link) .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en" }
}