# SPARQL Examples
# During a five-minute break, the instructor loads everyone's foaf files into a redstore instance: https://www.aelius.com/njh/redstore/
# Who works at the Smathers Library?
PREFIX foaf:
PREFIX rdf:
PREFIX rdfs:
SELECT ?name
WHERE {
?person foaf:name ?name .
}
# What are their names and e-mail addresses?
PREFIX foaf:
PREFIX rdf:
PREFIX rdfs:
SELECT ?name ?email
WHERE {
?person foaf:name ?name .
?person foaf:mbox ?email .
}
#Create a picture gallery
PREFIX foaf:
PREFIX rdf:
PREFIX rdfs:
SELECT ?pic
WHERE {
?person foaf:depiction ?pic .
}
# Build a social network (understand inferencing and CONSTRUCT queries)
PREFIX foaf:
PREFIX rdf:
PREFIX rdfs:
CONSTRUCT {
foaf:knows ?coworker .
?coworker foaf:knows ?others . }
WHERE {
?coworker foaf:knows .
}