List talk

Difference between revisions of "Deu/Elemente"

(document creation)
 
(make query more useful for other languages)
 
Line 2: Line 2:
  
 
<syntaxhighlight lang="sparql">
 
<syntaxhighlight lang="sparql">
SELECT ?element ?elementLabel ?number WHERE {
+
SELECT ?listEntry WHERE {
 +
  BIND("de" AS ?language)
 
   ?element wdt:P31 wd:Q11344;
 
   ?element wdt:P31 wd:Q11344;
 
           wdt:P1086 ?number.
 
           wdt:P1086 ?number.
 
   FILTER(?number >= 1 && ?number <= 118)
 
   FILTER(?number >= 1 && ?number <= 118)
   SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
+
   OPTIONAL {
 +
    ?element rdfs:label ?label.
 +
    FILTER(LANG(?label) = ?language)
 +
  }
 +
  BIND(COALESCE(
 +
    CONCAT("# ", ?label),
 +
    CONCAT("<!-- WARNING: no ", ?language, " label for element with number ", STR(?number), "! -->")
 +
  ) AS ?listEntry)
 
}
 
}
 
ORDER BY ?number
 
ORDER BY ?number
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
To create the corresponding list for your own language, replace the language code in line 2. --[[User:Lucas Werkmeister|Lucas Werkmeister]] ([[User talk:Lucas Werkmeister|talk]]) 13:20, 17 June 2018 (UTC)

Latest revision as of 13:20, 17 June 2018

Created with the following query on WDQS:

SELECT ?listEntry WHERE {
  BIND("de" AS ?language)
  ?element wdt:P31 wd:Q11344;
           wdt:P1086 ?number.
  FILTER(?number >= 1 && ?number <= 118)
  OPTIONAL {
    ?element rdfs:label ?label.
    FILTER(LANG(?label) = ?language)
  }
  BIND(COALESCE(
    CONCAT("# ", ?label),
    CONCAT("<!-- WARNING: no ", ?language, " label for element with number ", STR(?number), "! -->")
  ) AS ?listEntry)
}
ORDER BY ?number

To create the corresponding list for your own language, replace the language code in line 2. --Lucas Werkmeister (talk) 13:20, 17 June 2018 (UTC)