问题
I am a beginner in SPARQL and I would like to know if it is possible to return relationships between two objects. For example I would like to write a SPARQL query which returns the relationship between Thierry Henry and Arsenal in dbpedia.
回答1:
SELECT ?relationship
WHERE {
<http://dbpedia.org/resource/Thierry_Henry>
?relationship
<http://dbpedia.org/resource/Arsenal_F.C.>
}
i.e.:
show me the predicates (
?relationship
) where the subject is the DBPedia resourceThierry_Henry
and the object is the DBPedia resourceArsenal_F.C.
..which results to:
dbpedia:ontology/team
dbpedia2:clubs
..which apparently means that Thierry Henry was part of the Arsenal team and belonged to the Arsenal Football Club. See the result on DBPedia SPARQL Explorer.
来源:https://stackoverflow.com/questions/32526559/is-it-possible-to-return-relationships-between-two-objects-in-sparql