[nondet]rdf_reachable(?S,
+P, ?O)
[nondet]rdf_reachable(?S,
+P, ?O, +MaxD, -D)True when O can be reached from S using the
transitive closure of P. The predicate uses (the internals
of) rdf_has/3 and thus matches
both rdfs:subPropertyOf and the 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.
[nondet]rdf_reachable(?Subject,
+Predicate, ?Object, +MaxD, -D)Same as rdf_reachable/3, but
in addition, MaxD limits the number of edges expanded and D
is unified with the‘distance’between
Subject and Object. Distance 0 means Subject
and Object are the same resource. MaxD can be the
constant infinite
to impose no distance-limit.