owlcs / owlapi

OWL API main repository
821 stars 315 forks source link

IRI remainder not properly retrieved if starting by a digit #1049

Closed neobernad closed 2 years ago

neobernad commented 2 years ago

Hello all,

We are having IRIs whose reminder start by a digit, e.g. https://ontology.toto.com/Toto/MyTotoOntology/1totoTerm. If we run the following code we get the namespace wrong:

IRI testIri = IRI.create("https://ontology.toto.com/Toto/MyTotoOntology/1totoTerm");
System.out.println("\t" + testIri.getNamespace()+ " - " + testIri.getRemainder());

It outputs this namespace and reminder:

"https://ontology.toto.com/Toto/MyTotoOntology/1" - "totoTerm"

Is this due the QNAMEs cannot start by a digit? Or what would be the reason of this?

PS: I know this issue has been addressed some years ago, but it seems it is still an issue and I do not know the current status of this.

For this test we used the following owlapi version:

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-api</artifactId>
    <version>5.1.13</version>
</dependency>
<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-apibinding</artifactId>
    <version>5.1.13</version>
</dependency>
ignazio1977 commented 2 years ago

Yes, the split point is decided according to QName rules.

neobernad commented 2 years ago

Hi @ignazio1977 , thanks for the confirmation! :-)