Hello friends,

I need to output the result of FindShortestPath(Model, start, end, filter)
to a file. I have already tried some methods. I got the result at a variable

Path pathOut  = FSP.findShortestPath(...);

as I print the output, it is ok. I get the right triples

As I try to read it into an RDF file, I got no success:

I am trying this block :

caminho = AchaCaminhoMaisCurto.findShortestPath(m_model, m_a, m_g, ANY);
        System.out.println("Shortest path: " +
(AchaCaminhoMaisCurto.findShortestPath(m_model, m_a, m_g, ANY)));
        try {
            PrintStream saida = new PrintStream ("file_path/saida9.rdf");
            caminho.write(saida);
            //saida.close();

                    } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

Compiler says:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method write(PrintStream) is undefined for the type OntTools.Path

    at ferramentas.Principal.main(Principal.java:169)

By the way: I have already tested to write the m_model, of course I got the
whole ontology. That is not what I need, I need only the classes in the
path.
Ok, It is all right, but which writing method should I use with OntTools?

The code is at:  http://fpaste.org/U7ni/

-- 
Herli Menezes
*Per Astra ad aspera.*

Reply via email to