Just follow the property values...
SELECT ?rname ?lname
WHERE {
?inst a :Popular_restaurant .
?inst :restaurant_name ?rname .
?inst :Location_name ?lname .
}
But that's just the end result. A way to understand SPARQL is to start pedantically. For example:
SELECT ?inst
WHERE {
?inst a :Popular_restaurant .
}
That gets you all members of the class :Popular_restaurant. Then find what properties are defined for each member:
SELECT ?inst ?p ?o
WHERE {
?inst a :Popular_restaurant .
?inst ?p ?o .
}
And the bindings for p
will tell you what properties are defined for members of this class. So use those values to continuously refine the query.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.