protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
969 stars 229 forks source link

Term completes then isn't accepted in class expression box #1217

Closed alanruttenberg closed 2 weeks ago

alanruttenberg commented 3 weeks ago

I have a term "Earth's Moon". When completing it completes as 'Earth\'s Moon', which it then red-underlines and won't accept.

ykazakov commented 3 weeks ago

I cannot reproduce that. What kind of term? A class? Is that the name of the class or the name of the rdfs:label? With the label both with or without double quotes, autocompletion produces an escaped string, which is accepted.

Screenshot 2024-06-10 at 18 45 20 Screenshot 2024-06-10 at 18 46 30
alanruttenberg commented 3 weeks ago

"Earth's Moon" is an instance. Try it in a value restriction. c value 'Earth<complete> Also it looks like the double quote are part of the label in your example?

ykazakov commented 3 weeks ago

Also it looks like the double quote are part of the label in your example?

I did not know whether they should be, so I tried both ways.

"Earth's Moon" is an instance. Try it in a value restriction. c value 'Earth

OK, with individual I could reproduce the problem!

Screenshot 2024-06-11 at 12 22 27
ykazakov commented 3 weeks ago

I think the problem is in OWLEntityFinderImpl: for OWLClasses the escape characters are preprocessed, whereas for all other entities they are not: https://github.com/protegeproject/protege/blob/3e9879b70c302f956acd419c413474b6fc6c204e/protege-editor-owl/src/main/java/org/protege/editor/owl/model/find/OWLEntityFinderImpl.java#L60

https://github.com/protegeproject/protege/blob/3e9879b70c302f956acd419c413474b6fc6c204e/protege-editor-owl/src/main/java/org/protege/editor/owl/model/find/OWLEntityFinderImpl.java#L100

The fix should be easy.