Skip to content

Commit

Permalink
fix: Do not fail when updating class with external ontologies (DEV-3879
Browse files Browse the repository at this point in the history
…) (#3321)
  • Loading branch information
seakayone authored Jul 15, 2024
1 parent 67959a3 commit 752a7fe
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,11 @@ final case class OntologyCacheLive(triplestore: TriplestoreService, cacheDataRef

val inheritableCardinalities: Map[SmartIri, KnoraCardinalityInfo] =
directSubClass.entityInfoContent.subClassOf.flatMap { baseClassIri =>
cacheData.ontologies(baseClassIri.getOntologyFromEntity).classes(baseClassIri).allCardinalities
}.toMap
for {
ontology <- cacheData.ontologies.get(baseClassIri.getOntologyFromEntity)
classInfo <- ontology.classes.get(baseClassIri)
} yield classInfo
}.flatMap(_.allCardinalities).toMap

// Override inherited cardinalities with directly defined cardinalities.
val newInheritedCardinalities: Map[SmartIri, KnoraCardinalityInfo] = OntologyHelpers.overrideCardinalities(
Expand Down

0 comments on commit 752a7fe

Please sign in to comment.