From: Ignazio P. <ipa...@gm...> - 2011-04-26 13:19:10
|
2011/4/25 Fernando Wagner <fer...@gm...>: > Hello Ignazio.. > > Thank you for the answer.. but i think this is not the cause of the problem, > because i use an OWLOntologyManager and alignmentAPi use another... > > I think the problem is the ontologies constructed by owlapi.. > When i construct, the owlapi set the same xml:base for both ontologies > > this is the value: xml:base="owlapi:ontology:ont1" > > Even caming from diferent ontologies.. I think the one ontology must have > this value, but another must have something like this: > > xml:base="owlapi:ontology:ont2" > > So, when alignment api calls it´s OWLOntologyManager, it´s see that both > ontologies have the same xml:base and the exception appear.. > > Have any way to control or set the value of xml:base through the owlapi??? Something is not right here; these are the lines involved: public OWLOntology createOntology(Set<OWLAxiom> axioms) throws OWLOntologyCreationException { return createOntology(axioms, getNextAutoGeneratedIRI()); } protected IRI getNextAutoGeneratedIRI() { autoGeneratedURICounter = autoGeneratedURICounter + 1; return IRI.create("owlapi:ontology:ont" + autoGeneratedURICounter); } So this means that two ontologies will have the same value only if they are created from a set of axioms by two different OWLOntologyManagers AND THEN moved into the same ontology manager. Are you doing something like that? One workaround would be to not create the ontology from a set of axioms, but first create the ontology passing in your IRI and then add to it the desired axioms. That way, you're in charge of which IRI to use. HTH, I. > > Thanks, > > Fernando > > > 2011/4/23 Ignazio Palmisano <ipa...@gm...> >> >> 2011/4/23 Fernando Wagner <fer...@gm...>: >> > Hello Friends, >> > >> > I´m trying to construct a subontologies from a ontologies. >> > The physical ontologies directory are given by user, >> > So I manipulate the classes and properties using OWLAPI and I create a >> > smaller ontology(subontology) with the same URI and some concepts and >> > properties from original ontology... >> > I make it with 2 ontologies, generating 2 subontologies.. >> > >> > But, when I using a AlignmentAPI to find an alignment between the two >> > subontologies, the compiler shows the error: >> >> (Nitpicking) this is not the compiler, it's the virtual machine >> running the code. Doesn't really matter... >> >> > >> > org.semanticweb.owlapi.model.OWLOntologyAlreadyExistsException: Ontology >> > already exists. <owlapi:ontology:ont1> >> > at >> > >> > uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:641) >> > at >> > >> > uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:584) >> > at >> > >> > fr.inrialpes.exmo.ontowrap.owlapi30.OWLAPI3OntologyFactory.loadOntology(Unknown >> > Source) >> > at >> > >> > fr.inrialpes.exmo.ontowrap.owlapi30.OWLAPI3OntologyFactory.loadOntology(Unknown >> > Source) >> > at fr.inrialpes.exmo.align.impl.ObjectAlignment.loadOntology(Unknown >> > Source) >> > at fr.inrialpes.exmo.align.impl.ObjectAlignment.init(Unknown Source) >> > at UtilAlignmentAPI.NameAndProperty(UtilAlignmentAPI.java:99) >> > at Teste.main(Teste.java:67) >> > >> > As we can see, the error is generated by owlapi.. When the alignmentapi >> > tries to load a subontology.. >> > >> > I saw the javadoc(Class OWLOntologyAlreadyExistsException) and I found >> > this: >> > Constructs an OWLOntologyAlreadyExistsException to describe the >> > situation >> > where an attempt to create an ontology failed because the manager >> > already >> > contained an ontology with specified ontology ID. >> > >> > How the owlapi knows that i have another ontology with the same URI? >> >> It knows because you are using the same OWLOntologyManager for both >> ontologies. >> >> > How can I make a "clean" in the "manager" to avoid this error? >> >> You can either remove the original ontology from the manager, or use a >> second manager for the subontology. >> >> > How can I align these two subontologies without this error? >> > How can I fix this? >> > >> > Ps: The two subontologies are temporary files.. they will be removed >> > from >> > the system when the user finish the program... >> >> That is not important for the manager. >> >> > Ps2: The program is part of my final work in a graduate course.. so if >> > someone could answer me quickly, i will be very grateful.. : ) >> > >> >> Ah well, just study harder then :-P >> HTH, >> I. >> >> > Thanks.. >> > >> > Fernando >> > >> > >> > ------------------------------------------------------------------------------ >> > Fulfilling the Lean Software Promise >> > Lean software platforms are now widely adopted and the benefits have >> > been >> > demonstrated beyond question. Learn why your peers are replacing JEE >> > containers with lightweight application servers - and what you can gain >> > from the move. http://p.sf.net/sfu/vmware-sfemails >> > _______________________________________________ >> > Owlapi-developer mailing list >> > Owl...@li... >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > >> > >> >> >> ------------------------------------------------------------------------------ >> Fulfilling the Lean Software Promise >> Lean software platforms are now widely adopted and the benefits have been >> demonstrated beyond question. Learn why your peers are replacing JEE >> containers with lightweight application servers - and what you can gain >> from the move. http://p.sf.net/sfu/vmware-sfemails >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |