Protege, OWL API and Imports

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Protege, OWL API and Imports

Thomas D.
Hi all,

My apologies if this might not entirely fit in the Protege user ML.

I have created an ontology in Protege which imports another one. Both
are stored locally on my computer.
I also started to use some Java code and the OWL API to work with these
ontologies. I'm able to load and go through the basic ontology (without
import) just fine but I can't load the one with an import and get a File
Missing Exception.
I've looked on the web and find that the AutoIRIMapper should solve this
problem but it actually returns me an empty ontology. That is, if
ontology A imports ontology B, using the Mapper I'm able to see the
concepts of A but not of B (but Java doesn't throw any Exception).

Do you have any idea on how to solve this problem?

Thanks in advance.
Regards,
Thomas D.

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Protege, OWL API and Imports

Joshua TAYLOR
On Mon, Mar 17, 2014 at 12:59 PM, Thomas D <[hidden email]> wrote:

>
> My apologies if this might not entirely fit in the Protege user ML.
>
> I have created an ontology in Protege which imports another one. Both are
> stored locally on my computer.
> I also started to use some Java code and the OWL API to work with these
> ontologies. I'm able to load and go through the basic ontology (without
> import) just fine but I can't load the one with an import and get a File
> Missing Exception.
> I've looked on the web and find that the AutoIRIMapper should solve this
> problem but it actually returns me an empty ontology. That is, if ontology A
> imports ontology B, using the Mapper I'm able to see the concepts of A but
> not of B (but Java doesn't throw any Exception).

This sounds like it would be much more appropriate on the OWL API
mailing list. The OWL API documentation includes examples that show
the use of IRIMappers, too.  E.g.,

https://github.com/owlcs/owlapi/blob/master/contract/src/test/java/org/coode/owlapi/examples/Examples.java#L162

uses and IRImapper, and

https://github.com/owlcs/owlapi/blob/master/contract/src/test/java/org/coode/owlapi/examples/Examples.java#L1563

uses an AutoIRIMapper, and even mentions Protege.



--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Protege, OWL API and Imports

Timothy Redmond
In reply to this post by Thomas D.
On 03/17/2014 09:59 AM, Thomas D wrote:
> Hi all,
>
> My apologies if this might not entirely fit in the Protege user ML.

Close enough.  The OWL api mailing list or the Protege dev mailing list
would be better.

>
> I have created an ontology in Protege which imports another one. Both
> are stored locally on my computer.
> I also started to use some Java code and the OWL API to work with
> these ontologies. I'm able to load and go through the basic ontology
> (without import) just fine but I can't load the one with an import and
> get a File Missing Exception.
> I've looked on the web and find that the AutoIRIMapper should solve
> this problem but it actually returns me an empty ontology. That is, if
> ontology A imports ontology B, using the Mapper I'm able to see the
> concepts of A but not of B (but Java doesn't throw any Exception).

The auto IRI mapper (being auto :-)) does not always find the import -
it depends on the file format of the import and such like.  But, if you
don't mind doing it manually, the SimpleIRIMapper would work fine.  Also
there is an IRI mapper in the XML Catalog library,

      https://github.com/protegeproject/xmlcatalog
      http://search.maven.org/#artifactdetails|edu.stanford.protege|org.protege.xmlcatalog|1.0.4|bundle


that understands xmlcatalogs (and therefore can use the Protege mappings).

-Timothy

>
> Do you have any idea on how to solve this problem?
>
> Thanks in advance.
> Regards,
> Thomas D.
>
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user