from-negatives-to-knowledge

Home

📊 SPARQL Queries


🔍 Query #1: Graph of People from WikiProject African Diaspora

This CONSTRUCT query builds a graph of individuals associated with the WikiProject African diaspora (Q15304953). It includes their place of birth, date of birth/death, and occupation using schema.org and skos vocabularies.

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 .
  ?item schema:occupation ?occupation .

  ?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")
}
LIMIT 100

▶️ Run this query on Wikidata Query Service