query-be4403b906986babb90d3c5d6f46f6ee
Number of languages a Wikipedia page has been translated intoI'm trying to get the number of Wikipedia pages languages Italian books 1980-2021 have been translated into. For instance, "My brilliant friend" has been translated into 4 other wikipedia pages. My query returns results but, for instance, doesn't count "My brilliant friend" and I was wondering why.
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?label ?authorlabel (count(?lang) as ?numWikipediaLanguages) WHERE {
VALUES ?type {wd:Q571 wd:Q7725634}
?item wdt:P31 ?type .
?item wdt:P577 ?date .
?item wdt:P50 ?author .
?author wdt:P1559 ?authorlabel filter (lang(?label) = "en")
FILTER (?date > "1979-01-01T00:00:00Z"^^xsd:dateTime) .
?item rdfs:label ?label filter (lang(?label) = "en")
?item wdt:P407 wd:Q652.
?article schema:about ?item ;
schema:inLanguage ?lang ;
schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
} group by ?item ?label ?authorlabel
ORDER BY DESC(?numWikipediaLanguages)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?article")
v6("?author")
v7("?authorlabel"):::projected
v3("?date")
v5("?item"):::projected
v2("?label"):::projected
v9("?lang"):::projected
v10("?numWikipediaLanguages")
v4("?type")
a1((" "))
c9(["wd:Q652"]):::iri
c13(["wikipedia"]):::literal
f0[["?label = 'en'"]]
f0 --> v2
f1[["?date > '1979-01-01T00:00:00Z^^xsd:dateTime'"]]
f1 --> v3
f2[["?label = 'en'"]]
f2 --> v2
bind3[/VALUES ?type/]
bind3-->v4
bind30(["wd:Q571"])
bind30 --> bind3
bind31(["wd:Q7725634"])
bind31 --> bind3
v5 --"wdt:P31"--> v4
v5 --"wdt:P577"--> v3
v5 --"wdt:P50"--> v6
v6 --"wdt:P1559"--> v7
v5 --"rdfs:label"--> v2
v5 --"wdt:P407"--> c9
v8 --"schema:about"--> v5
v8 --"schema:inLanguage"--> v9
a1 --"wikibase:wikiGroup"--> c13
v8 --"schema:isPartOf"--> a1
bind5[/"count(?lang)"/]
v9 --o bind5
bind5 --as--o v10