From de2f70de613d571b80c759d04ff6ce11ab5f55bf Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Thu, 17 Dec 2020 17:01:40 +0200 Subject: [PATCH] Allow copying enumerated properties. gitlab #25 Change-Id: I7b662d2146211f25205177bcc3c067c1e98d4c91 --- .../simantics/interop/update/model/AddDeleteUpdateOp.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/AddDeleteUpdateOp.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/AddDeleteUpdateOp.java index 3f4b6bf..a505864 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/AddDeleteUpdateOp.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/AddDeleteUpdateOp.java @@ -87,7 +87,13 @@ public abstract class AddDeleteUpdateOp extends UpdateOp { g.claim(destination, s.getPredicate(), valueResource); copyProperties(g, s.getObject(), valueResource); } else { - throw new DatabaseException("Expected to copy property resource " + s.getObject()); + Resource type = g.getPossibleType(s.getObject(), l0.Value); + if (type != null && g.hasStatement(type, l0.Enumeration, type)) { + g.deny(destination, s.getPredicate()); + g.claim(destination, s.getPredicate(), s.getObject()); + } else { + throw new DatabaseException("Expected to copy property resource " + s.getObject()); + } } } } -- 2.45.1