From: Ignazio P. <ipa...@gm...> - 2011-05-19 07:50:43
|
2011/5/19 Fernando Wagner <fer...@gm...>: > Hello friends, > > I having a problem with create and save ontology..I create some axioms: > > SubClassOf(reviewedarticle publication) > SubClassOf(journalarticle reviewedarticle) > > And I use the foloowing constructor to create an ontology: > > subontology = manager.createOntology(Axiomas,ontologyURI); > > Where subontology is a OWLOntology, Axiomas is a set of OWLAxiom and > ontologyURI = http://www.example.org/ontology1 > > After, I use: > > manager.setPhysicalURIForOntology(subontology, documentURI); > > where documentURI = file:///C:/Users/Fernando/Documents/test1.owl > > But, the ontology isn´t been physically created, and no error or exception > messages are displayed. > So, when I try to save more axioms in the ontology: > > manager.saveOntology(subontology,manager.getOntologyFormat(ontology)); I must still be sleeping: the problem is here. You just created the ontology, so it doesn't have a format already, hence getOntologyFormat() returns a null, and that's the reason for the problem. You need to explicitly specify a format, or use the default (which is what you said you are doing). HTH, I. > > The following error appears: > > Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException > at > org.coode.owl.latex.LatexOntologyStorer.canStoreOntology(LatexOntologyStorer.java:58) > at > uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:574) > at > uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:559) > at UtilOWLAPI.ConstroiSubontologia(UtilOWLAPI.java:755) > at > InterfacePrincipal$RecorteHandler.actionPerformed(InterfacePrincipal.java:719) > > Someone can help me?? > > Really Thanks, > > Fernando > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |