From: Matthew H. <mat...@cs...> - 2008-10-16 14:42:24
|
Hi Magg, Take a look at implementation of InferredAxiomGenerator. You need to instantiate them and add them the "gens" list in you code below. Cheers, Matthew On 15 Oct 2008, at 22:53, Magda S. wrote: > Hi, > > How can I save all axioms from the inferred ontology? Now, my piece > of code: > > ------------ > OWLOntologyManager mgr = OWLManager.createOWLOntologyManager(); > > OWLOntology ont = mgr.loadOntologyFromPhysicalURI(URI.create( > "file:/home/magg/ontologies/a/bcopy.owl")); > > Reasoner r = new Reasoner(mgr); > > Set<OWLOntology> importsClosure = mgr.getImportsClosure(ont); > r.loadOntologies(importsClosure); > > r.classify(); > > // saving the inferred ontology > // for inferring axioms > List<InferredAxiomGenerator<? extends OWLAxiom>> gens = > new ArrayList<InferredAxiomGenerator<? extends OWLAxiom>>(); > gens.add(new InferredSubClassAxiomGenerator()); > // for writing inferred axioms to the new ontology > OWLOntology infOnt = > mgr.createOntology(URI.create(ont.getURI() + "_inferred")); > > // use generator and reasoner to infer some axioms > InferredOntologyGenerator iog = new > InferredOntologyGenerator(r, gens); > iog.fillOntology(mgr, infOnt); > // save the ontology > mgr.saveOntology(infOnt, > new RDFXMLOntologyFormat(), > URI.create("file:///home/magg/ontologies/a/inferredont.rdf > ")); > ------------ > And it saves only classes, no individuals, no object properties, no > general axioms, etc. Any ideas how I could save all this information + > all imports + inferred facts? > > Thanks in advance, > > Magg > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |