Why won't the command line process the pizza.owl ontology?

70 views
Skip to first unread message

Kenny Cason

unread,
Jun 10, 2019, 3:27:14 PM6/10/19
to HermiT Users
I think I'm following the instructions correctly for processing an ontology file from the HermiT web page (but I could be wrong). Unfortunately, this results in an error. Below is an example, can you please explain what is wrong?

$ ll ../../pizza.owl
-rw-r--r-- 1 kcason 1049089 163301 May 16 13:51 ../../pizza.owl

$ java -jar HermiT.jar -c -v2 -P -ooutput.owl ../../pizza.owl
Processing ../../pizza.owl
1 actions
Exception in thread "main" java.lang.IllegalArgumentException: URI is not absolute
        at java.net.URI.toURL(Unknown Source)
        at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.canLoad(ParsableOWLOntologyFactory.java:157)
        at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:875)
        at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:800)
        at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:758)
        at org.semanticweb.HermiT.cli.CommandLine.main(Unknown Source)


I get the same error even if I copy the pizza.owl file into the same directory as HermiT.jar. :-(

Ignazio Palmisano

unread,
Jun 10, 2019, 3:46:24 PM6/10/19
to Kenny Cason, HermiT Users
From the error message, I'd guess that the file path needs to be an
URL, like file://../../pizza.owl

Cheers,
Ignazio
> --
> You received this message because you are subscribed to the Google Groups "HermiT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hermit-users...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/hermit-users/0cb775f4-7628-4b29-910c-22724e7b7d2b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kenny Cason

unread,
Jun 10, 2019, 4:09:21 PM6/10/19
to HermiT Users
That is a good call, but does not seem to work. Now that the file is being read it fails for a different reason. Any clues?

$ java -jar HermiT.jar -ooutput.owl file://pizza.owl
Exception in thread "main" java.lang.IllegalArgumentException: Expected authority at index 7: file://
        at java.net.URI.create(Unknown Source)
        at org.semanticweb.HermiT.cli.CommandLine.main(Unknown Source)
Caused by: java.net.URISyntaxException: Expected authority at index 7: file://
        at java.net.URI$Parser.fail(Unknown Source)
        at java.net.URI$Parser.failExpecting(Unknown Source)
        at java.net.URI$Parser.parseHierarchical(Unknown Source)
        at java.net.URI$Parser.parse(Unknown Source)
        at java.net.URI.<init>(Unknown Source)

According to the web site it SHOULD work with a file path or URI. I'm not convinced.
Having said that, this does work:
$  java -jar HermiT.jar -c -ooutput.owl https://protege.stanford.edu/ontologies/pizza/pizza.owl

That is nice but I need to process a file other than the pizza.owl ontology. It seems unwieldly to have to put the file on a web site just to read it in...


On Monday, June 10, 2019 at 2:46:24 PM UTC-5, Ignazio Palmisano wrote:
From the error message, I'd guess that the file path needs to be an
URL, like file://../../pizza.owl

Cheers,
Ignazio

On Mon, 10 Jun 2019 at 20:27, Kenny Cason <kenny...@gmail.com> wrote:
>
> I think I'm following the instructions correctly for processing an ontology file from the HermiT web page (but I could be wrong). Unfortunately, this results in an error. Below is an example, can you please explain what is wrong?
>
> $ ll ../../pizza.owl
> -rw-r--r-- 1 kcason 1049089 163301 May 16 13:51 ../../pizza.owl
>
> $ java -jar HermiT.jar -c -v2 -P -ooutput.owl ../../pizza.owl
> Processing ../../pizza.owl
> 1 actions
> Exception in thread "main" java.lang.IllegalArgumentException: URI is not absolute
>         at java.net.URI.toURL(Unknown Source)
>         at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.canLoad(ParsableOWLOntologyFactory.java:157)
>         at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:875)
>         at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:800)
>         at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:758)
>         at org.semanticweb.HermiT.cli.CommandLine.main(Unknown Source)
>
>
> I get the same error even if I copy the pizza.owl file into the same directory as HermiT.jar. :-(
>
> --
> You received this message because you are subscribed to the Google Groups "HermiT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hermit...@googlegroups.com.

Ignazio Palmisano

unread,
Jun 10, 2019, 4:46:54 PM6/10/19
to Kenny Cason, HermiT Users
Try a full file IRI, i.e., (depending on your machine)
file:///Users/yourusername/folder/pizza.owl

There should be no difference between a file IRI and an HTTP url for
the OWLAPI code that's parsing that source - problems would only
emerge if the IRI doesn't identify a file.

Cheers,
Ignazio
> To unsubscribe from this group and stop receiving emails from it, send an email to hermit-users...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/hermit-users/540bedd5-5ec8-4eda-851d-03da0852243c%40googlegroups.com.

Kenny Cason

unread,
Jun 10, 2019, 7:50:25 PM6/10/19
to HermiT Users
Ok, this worked:
$ java -jar HermiT.jar -ooutput.owl file:///Users/kcason/Desktop/apis/HermiT/pizza.owl

Sheesh! Stupid triple forward slashes.
Thanks for the help.

Reply all
Reply to author
Forward
0 new messages