path between two resources
问题 Is it possible to count the number of the edges that connect two instance with a SPARQL query? I want to find a path. 回答1: You count the number of edges in a unique path using SPARQL's property paths and aggregate functions. For instance, with data like this, which contains two paths that we care about ( a to c with two edges, and d to g with three edges): @prefix : <https://stackoverflow.com/questions/19587520/sparql-path-between-two-instance/> . :a :p :b . # a to c is a path of length 2 :b