From a9fda7e4449f52e61350863e6302cce79202fa92 Mon Sep 17 00:00:00 2001 From: irinaschubert Date: Tue, 10 May 2022 13:59:37 +0200 Subject: [PATCH] Fix: Problem with updating cache after deleting comments (DEV-508) (#2060) * Fix problem with updating cache after deleting comments * add missing triple to WHERE clause --- .../org/knora/webapi/responders/v2/OntologyResponderV2.scala | 5 ++--- .../queries/sparql/v2/changeClassLabelsOrComments.scala.txt | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala b/webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala index b3380210c7..4823347d9c 100644 --- a/webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala +++ b/webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala @@ -3581,9 +3581,8 @@ class OntologyResponderV2(responderData: ResponderData) extends Responder(respon } // Update the ontology cache using the new class definition. - newReadClassInfo: ReadClassInfoV2 = ReadClassInfoV2( - entityInfoContent = loadedClassDef, - allBaseClasses = classToUpdate.allBaseClasses + newReadClassInfo: ReadClassInfoV2 = classToUpdate.copy( + entityInfoContent = classDefWithoutComment ) updatedOntologyMetadata: OntologyMetadataV2 = ontology.ontologyMetadata.copy( diff --git a/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeClassLabelsOrComments.scala.txt b/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeClassLabelsOrComments.scala.txt index 35e1c25a60..8204e988ae 100644 --- a/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeClassLabelsOrComments.scala.txt +++ b/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeClassLabelsOrComments.scala.txt @@ -60,6 +60,8 @@ WHERE { ?ontology rdf:type owl:Ontology ; knora-base:lastModificationDate "@lastModificationDate"^^xsd:dateTime . + ?class ?p ?o . + OPTIONAL { ?class <@predicateToUpdate> ?oldObj . }