Skip to content

Commit

Permalink
Process escape characters when searching for entities, fix protegepro…
Browse files Browse the repository at this point in the history
…ject#1217

Previously this was done only when searching for OWLClasses
  • Loading branch information
ykazakov committed Jun 11, 2024
1 parent 3e9879b commit bb94311
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ private String stripAndEscapeRendering(String rendering) {
}

public OWLClass getOWLClass(String rendering) {
OWLClass cls = renderingCache.getOWLClass(stripAndEscapeRendering(rendering));
rendering = stripAndEscapeRendering(rendering);
OWLClass cls = renderingCache.getOWLClass(rendering);
if (cls == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)) {
cls = renderingCache.getOWLClass(RenderingEscapeUtils.getEscapedRendering(rendering));
}
Expand All @@ -70,6 +71,7 @@ public Set<OWLEntity> getOWLEntities(String rendering) {
}

public OWLObjectProperty getOWLObjectProperty(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLObjectProperty prop = renderingCache.getOWLObjectProperty(rendering);
if (prop == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
prop = renderingCache.getOWLObjectProperty(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand All @@ -79,6 +81,7 @@ public OWLObjectProperty getOWLObjectProperty(String rendering) {


public OWLDataProperty getOWLDataProperty(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLDataProperty prop = renderingCache.getOWLDataProperty(rendering);
if (prop == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
prop = renderingCache.getOWLDataProperty(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand All @@ -88,6 +91,7 @@ public OWLDataProperty getOWLDataProperty(String rendering) {


public OWLAnnotationProperty getOWLAnnotationProperty(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLAnnotationProperty prop = renderingCache.getOWLAnnotationProperty(rendering);
if (prop == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
prop = renderingCache.getOWLAnnotationProperty(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand All @@ -97,6 +101,7 @@ public OWLAnnotationProperty getOWLAnnotationProperty(String rendering) {


public OWLNamedIndividual getOWLIndividual(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLNamedIndividual individual = renderingCache.getOWLIndividual(rendering);
if (individual == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
individual = renderingCache.getOWLIndividual(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand All @@ -106,6 +111,7 @@ public OWLNamedIndividual getOWLIndividual(String rendering) {


public OWLDatatype getOWLDatatype(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLDatatype dataType = renderingCache.getOWLDatatype(rendering);
if (dataType == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
dataType = renderingCache.getOWLDatatype(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand All @@ -115,6 +121,7 @@ public OWLDatatype getOWLDatatype(String rendering) {


public OWLEntity getOWLEntity(String rendering) {
rendering = stripAndEscapeRendering(rendering);
OWLEntity entity = renderingCache.getOWLEntity(rendering);
if (entity == null && !rendering.startsWith(ESCAPE_CHAR) && !rendering.endsWith(ESCAPE_CHAR)){
entity = renderingCache.getOWLEntity(RenderingEscapeUtils.getEscapedRendering(rendering));
Expand Down

0 comments on commit bb94311

Please sign in to comment.