From 28413fd27e56ea8b5018ce5a11b1fd132d5425d7 Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Wed, 16 Dec 2020 13:36:14 +0200 Subject: [PATCH] Use known literal type when applying value changes gitlab #29 Change-Id: Ica832ca495f46286b83e34c372731c8a1d6d2864 --- .../simantics/interop/update/model/PropertyChange.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java index be6e5e0..d1a64af 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java @@ -103,18 +103,24 @@ public class PropertyChange { Resource s = leftSubject; if (graph.isInstanceOf(pair.second.getObject(), L0.Literal)) { Object value = null; + Resource type = null; if (customValue != null) value = customValue; else if (graph.hasValue(pair.second.getObject())) { value = graph.getValue(pair.second.getObject()); } + type = graph.getPossibleType(pair.second.getObject(), L0.Literal); Resource pred = pair.second.getPredicate(); if (getChanges().getComparable().containsRight(pred)) pred = getChanges().getComparable().getLeft(pred); if (value != null) { graph.deny(s, pred); - graph.claimLiteral(s, pred, value); + if (type != null) { + graph.claimLiteral(s, pred, type, value); + } else { + graph.claimLiteral(s, pred, value); + } } else { graph.deny(s,pred); } -- 2.47.1