:- use_module(library(semweb/rdf11)).inverse_of and
symmetric predicate properties. The version rdf_reachable/5 
maximizes the steps considered and returns the number of steps taken.
If both S and O are given, these predicates are semidet. 
The number of steps D is minimal because the implementation 
uses
breadth first search.
:- use_module(library(semweb/rdf_db)). [nondet]rdf_reachable(?Subject, 
+Predicate, ?Object, +MaxD, -D)
[nondet]rdf_reachable(?Subject, 
+Predicate, ?Object, +MaxD, -D)infinite to impose no distance-limit.