Hi Herli,

On 21/07/11 12:47, Herli Joaquim de Menezes wrote:
Thank you, once more, Andy.

I think that I missed one point (I discoverd later). The Path from OntTools
is an owl model, isn't? I thought that it was an RDF model.
No. From the Javadoc:

public static OntTools.Path findShortestPath(
    Model m,
    Resource start,
    RDFNode end,
    com.hp.hpl.jena.util.iterator.Filter<Statement> onPath)

A Model would not preserve the order of statements, which would make the path more-or-less useless. A path is a subclass of a (Java) List<Statement>, with a couple of extra convenience methods for finding the thing (Statement or Resource) at the end of the path.

What I want to do is apparently simple:
1. Using "findShortesPath" I got a path containing a  chained sequence of
resources.
2. I need to get these resources by name in order to perform a query on a
triple store [RDF metadata stored in SDB, and use Joseki as SPARQL
endpoint];

OntTools.Path path = findShortestPath( ... );
List<Resource> resources = new ArrayList<Resource>();
for (Statement s: path) {
    resources.add( s.getResource() );
}

You may or may not want to also push the starting resource onto the list, depending on your application.

3. From this query I could access the physical localization of resources (it
is recorded in RDF metadata document);
4. Get these resources (collection of xml file) which will be presented to
the user.
5. In order to do this, I devised a web based system (MVC). In the model
there are javabeans which access a conventional database which saves user
preferences etc, and a SDB/Joseki module as the semantic side of the system.

I followed these steps: (1) create a simple test ontology (ok); (2) extract
the shortest path (ok); (3) read information on path to query SDB (fail),
this is the bottleneck of the research. How pass info from path to the to
javabean in order to perform the query?

So I wondered if the names of resources could be inserted in a list as
strings things would be easier.

Thanks,

HJdM

Ian

Reply via email to