diff --git a/klab.services.reasoner/src/main/java/org/integratedmodelling/klab/services/reasoner/internal/ObservableBuilder.java b/klab.services.reasoner/src/main/java/org/integratedmodelling/klab/services/reasoner/internal/ObservableBuilder.java index 7780e92f3..a02c0fb90 100644 --- a/klab.services.reasoner/src/main/java/org/integratedmodelling/klab/services/reasoner/internal/ObservableBuilder.java +++ b/klab.services.reasoner/src/main/java/org/integratedmodelling/klab/services/reasoner/internal/ObservableBuilder.java @@ -83,6 +83,7 @@ public class ObservableBuilder implements Observable.Builder { // withDeclaration() and the // builder is merely building it. private boolean declarationIsComplete = false; + private String urn; // marks the observable to build as dereifying for a resolution of inherents TODO check if this is // still relevant @@ -178,7 +179,7 @@ public ObservableBuilder(ObservableBuilder other) { this.caused = other.caused; this.comparison = other.comparison; this.compresent = other.compresent; - // this.context = other.context; + this.urn = other.urn; this.inherent = other.inherent; this.cooccurrent = other.cooccurrent; this.goal = other.goal; @@ -208,6 +209,7 @@ public ObservableBuilder(ObservableBuilder other) { public ObservableBuilder withDeclaration(KimConcept declaration) { this.declaration = (KimConceptImpl) declaration; this.declarationIsComplete = true; + this.urn = declaration.getUrn(); return this; } @@ -797,6 +799,7 @@ public Concept buildConcept() throws KlabValidationException { // finalize the concept by recomputing its URN if (declaration instanceof KimConceptImpl impl) { impl.finalizeDefinition(); + this.urn = impl.getUrn(); } // if (scope.hasErrors()) { @@ -1448,6 +1451,11 @@ public Observable build() throws KlabValidationException { ret.setDescriptionType(this.descriptionType); } + if (this.urn != null) { + // override the precomputed URN + ret.setUrn(this.urn); + } + return ret; }