Wikidata:Synia:language-language-index

From Wikidata
Jump to navigation Jump to search

Synia: language - languages

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q9035>

SELECT 
  ?description ?descriptionLabel
  ("#composer" AS ?descriptionUrl)

  ?value ?valueLabel ?valueUrl

  ?wikidata ?wikidataUrl

  ?scholia ?scholiaUrl

  ?ordia ?ordiaUrl

WHERE {
  {
    BIND(1 AS ?order)
    BIND(wd:Q34770 AS ?description)
    
    BIND(target: AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32)) AS ?valueUrl)
    
    BIND("Wikidata&nbsp;↗" AS ?wikidata)
    BIND(CONCAT("https://www.wikidata.org/wiki/", SUBSTR(STR(?value), 32)) AS ?wikidataUrl)

    BIND("Scholia&nbsp;↗" AS ?scholia)
    BIND(CONCAT("https://scholia.toolforge.org/language/", SUBSTR(STR(?value), 32)) AS ?scholiaUrl)

    BIND("Ordia&nbsp;↗" AS ?ordia)
    BIND(CONCAT("https://ordia.toolforge.org/language/", SUBSTR(STR(?value), 32)) AS ?ordiaUrl)

  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
ORDER BY ?order
Try it!

Languages derived from

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q9035>

SELECT 
  ?count
  (CONCAT("#language/", SUBSTR(STR(target:), 32), "/language/", SUBSTR(STR(?language), 32)) AS ?countUrl)

  ?language ?languageLabel
  (CONCAT("#language/", SUBSTR(STR(?language), 32)) AS ?languageUrl)

  ?originating_example_lexeme ?originating_example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?originating_example_lexeme), 32)) AS ?originating_example_lexemeUrl)
WITH {
  SELECT
    (COUNT(?lexeme) AS ?count)
    ?language
    (SAMPLE(?originating_lexeme) AS ?originating_example_lexeme)
  WHERE {
    ?lexeme dct:language target: ;
            wdt:P5191+ ?originating_lexeme .
    ?originating_lexeme dct:language ?language .
  }
  GROUP BY ?language
} AS %languages
WHERE {
  INCLUDE %languages
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?originating_example_lexeme wikibase:lemma ?originating_example_lexemeLabel .
}
ORDER BY DESC(?count)
Try it!

Languages derived to

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q9035>

SELECT 
  ?count
  (CONCAT("#language/", SUBSTR(STR(target:), 32), "/language/", SUBSTR(STR(?language), 32)) AS ?countUrl)

  ?language ?languageLabel
  (CONCAT("#language/", SUBSTR(STR(?language), 32)) AS ?languageUrl)

  ?derived_example_lexeme ?derived_example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?derived_example_lexeme), 32)) AS ?derived_example_lexemeUrl)
WITH {
  SELECT
    (COUNT(?lexeme) AS ?count)
    ?language
    (SAMPLE(?derived_lexeme) AS ?derived_example_lexeme)
  WHERE {
    ?lexeme dct:language target: ;
            ^wdt:P5191+ ?derived_lexeme .
    ?derived_lexeme dct:language ?language .
  }
  GROUP BY ?language
} AS %languages
WHERE {
  INCLUDE %languages
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?derived_example_lexeme wikibase:lemma ?derived_example_lexemeLabel .
}
ORDER BY DESC(?count)
Try it!