query-63d1c132a9e3283f4c0e8931e4dbf083

rq turtle/ttl

Propertiesinstance of (P31)child (P40)place of birth (P19)located in the administrative territorial entity (P131)native language (P103)languages spoken, written or signed (P1412)spouse (P26)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?statements ?linkcount ?itemLabel ?spouceLabel 
(GROUP_CONCAT(DISTINCT ?chld_label ;separator=', ') AS ?childs)
WHERE {
    ?item wdt:P31 wd:Q5 .   # item = humans only
    ?item wdt:P40 ?chld .
    ?chld rdfs:label ?chld_label 
          FILTER (lang(?chld_label) = "or") . # to get only Odia labels
  { ?item wdt:P19 wd:Q22048 }       # place of birth = Odisha (Q22048) 
    UNION  { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q22048 }    # OR place of birth within Odisha. 
    UNION {?item wdt:P103 wd:Q33810 }       # native language = Odia
    UNION {?item wdt:P1412 wd:Q33810 }      # OR language spoken/ written/ signed = Odia
 OPTIONAL { ?item wdt:P26 ?spouce  }
 ?item wikibase:statements ?statements . # for counting statements
  OPTIONAL { ?item wikibase:sitelinks ?linkcount. }  #count sitelinks
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en".}    # for generating label  
}
GROUP BY ?item ?statements ?linkcount ?itemLabel ?spouceLabel ?chldLabel 
ORDER BY DESC (?linkcount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?childs") v4("?chld") v2("?chld_label"):::projected v3("?item"):::projected v1("?linkcount"):::projected v5("?pob") v6("?spouce") v7("?statements"):::projected c7(["wd:Q22048"]):::iri c18(["#91;AUTO_LANGUAGE#93;, en"]):::literal c16(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c10(["wd:Q33810"]):::iri f0[["?chld_label = 'or'"]] f0 --> v2 v3 --"wdt:P31"--> c3 v3 --"wdt:P40"--> v4 v4 --"rdfs:label"--> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P1412"--> c10 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P103"--> c10 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> v5 v5 --"wdt:P131"--> c7 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> c7 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P26".-> v6 end v3 --"wikibase:statements"--> v7 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wikibase:sitelinks".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end bind2[/"?chld_label"/] v2 --o bind2 bind2 --as--o v8