Difference between revisions of "Languages"

From Wikidocumentaries
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
<pre>
 
<pre>
SELECT ?item ?itemLabel ?local ?wmcode ?systemLabel ?dirLabel ?iso1 ?iso2 ?iso3 ?ietf WHERE {
+
SELECT DISTINCT ?item ?itemLabel (GROUP_CONCAT(?local;SEPARATOR=" | ") as ?locals) ?wmcode ?systemLabel ?dirLabel (GROUP_CONCAT(?iso1;SEPARATOR=" | ") as ?iso1_all) (GROUP_CONCAT(?iso2;SEPARATOR=" | ") as ?iso2_all) (GROUP_CONCAT(?iso3;SEPARATOR=" | ") as ?iso3_all) ?ietf WHERE {
 
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
 
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
   ?item wdt:P424 ?wmcode.
+
  ?item wdt:P279* wd:Q17376908.
 +
   ?item wdt:P424 ?wmcode .
 
   OPTIONAL { ?item wdt:P1705 ?local. }
 
   OPTIONAL { ?item wdt:P1705 ?local. }
 
   OPTIONAL { ?item wdt:P218 ?iso1. }
 
   OPTIONAL { ?item wdt:P218 ?iso1. }
Line 11: Line 12:
 
   OPTIONAL { ?item wdt:P305 ?ietf. }
 
   OPTIONAL { ?item wdt:P305 ?ietf. }
 
   OPTIONAL { ?item wdt:P282 ?system .
 
   OPTIONAL { ?item wdt:P282 ?system .
           ?system wdt:P1406 ?dir.}
+
           OPTIONAL { ?system wdt:P1406 ?dir. }
 +
          }
 
}
 
}
 +
GROUP BY ?item ?itemLabel ?wmcode ?systemLabel ?dirLabel ?ietf
 
</pre>
 
</pre>
 +
 +
Language codes need to be collated, but they are not critical in the spreadsheet.
 +
 +
<pre>
 +
SELECT ?wiki ?wikiLabel ?lang ?langLabel ?wikicode ?url WHERE {
 +
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 +
  ?wiki wdt:P31 wd:Q10876391.
 +
  OPTIONAL { ?wiki wdt:P856 ?url . }
 +
  OPTIONAL { ?wiki wdt:P407 ?lang.
 +
          ?lang wdt:P424 ?wikicode }
 +
}
 +
</pre>
 +
 +
This information about Wikipedias is on a separate sheet.
  
 
Google sheets: https://docs.google.com/spreadsheets/d/1dUllEr-g8vLsLJDkOVYUNcnRavIZrqV2gfGu4BCfUw4/edit?usp=sharing
 
Google sheets: https://docs.google.com/spreadsheets/d/1dUllEr-g8vLsLJDkOVYUNcnRavIZrqV2gfGu4BCfUw4/edit?usp=sharing

Latest revision as of 09:19, 25 May 2022

Query

SELECT DISTINCT ?item ?itemLabel (GROUP_CONCAT(?local;SEPARATOR=" | ") as ?locals) ?wmcode ?systemLabel ?dirLabel (GROUP_CONCAT(?iso1;SEPARATOR=" | ") as ?iso1_all) (GROUP_CONCAT(?iso2;SEPARATOR=" | ") as ?iso2_all) (GROUP_CONCAT(?iso3;SEPARATOR=" | ") as ?iso3_all) ?ietf WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  ?item wdt:P279* wd:Q17376908.
  ?item wdt:P424 ?wmcode .
  OPTIONAL { ?item wdt:P1705 ?local. }
  OPTIONAL { ?item wdt:P218 ?iso1. }
  OPTIONAL { ?item wdt:P219 ?iso2. }
  OPTIONAL { ?item wdt:P220 ?iso3. }
  OPTIONAL { ?item wdt:P305 ?ietf. }
  OPTIONAL { ?item wdt:P282 ?system .
           OPTIONAL { ?system wdt:P1406 ?dir. }
           }
}
GROUP BY ?item ?itemLabel ?wmcode ?systemLabel ?dirLabel ?ietf

Language codes need to be collated, but they are not critical in the spreadsheet.

SELECT ?wiki ?wikiLabel ?lang ?langLabel ?wikicode ?url WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?wiki wdt:P31 wd:Q10876391.
  OPTIONAL { ?wiki wdt:P856 ?url . }
  OPTIONAL { ?wiki wdt:P407 ?lang. 
           ?lang wdt:P424 ?wikicode }
}

This information about Wikipedias is on a separate sheet.

Google sheets: https://docs.google.com/spreadsheets/d/1dUllEr-g8vLsLJDkOVYUNcnRavIZrqV2gfGu4BCfUw4/edit?usp=sharing