query-e0f9a5767d107723ce6c680b79770594

rq turtle/ttl

Historians with links to French Wikipedia or Wikisource, but missing VIAF id SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5 . ?item wdt:P106 wd:Q201788 .

# Here we ask people with no VIAF id FILTER NOT EXISTS { ?item wdt:P214 ?viaf . } # But the ones we already know they don't have one show up anyway # so we filter out people with "No value" for VIAF id FILTER NOT EXISTS { ?item rdf:type wdno:P214 . }

?wikilink schema:about ?item . { ?wikilink schema:isPartOf https://fr.wikisource.org/ . } UNION { ?wikilink schema:isPartOf https://fr.wikipedia.org/ . }

SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" . } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Historians with links to French Wikipedia or Wikisource, but missing VIAF id
SELECT ?item ?itemLabel WHERE {
  ?item wdt:P31 wd:Q5 .
  ?item wdt:P106 wd:Q201788 .

  # Here we ask people with no VIAF id
  FILTER NOT EXISTS { ?item wdt:P214 ?viaf . }
  # But the ones we already know they don't have one show up anyway
  # so we filter out people with "No value" for VIAF id
  FILTER NOT EXISTS { ?item rdf:type wdno:P214 . }

  ?wikilink schema:about ?item .
  { ?wikilink schema:isPartOf <https://fr.wikisource.org/> . } UNION {
    ?wikilink schema:isPartOf <https://fr.wikipedia.org/> . }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" . }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?viaf") v3("?wikilink") c2(["wdno:P214"]):::iri c10([https://fr.wikisource.org/]):::iri c11([https://fr.wikipedia.org/]):::iri c15(["fr"]):::literal c7(["wd:Q201788"]):::iri c13(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"a"--> e0c2 e0v1("?item"):::projected e0c2(["wdno:P214"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"a"--> c2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P214"--> e1v2 e1v1("?item"):::projected e1v2("?viaf"):::projected end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c3 f1 --> v2 v1 --"wdt:P214"--> v2 v1 --"wdt:P31"--> c5 v1 --"wdt:P106"--> c7 v3 --"schema:about"--> v1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"schema:isPartOf"--> c11 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"schema:isPartOf"--> c10 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end