Wikidata:Synia:language

From Wikidata
Jump to navigation Jump to search

Synia: language

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

SELECT
  ?description
  ?value ?valueUrl

  ?wikidata ?wikidataUrl
  ?hangor ?hangorUrl
  ?ordia ?ordiaUrl
  ?scholia ?scholiaUrl
WHERE {
  {
    BIND(1 AS ?order)
    BIND("Language" AS ?description)
    target: rdfs:label ?value_string .
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, SUBSTR(STR(target:), 32)) AS ?value)
    
    BIND(CONCAT(SUBSTR(STR(target:), 32), "&nbsp;↗") AS ?wikidata)
    BIND(CONCAT("https://www.wikidata.org/wiki/", SUBSTR(STR(target:), 32)) AS ?wikidataUrl)
    
    BIND("Hangor&nbsp;↗" AS ?hangor)
    BIND(CONCAT("https://hangor.toolforge.org/browse/", SUBSTR(STR(target:), 32)) AS ?hangorUrl)

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

    BIND("Scholia&nbsp;↗" AS ?scholia)
    BIND(CONCAT("https://scholia.toolforge.org/language/", SUBSTR(STR(target:), 32)) AS ?scholiaUrl)
  }
  UNION
  {
    SELECT
      (2 AS ?order)
      ("Number of lexemes" AS ?description)
      (COUNT(*) AS ?value)
    {
      [] dct:language target: .
      BIND(1 AS ?dummy)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    SELECT
      (3 AS ?order)
      ("Number of senses" AS ?description)
      (COUNT(*) AS ?value)
      (CONCAT("#language/", SUBSTR(STR(target:), 32), "/sense") AS ?valueUrl)
    WHERE {
      [] ^ontolex:sense / dct:language target: .
      BIND(1 AS ?dummy)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    SELECT
      (4 AS ?order)
      ("Number of forms" AS ?description)
      (COUNT(*) AS ?value)
    {
      [] ^ontolex:lexicalForm / dct:language target: .
      BIND(1 AS ?dummy)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    BIND(10 AS ?order)
    BIND("Number of speakers" AS ?description)
    target: wdt:P1098 ?value .
  }
} 
ORDER BY ?order
Try it!

Subaspects

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

SELECT
  ?value ?valueUrl
WHERE {
  {
    BIND(10 AS ?order)
    BIND("Podcasts 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/podcast") AS ?valueUrl)
  }
  UNION
  {
    BIND(11 AS ?order)
    BIND("Publishers 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/publisher") AS ?valueUrl)
  }
  UNION
  {
    BIND(20 AS ?order)
    BIND("Languages 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/language") AS ?valueUrl)
  }
  UNION
  {
    BIND(21 AS ?order)
    BIND("Lexeme attestor 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/lexemeattestor") AS ?valueUrl)
  }
  UNION
  {
    BIND(22 AS ?order)
    BIND("Lexeme descriptors 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/lexemedescriptor") AS ?valueUrl)
  }
  UNION
  {
    BIND(23 AS ?order)
    BIND("Lexeme senses 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/lexemesense") AS ?valueUrl)
  }
  UNION
  {
    BIND(30 AS ?order)
    BIND("Locations 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/location") AS ?valueUrl)
  }
  UNION
  {
    BIND(31 AS ?order)
    BIND("Composers 🔍" AS ?value)
    BIND(CONCAT("#language/", SUBSTR(STR(target:), 32), "/composer") AS ?valueUrl)
  }
} 
ORDER BY ?value
Try it!

Newest words

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

SELECT 
  (xsd:date(MIN(?publication_datetime)) AS ?publication_date)
  ?lexeme 
  (SAMPLE(?lemma) AS ?lexemeLabel)
  (CONCAT("#lexeme/", SUBSTR(STR(?lexeme), 32)) AS ?lexemeUrl)
WHERE {
  ?lexeme dct:language target: ;
          wikibase:lemma ?lemma ;
          (wdt:P5323 / wdt:P577)| (p:P5323 / pq:P577) ?publication_datetime .
}
GROUP BY ?lexeme
ORDER BY DESC(?publication_date)
Try it!

Lexemes

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

SELECT
  (SAMPLE(?forms_) AS ?forms)
  ?lexeme
  (GROUP_CONCAT(?lemma; separator=", ") AS ?lexemeLabel)
  (CONCAT("#lexeme/", SUBSTR(STR(?lexeme), 32)) AS ?lexemeUrl)

  ("Ordia ↗" AS ?ordia)
  (CONCAT("https://ordia.toolforge.org/", SUBSTR(STR(?lexeme), 32)) AS ?ordiaUrl)
WITH {   
  SELECT 
    (COUNT(*) AS ?forms_)
    ?lexeme 
  WHERE {
    ?lexeme dct:language target: ;
            ontolex:lexicalForm [] .  
  }
  GROUP BY ?lexeme
  ORDER BY DESC(?forms_)
  LIMIT 500
} AS %lexemes
WHERE {
  INCLUDE %lexemes
  ?lexeme wikibase:lemma ?lemma ;
}
GROUP BY ?lexeme
ORDER BY DESC(?forms)
Try it!

Lexeme classes

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

SELECT 
  ?count
  ?class ?classLabel ?classDescription 
  ?example_lexeme ?example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?example_lexeme), 32)) AS ?example_lexemeUrl)
WITH {
  SELECT 
    (COUNT(?lexeme) AS ?count)
    ?class
    (SAMPLE(?lexeme) AS ?example_lexeme)
  WHERE {
    ?lexeme dct:language target: ;
            wdt:P31 ?class .
  }
  GROUP BY ?class
} AS %classes
WHERE {
  INCLUDE %classes
  ?example_lexeme wikibase:lemma ?example_lexemeLabel
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)
Try it!

Lexeme images

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

#defaultView:ImageGrid
SELECT 
  ?image
  ?lexeme ?lemma
WHERE {
  ?lexeme dct:language target: ;
          wikibase:lemma ?lemma ;
          wdt:P18 ?image .
}
Try it!