Skip to content

OMN Parser mistakes punned class for object property #548

@nemishas

Description

@nemishas

Hi

I'm facing an error trying to obtain the class expression from a string using ManchesterOWLSyntaxParser.parseClassExpression() when the string contains a class name which is also an object property name. My input is simply 'A or B', where B is a class and it also happens to be an object property. I get:

Exception in thread "main" org.semanticweb.owlapi.manchestersyntax.renderer.ParserException: Encountered |EOF| at line 1 column 13. Expected one of:
    min
    exactly
    max
    value
    Self
    only
    some

    at org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxParserImpl$ExceptionBuilder.build(ManchesterOWLSyntaxParserImpl.java:2441)
    at org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxParserImpl.parseObjectRestriction(ManchesterOWLSyntaxParserImpl.java:669)
    at org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxParserImpl.parseNonNaryClassExpression(ManchesterOWLSyntaxParserImpl.java:581)
...

Not sure how much punning is supported, but based on the specification I was expecting the API to understand from context whether I'm talking about the class or the object property. Apparently the code first checks whether the token is an object property name, then proceeds to create an object restriction. I guess even checking for class name first wouldn't be correct. What could be the solution to this?

Please shed some light on this.. Also, I haven't checked if other parsers share this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions