query-b6ad1f1d7e3e7f7a0ef88f7d6a5c9528

rq turtle/ttl

Query #6: Graph librarian OR subclass of librarian whos field of work is either: (linked data; linked open data; OR Semantic Web)

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#>
#defaultView:Graph
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?orcidIdURL ?fieldOfWork ?fieldOfWorkLabel ("CF0A2C" as ?rgb) 
WHERE
{
  {?item wdt:P31 wd:Q5 ; # instance of a human
         rdfs:label ?itemLabel .
   ?item wdt:P106/wdt:P279* wd:Q182436 ; # librarian OR Sub-class of librarian
         wdt:P106 ?occupation .
   ?item wdt:P101 wd:Q515701 ; # linked data
         wdt:P101 ?fieldOfWork .
   OPTIONAL {?item wdt:P496 ?orcidId} .
   BIND (URI(CONCAT("https://orcid.org/", ENCODE_FOR_URI (?orcidId))) AS ?orcidIdURL)
   FILTER (lang(?itemLabel) = "en") 
  }
 UNION
  {?item wdt:P31 wd:Q5 ; # instance of a human
         rdfs:label ?itemLabel .
   ?item wdt:P106/wdt:P279* wd:Q182436 ; # librarian OR Sub-class of librarian
         wdt:P106 ?occupation .
   ?item wdt:P101 wd:Q18692990 ; # linked open data
         wdt:P101 ?fieldOfWork .
   OPTIONAL {?item wdt:P496 ?orcidId} .
   BIND (URI(CONCAT("https://orcid.org/", ENCODE_FOR_URI (?orcidId))) AS ?orcidIdURL)
   FILTER (lang(?itemLabel) = "en") 
  }
 UNION
  {?item wdt:P31 wd:Q5 ; # instance of a human
         rdfs:label ?itemLabel .
   ?item wdt:P106/wdt:P279* wd:Q182436 ; # librarian OR Sub-class of librarian
         wdt:P106 ?occupation .
   ?item wdt:P101 wd:Q54837 ; # Semantic Web
         wdt:P101 ?fieldOfWork .
   OPTIONAL {?item wdt:P496 ?orcidId} .
   BIND (URI(CONCAT("https://orcid.org/", ENCODE_FOR_URI (?orcidId))) AS ?orcidIdURL)
   FILTER (lang(?itemLabel) = "en") 
  }
 FILTER(?fieldOfWork IN (wd:Q18692990, wd:Q515701, wd:Q54837 )) # Filter out 'Field of Work' values NOT in this list
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?fieldOfWork"):::projected v3("?item"):::projected v1("?itemLabel"):::projected v4("?occupation") v5("?orcidId") v7("?orcidIdURL"):::projected v7("?rgb") a1((" ")) a2((" ")) a3((" ")) c3(["wd:Q54837"]):::iri c2(["wd:Q515701"]):::iri c1(["wd:Q18692990"]):::iri c4(["en"]):::literal c10(["wd:Q182436"]):::iri c14(["bd:serviceParam"]):::iri c6(["wd:Q5"]):::iri list0c3(["wd:Q54837"]):::iri list0c2(["wd:Q515701"]):::iri list0c1(["wd:Q18692990"]):::iri list0c1 --o f0 list0c2 --o f0 list0c3 --o f0 f0[[" in "]] f0 --> 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; f1[["?itemLabel = 'en'"]] f1 --> v1 v3 --"wdt:P31"--> c6 v3 --"rdfs:label"--> v1 v3 --"wdt:P106"--> a3 a3 --"wdt:P279"--> c10 v3 --"wdt:P106"--> v4 v3 --"wdt:P101"--> c3 v3 --"wdt:P101"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P496".-> v5 end bind2[/"concat('https://orcid.org/',encode-for-uri(?orcidId))"/] v5 --o bind2 bind2 --as--o v7 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; f3[["?itemLabel = 'en'"]] f3 --> v1 v3 --"wdt:P31"--> c6 v3 --"rdfs:label"--> v1 v3 --"wdt:P106"--> a2 a2 --"wdt:P279"--> c10 v3 --"wdt:P106"--> v4 v3 --"wdt:P101"--> c1 v3 --"wdt:P101"--> v2 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P496".-> v5 end bind4[/"concat('https://orcid.org/',encode-for-uri(?orcidId))"/] v5 --o bind4 bind4 --as--o v7 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; f5[["?itemLabel = 'en'"]] f5 --> v1 v3 --"wdt:P31"--> c6 v3 --"rdfs:label"--> v1 v3 --"wdt:P106"--> a1 a1 --"wdt:P279"--> c10 v3 --"wdt:P106"--> v4 v3 --"wdt:P101"--> c2 v3 --"wdt:P101"--> v2 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P496".-> v5 end bind6[/"concat('https://orcid.org/',encode-for-uri(?orcidId))"/] v5 --o bind6 bind6 --as--o v7 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c4 end bind7[/"'CF0A2C'"/] bind7 --as--o v7