query-cc5547549f9538acfb98995cb4673f4f

rq turtle/ttl

title: People accociated with a university who have no LCCN SELECT DISTINCT ?academic ?academicLabel ?academicDescription ?academicAltLabel ?viafurl ?orcidurl WHERE {

?academic wdt:P31 wd:Q5 . # academic is a person

{ ?academic wdt:P69 wd:Q1150437 . #educated at Victoria University of Wellington } UNION { ?academic wdt:P108 wd:Q1150437 . # employed by Victoria University of Wellington }

FILTER NOT EXISTS { ?academic wdt:P244 ?lccn . } # filter out those with an lccn OPTIONAL { ?academic wdt:P214 ?viaf . BIND( IRI(CONCAT('https://viaf.org/viaf/', STR(?viaf))) AS ?viafurl ) . } . OPTIONAL { ?academic wdt:P496 ?orcid . BIND( IRI(CONCAT('https://orcid.org/', STR(?orcid))) AS ?orcidurl ) . } . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: People accociated with a university who have no LCCN
SELECT DISTINCT ?academic ?academicLabel ?academicDescription ?academicAltLabel ?viafurl ?orcidurl WHERE {

   ?academic wdt:P31 wd:Q5 . # academic is a person

   {
     ?academic wdt:P69 wd:Q1150437 . #educated at Victoria University of Wellington
   } UNION {
     ?academic wdt:P108 wd:Q1150437 . # employed by Victoria University of Wellington
   } 

   FILTER NOT EXISTS { ?academic wdt:P244 ?lccn . } # filter out those with an lccn
   OPTIONAL { ?academic wdt:P214 ?viaf .  BIND( IRI(CONCAT('https://viaf.org/viaf/', STR(?viaf)))  AS ?viafurl ) . } . 
   OPTIONAL { ?academic wdt:P496 ?orcid .  BIND( IRI(CONCAT('https://orcid.org/', STR(?orcid)))  AS ?orcidurl ) . } . 
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?academic"):::projected v2("?lccn") v5("?orcid") v6("?orcidurl"):::projected v3("?viaf") v4("?viafurl"):::projected c10(["bd:serviceParam"]):::iri c5(["wd:Q1150437"]):::iri c3(["wd:Q5"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P244"--> e0v2 e0v1("?academic"):::projected e0v2("?lccn"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P244"--> v2 v1 --"wdt:P31"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P108"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P69"--> c5 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P214".-> v3 bind1[/"concat('https://viaf.org/viaf/',str(?viaf))"/] v3 --o bind1 bind1 --as--o v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P496".-> v5 bind2[/"concat('https://orcid.org/',str(?orcid))"/] v5 --o bind2 bind2 --as--o v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end