Problem with Manchester parser

11 views
Skip to first unread message

Mikael

unread,
Mar 5, 2020, 10:23:55 AM3/5/20
to HermiT Users
Hi,

following entailment ontology gives parsing error against the pizza ontology:

Prefix: : <http://example.org/margherita.owl#>
Ontology: <http://example.org/margherita.owl>
Class: Margherita
     SubClassOf:
         hasTopping some MozzarellaTopping


Error:

Parser: ManchesterOWLSyntaxOntologyParser
Encountered hasTopping at line 5 column 8. Expected one of:
         Class name
         Object property name
         Data property name
         inverse
         not
         (
         {
  (Line 5)



This works:

Prefix: : <http://www.co-ode.org/ontologies/pizza/pizza.owl#>
Ontology: <http://www.co-ode.org/ontologies/pizza/pizza.owl>

ObjectProperty: hasTopping
Class: MozzarellaTopping
Class: Margherita
     SubClassOf:
         hasTopping some MozzarellaTopping

Is this by the specs or should the first version work too?

Ignazio Palmisano

unread,
Mar 5, 2020, 11:18:04 AM3/5/20
to Mikael, HermiT Users
Entities must be declared, it's in the specs. Not an HermiT issue, the parser is in OWLAPI.

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/b0db3af9-6b71-42c9-87e4-030de39ba4bd%40googlegroups.com.

Mikael Pesonen

unread,
Mar 6, 2020, 2:51:53 AM3/6/20
to Ignazio Palmisano, Mikael, HermiT Users


Do you mean Manchester syntax spec or something else?

Thanks!

Mikael

Ignazio Palmisano

unread,
Mar 6, 2020, 3:08:00 AM3/6/20
to Mikael Pesonen, Mikael, HermiT Users
Hi,
It's part of the OWL specifications. All named entities, except named individuals, must have a declaration in the ontology or in its imports closure.

Cheers,
Ignazio

Mikael Pesonen

unread,
Mar 6, 2020, 3:21:08 AM3/6/20
to Ignazio Palmisano, Mikael, HermiT Users


Makes sense. Thanks Ignazio!

William Van Woensel

unread,
Mar 6, 2020, 8:26:53 AM3/6/20
to HermiT Users
Hi Ignazio, Mikael,

Thanks for these posts. Part of this discussion was carried on the semantic-web mailing list and I'm still a bit confused since (a) a Manchester OWL syntax exception is being thrown, as opposed to an inconsistency (due to typing constraints?), and (b) the following Turtle snippet does not throw an exception:

@prefix : <http://www.co-ode.org/ontologies/pizza/pizza.owl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

:Margherita rdf:type owl:Class ;
                rdfs:subClassOf [ rdf:type owl:Restriction ;
                                  owl:onProperty :hasTopping ;
                                  owl:someValuesFrom :MozzarellaTopping
                ] .

Indeed, the reasoner infers that "hasTopping" is an object property (and MozzarellaTopping is a class).


William

On Friday, 6 March 2020 04:21:08 UTC-4, Mikael wrote:


Makes sense. Thanks Ignazio!

On 6.3.2020 10.07, Ignazio Palmisano wrote:
Hi,
It's part of the OWL specifications. All named entities, except named individuals, must have a declaration in the ontology or in its imports closure.

Cheers,
Ignazio

Ignazio

To unsubscribe from this group and stop receiving emails from it, send an email to hermit...@googlegroups.com.

Birte Glimm

unread,
Mar 6, 2020, 8:58:21 AM3/6/20
to William Van Woensel, HermiT Users
Dear William,

this is purely a parser thing. Some parsers, e.g., the Turtle parser
try to make a best effort guess as to what kind of property it is
(object, data or annotation property) or use a default if informed
guessing is not possible (annotation property for the Turtle parser).
Sometimes this can be guessed by the parser, e.g. in your example it
is clear since the filler of the someValuesFrom is a class, so
hasTopping must be an object property even though this was not given
as a declaration. The Manchester syntax parser is stricter...

HermiT takes whatever the parsers in the OWL API produce. If the
parser produces already an error, HermiT cannot do a consistency
check.

Birte
> 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/92f7c2e6-531b-4e9a-804f-80adf7d64c72%40googlegroups.com.



--
Prof. Dr. Birte Glimm Tel.: +49 731 50 24125
Inst. of Artificial Intelligence Secr: +49 731 50 24258
University of Ulm Fax: +49 731 50 24188
D-89069 Ulm birte...@uni-ulm.de
Germany

Ignazio Palmisano

unread,
Mar 6, 2020, 9:25:56 AM3/6/20
to William Van Woensel, HermiT Users
Wouldn't be an inconsistency - by the time the reasoner sees the axioms, the entity has received a type.

Parsers might decide to be nonconformant - e.g., RDF parsers in OWLAPI often do not throw exceptions in these scenarios (they should, to be 100% conformant) and try to guess the correct type from other information (mostly to allow common ontologies with mistakes to be used or loaded into tools for corrections). However, the amount of information available differs depending on the language.

In your example, MozzarellaTopping is guessed to be a class and as a consequence the property must be an object property - but, had you meant to use your own data type in that scenario, you'd have gotten unexpected results.

Guessing declarations is a shaky enterprise. Whenever possible, it's best to have declarations in place.

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/92f7c2e6-531b-4e9a-804f-80adf7d64c72%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages