#4175 SPARQL Multi-Hop Queries
#4175 SPARQL Multi-Hop Queries #4175 Describe the various multi-hop queries possible in SPARQL In the context of Knowledge Graphs, a multi-hop query refers to traversing multiple edges (predicates) to find a relationship between entities that are not directly connected. In SPARQL, this is primarily achieved through Property Paths . Property paths allow you to write concise patterns for complex traversals without explicitly naming every intermediate node. 1. Sequence Paths ( / ) The most fundamental multi-hop query. It connects a series of predicates in a specific order. Instead of writing multiple triple patterns, you use a forward slash to "hop" from one property to the next. Logic: Find A that has property p1 leading to B , which has property p2 leading to C . Syntax: ?subject :p1 / :p2 ?object . Example: Finding a person's "Grand-employer" (the company that owns the company they work for): ?person :worksFor / :ownedBy ?parentCompany . 2. Recursive ...