query-627ed2f7f3f18f8d3eadd0658cb2f2b9

rq turtle/ttl

Co-attestors

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q126810823>

SELECT 
  ?overlap

  ?attestor ?attestorLabel
  (CONCAT("#lexemeattestor/", SUBSTR(STR(?attestor), 32)) AS ?attestorUrl)

  ?example_lexeme ?example_lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?example_lexeme), 32)) AS ?example_lexemeUrl)
WHERE {
   {
  SELECT 
    (COUNT(?lexeme) AS ?overlap)
    ?attestor
    (SAMPLE(?lexeme) AS ?example_lexeme)
  WHERE {
    ?lexeme wdt:P5323 target:, ?attestor .
    FILTER (?attestor != target:)
  }
  GROUP BY ?attestor
}  ?example_lexeme wikibase:lemma ?example_lexemeLabel . 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?overlap)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?attestor"):::projected v6("?attestorUrl") v4("?example_lexeme"):::projected v5("?example_lexemeLabel"):::projected v7("?example_lexemeUrl") v3("?lexeme") v4("?overlap"):::projected c1([http://www.wikidata.org/entity/Q126810823]):::iri c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?attestor != http://www.wikidata.org/entity/Q126810823"]] f0 --> v2 v3 --"wdt:P5323"--> c1 v3 --"wdt:P5323"--> v2 bind3[/"count(?lexeme)"/] v3 --o bind3 bind3 --as--o v4 bind4[/"sample(?lexeme)"/] v3 --o bind4 bind4 --as--o v4 v4 --"wikibase:lemma"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind5[/"concat('#lexemeattestor/',substring(str(?attestor),'32^^xsd:integer'))"/] v2 --o bind5 bind5 --as--o v6 bind6[/"concat('#lexeme/',substring(str(?example_lexeme),'32^^xsd:integer'))"/] v4 --o bind6 bind6 --as--o v7