Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Created March 12, 2018 14:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baskaufs/222ed08b2026a0c2551edc9b3c9b404c to your computer and use it in GitHub Desktop.
Save baskaufs/222ed08b2026a0c2551edc9b3c9b404c to your computer and use it in GitHub Desktop.
Starter query for constructing
PREFIX adhoc: <https://rawgit.com/HeardLibrary/semantic-web/master/adhoc#>
PREFIX dcterms: <http://purl.org/dc/terms/>
CONSTRUCT {
?person adhoc:status "student". # use "employee" for employees
?person adhoc:identifierSource "wikidata".
?person rdfs:label ?label.
?person dcterms:description ?description.
}
WHERE {
?person wdt:P69 wd:Q29052. # educated at Vanderbilt, use P108 for employer
?person wdt:P31 wd:Q5. # instance of human
?person rdfs:label ?label.
FILTER ( langMatches(lang(?label),"en" ))
OPTIONAL {
?person skos:altLabel ?alt.
FILTER ( langMatches(lang(?alt),"en" ))
}
?person schema:description ?description.
FILTER ( langMatches(lang(?description),"en" ))
OPTIONAL {?person wdt:P569 ?birthDate.}
OPTIONAL {?person wdt:P735 ?givenName.}
OPTIONAL {?person wdt:P734 ?familyName.}
OPTIONAL {?person wdt:P21 ?gender.}
OPTIONAL {?person wdt:P496 ?orcidId.}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment