query-d68d6bec44feb0a6f9a072b3640cea6c

rq turtle/ttl

Query #13: Construct a graph of people on the WikiProject African diaspora project list (Q15304953), including their place of birth and occupation (skos/schema.org example)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
CONSTRUCT 
{
 ?item a skos:Concept,schema:Person . 
 ?item skos:prefLabel ?itemLabel .
 ?item skos:definition ?description .
 ?item schema:birthDate ?dateOfBirth .
 ?item schema:deathDate ?dateOfDeath .
 ?item schema:birthPlace ?placeOfBirth .
 ?occupation a skos:Concept,schema:Occupation .
 ?occupation skos:prefLabel ?occupationLabel .
 ?occupation schema:description ?occupation_description .
 ?placeOfBirth a skos:Concept,schema:Place .
 ?placeOfBirth skos:prefLabel ?placeOfBirthLabel .
 ?placeOfBirth schema:description ?placeOfBirth_description .
}  
WHERE
{
 ?item wdt:P5008 wd:Q15304953 ;
     wdt:P31 wd:Q5 ; 
     wdt:P31 ?instanceOf .
 ?item schema:description ?description .
 FILTER (LANG(?description) = "en")
 ?item wdt:P106 ?occupation .
 ?occupation rdfs:label ?occupationLabel .   
 FILTER (LANG(?occupationLabel) = "en")
 ?occupation schema:description ?occupation_description .
 FILTER (LANG(?occupation_description) = "en")
 ?item wdt:P569 ?dateOfBirth .  
 OPTIONAL{?item wdt:P570 ?dateOfDeath} . 
 ?item wdt:P19 ?placeOfBirth .            
 ?placeOfBirth rdfs:label ?placeOfBirthLabel .   
 FILTER (LANG(?placeOfBirthLabel) = "en")          
 ?placeOfBirth schema:description ?placeOfBirth_description .
 FILTER (LANG(?placeOfBirth_description) = "en")           
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} LIMIT 1

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v14("?_const_1b5f379b_uri") v13("?_const_4171603_uri") v23("?_const_53799c01_uri") v18("?_const_5b1cf727_uri") v22("?_const_5fa4fb96_uri"):::projected v19("?_const_60d7325c_uri") v20("?_const_92fc0ae_uri") v21("?_const_9b707291_uri") v17("?_const_baac53b8_uri") v15("?_const_c9f3cb8c_uri") v12("?_const_f5e5585a_uri") v9("?dateOfBirth"):::projected v10("?dateOfDeath"):::projected v5("?description"):::projected v7("?instanceOf"):::projected v6("?item"):::projected v16("?itemLabel"):::projected v8("?occupation"):::projected v4("?occupationLabel"):::projected v3("?occupation_description"):::projected v11("?placeOfBirth"):::projected v2("?placeOfBirthLabel"):::projected v1("?placeOfBirth_description"):::projected c3(["wd:Q15304953"]):::iri c13(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?placeOfBirth_description = 'en'"]] f0 --> v1 f1[["?placeOfBirthLabel = 'en'"]] f1 --> v2 f2[["?occupation_description = 'en'"]] f2 --> v3 f3[["?occupationLabel = 'en'"]] f3 --> v4 f4[["?description = 'en'"]] f4 --> v5 v6 --"wdt:P5008"--> c3 v6 --"wdt:P31"--> c5 v6 --"wdt:P31"--> v7 v6 --"schema:description"--> v5 v6 --"wdt:P106"--> v8 v8 --"rdfs:label"--> v4 v8 --"schema:description"--> v3 v6 --"wdt:P569"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P570".-> v10 end v6 --"wdt:P19"--> v11 v11 --"rdfs:label"--> v2 v11 --"schema:description"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind5[/""a""/] bind5 --as--o v12 bind6[/"'skos:Concept'"/] bind6 --as--o v13 bind7[/"'schema:Person'"/] bind7 --as--o v14 bind8[/"'skos:prefLabel'"/] bind8 --as--o v15 bind9[/"?itemLabel"/] v16 --o bind9 bind9 --as--o v16 bind10[/"'skos:definition'"/] bind10 --as--o v17 bind11[/"'schema:birthDate'"/] bind11 --as--o v18 bind12[/"'schema:deathDate'"/] bind12 --as--o v19 bind13[/"'schema:birthPlace'"/] bind13 --as--o v20 bind14[/"'schema:Occupation'"/] bind14 --as--o v21 bind15[/"'schema:description'"/] bind15 --as--o v22 bind16[/"'schema:Place'"/] bind16 --as--o v23