On 21/07/11 13:01, I wrote:
OntTools.Path path = findShortestPath( ... );
List<Resource> resources = new ArrayList<Resource>();
for (Statement s: path) {
resources.add( s.getResource() );
}
Actually, given that the terminus node can be a literal, it would be better as:
OntTools.Path path = findShortestPath( ... );
List<RDFNode> nodes = new ArrayList<RDFNode>();
for (Statement s: path) {
nodes.add( s.getObject() );
}
Unless you know from your data that the path will end on a resource.
Ian
