Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process escape characters when searching for entities, fix #1217 #1218

Merged
merged 6 commits into from
Jun 18, 2024

Conversation

ykazakov
Copy link
Contributor

Previously this was done only when searching for OWLClasses

…ject#1217

Previously this was done only when searching for OWLClasses
When adding OWLEquivalentClasses(:A :B) for which A and B already
appear in the asserted class hierarchy, there was no change
in the model of the tree component because no child or parent
nodes were added or removed. Consequently, the tree component did not
refresh, and the new labels A = B and B = A of the nodes A and B were
truncated.

This commit make sure that the model gets notified about the changes
of the node.

See protegeproject#910 (comment)
@ykazakov
Copy link
Contributor Author

I added a few more commits to fix #910

so that the result is parsed by Manchester OWL syntax parser

Specifically:

- Escape double quotes
- Escape backslashes
- Enclose in single quotes if the original string contains backslash

These changes are to mirror ManchesterOWLSyntaxTokenizer

Examples of rdfs:label of classes, tested to parse in
Class expression editor:

- [Foo'Bar] becomes [Foo\'Bar]
- [Foo"Bar] becomes [Foo\"Bar]
- [Foo\Bar] becomes ['Foo\\Bar']
- [Foo\'Bar] becomes ['Foo\\\'Bar']
- [Foo\\Bar] becomes ['Foo\\\\Bar']

Improve test cases to include escaping roundtrip
because stripAndEscapeRendering() should already return a canonical
(unique) rendering representation, e.g., ['foo\'bar'] => [foo\'bar]
@ykazakov
Copy link
Contributor Author

Added a few more commits to improve escaping of strings and simplify the owl entity finder.

Each element of equivalent entities, e.g., resulted from
OWLEquivalentClasses(:A :B) is rendered in the asserted hierarchy as
the list of rendering of all equivalent classes, e.g.:

> A = B
> B = A

When rendering of one of the entities has changed, e.g., due to
editing of rdfs:label, other equivalent entities did not get
automatically updated in the model.
In particular, their rendering in the hierarchy could get
truncated if the label becomes longer.

See: protegeproject#910 (comment)

This commit notifies the tree model about the changes of every
node for equivalent entities.

Also, use nodeChanged() instead of nodeStructureChanged() because
rendering does not change children or parents of nodes.
@ykazakov
Copy link
Contributor Author

Added another fix related to #910

@gouttegd gouttegd merged commit 3487c11 into protegeproject:master Jun 18, 2024
3 checks passed
@gouttegd
Copy link
Collaborator

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants