owlcs / owlapi

OWL API main repository
831 stars 315 forks source link

Default prefix manager & IRI can generate invalid short names if IRI is a prefix #213

Closed sesuncedu closed 10 years ago

sesuncedu commented 10 years ago

If an IRI exactly matches a prefix namespace the default prefix manager will generate an an abbreviated IRI of the firm 'foo:', which is invalid (the local name part must be non empty).

I will generate a short test case and pull request in a bit (found this issue when benchmarking the faster FSS tokenizer on converted opencyc owl (I haven't messed with the renderer, and the original is rdf/xml )

sesuncedu commented 10 years ago

Also, spot the slight mistake here: Luda, China

sesuncedu commented 10 years ago

Upon further review: it seems that SPARQL and Turtle both allow for abbreviated IRIs to match PNAME_NS - in SPARQL 1.1: (SPARQL classic has the same productions, with different numbering)

[67]    IRIref    ::=           IRI_REF  | PrefixedName
[68]    PrefixedName      ::=   PNAME_LN | PNAME_NS

So the fix may need to be confined to the FSS Renderer (unless there are other prefix formats that follow the OWL2 FSS grammar rather than turtle).

ignazio1977 commented 10 years ago

Giggle. I wonder how that got in there, and how did you spot it?