On 03/03/11 00:31, Tim Harsch wrote:
If I have a regular model that was loaded with N-triples, and those N-triples 
represented an OWL ontology, how could I write it back out such that I would 
see everything in OWL XML?

What I did was something similar to:
Model curModel = FileManager.get().loadModel(file);

OntModel asOwl = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
asOwl.add(curModel);
FileWriter fstream = new FileWriter(filePath);

BufferedWriter out = new BufferedWriter(fstream);
grandSchema.write(out);

grandSchema.write( out, "RDF/XML-ABBREV" ), per [1]

Ian

[1] http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/Model.html#write(java.io.OutputStream,%20java.lang.String)

--
____________________________________________________________
Ian Dickinson                   Epimorphics Ltd, Bristol, UK
mailto:[email protected]        http://www.epimorphics.com
cell: +44-7786-850536              landline: +44-1275-399069
------------------------------------------------------------
Epimorphics Ltd.  is a limited company registered in England
(no. 7016688). Registered address: Court Lodge, 105 High St,
              Portishead, Bristol BS20 6PT, UK

Reply via email to