query-55be7905c4022aa296e1a18f185a5d4f
to find all people with last name 'ପଟ୍ଟନାୟକ' (Q21492602) in Odia wikipedia and not mentioned in Wikidata)
SELECT ?item ?itemLabel (COUNT(distinct ?sitelink) as ?count)
WHERE {
  ?wikilink schema:about ?item .  { ?wikilink schema:isPartOf https://or.wikipedia.org/ . }
    ?item wdt:P31 wd:Q5. # all humans
  MINUS { ?item wdt:P734 [] . } # surname not mentioned in Wikidata
    ?item rdfs:label ?itemLabel.
      FILTER (lang(?itemLabel) = "or") .
      FILTER regex (?itemLabel, "(ପଟ୍ଟନାୟକ)$"). 
          OPTIONAL { ?sitelink schema:about ?item . ?sitelink schema:inLanguage ?lang }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC(?count)
LIMIT 123
Use at
- https://query.wikidata.org/sparql
 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# to find all people with last name 'ପଟ୍ଟନାୟକ' (Q21492602) in Odia wikipedia and not mentioned in Wikidata)
SELECT ?item ?itemLabel (COUNT(distinct ?sitelink) as ?count)
WHERE {
  ?wikilink schema:about ?item .  { ?wikilink schema:isPartOf <https://or.wikipedia.org/> . }
    ?item wdt:P31 wd:Q5. # all humans
  MINUS { ?item wdt:P734 [] . } # surname not mentioned in Wikidata
    ?item rdfs:label ?itemLabel.
      FILTER (lang(?itemLabel) = "or") .
      FILTER regex (?itemLabel, "(ପଟ୍ଟନାୟକ)$").   
          OPTIONAL { ?sitelink schema:about ?item . ?sitelink schema:inLanguage ?lang }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC(?count)
LIMIT 123
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?count")
  v4("?item"):::projected 
  v2("?itemLabel"):::projected 
  v6("?lang")
  v5("?sitelink"):::projected 
  v3("?wikilink")
  a1((" "))
  c7(["wd:Q5"]):::iri 
  c5([https://or.wikipedia.org/]):::iri 
  f0[["regex(?itemLabel,'(ପଟ୍ଟନାୟକ)$')"]]
  f0 --> v2
  f1[["?itemLabel = 'or'"]]
  f1 --> v2
  v3 --"schema:about"-->  v4
  v3 --"schema:isPartOf"-->  c5
  v4 --"wdt:P31"-->  c7
  subgraph minus2["MINUS"]
    style minus2 stroke-width:6px,fill:pink,stroke:red;
    v4 --"wdt:P734"-->  a1
  end
  v4 --"rdfs:label"-->  v2
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v5 -."schema:about".->  v4
    v5 --"schema:inLanguage"-->  v6
  end
  bind4[/"count(?sitelink)"/]
  v5 --o bind4
  bind4 --as--o v7