I am running the sample owlapi examples at: https://github.com/owlcs/owlapi/tree/master/contract/src/test/java/org/coode/owlapi/example to retrieve subclasses for a class with odd character(s). My owl file contains classes with odd characters such as /, ( but the parser seems to truncate them before the odd character and eventually throws an error. I have peeked into the ManchesterOWLSyntaxTokenizer and looks like it considers these odd characters as delimiters. Anyone else made this observation? What is the workaround? As an aside, I have tried the HermiT reasoner with similar results. Also, in Protege, if you try to add a new OWLClass name with odd character to a hierarchy, it adds single quotes around the classname. To retrieve its subclasses in 'DL Query' view, I must run it with the added single quotes around the class name. Is protege internally using a different syntax tokenizer that I can use instead of the ManchesterOWLSyntaxTokenizer that truncates class names?
Asked
Active
Viewed 489 times
1 Answers
0
The / character is a delimiter in the URI specs; see http://www.ietf.org/rfc/rfc3986.txt, http://www.ietf.org/rfc/rfc3987.txt and http://www.w3.org/2004/11/uri-iri-pressrelease.
There is no workaround for classes IRIs. If you wish to use such characters in the human readable version of your class names, you can use rdfs:label
annotations, whose text can contain any character, and use rdfs:label
when displaying the classes to users.
The single quotes Protege shows represent the fact that that's the value of an rdfs:label
annotation.

Ignazio
- 10,504
- 1
- 14
- 25
-
That sounds quite logical, except that when you save an owl file from Protege with classes containing these delimiters, the rdfs:label annotation does not appear. Such classes are saved in the same format as any other class, and without the single quotes. One of our clients is providing us with such files and we are trying to figure out the best way to extract these classes and subclasses, just the same way as you can query them in Protege with the single quotes. Thoughts? – Bass May 07 '14 at 17:06
-
I'd need to see the ontology coming from Protege to understand how that's possible. The problem is, IRIs can be created in a variety of ways, but once they are written out there is no way to tell whether a slash was intended in the 'name' or was part of the namespace. Allowing labels to be shown but not saving them would be a Protege bug. – Ignazio May 07 '14 at 17:56
-
Maybe. I will reach out to the team. But as a demonstration, if you have Protege installed, simply go to: File > New and create a new file, then click on 'Classes' tab, then click on the root class 'Thing' and then click on the highlighted icon right above 'Thing' to create a new subclass. Enter say: Animal(Thing) and save this new ontology. Check the contents of the saved file. Also, note how you can use 'DL Query' to query for related class information about this new class by enclosing in single quotes, but you cannot query with sample example in owlapi. Any workaround? – Bass May 07 '14 at 18:15