return;
}
+ Layer0 L0 = Layer0.getInstance(graph);
Layer0X L0X = Layer0X.getInstance(graph);
boolean hasRequiresDataType = graph.hasStatement(relation, L0X.RequiresDataType);
if (hasRequiresDataType) {
Datatype dt = graph.getDataType(object);
if (dt instanceof NumberType) {
- Layer0 L0 = Layer0.getInstance(graph);
NumberType nt = (NumberType) Bindings.DATATYPE.cloneUnchecked(dt);
nt.setUnit(unit);
graph.claimLiteral(object, L0.HasDataType, L0.DataType, nt, Bindings.DATATYPE);
}
String oldUnit = graph.getPossibleRelatedValue2(relation, L0X.HasUnit, Bindings.STRING);
- graph.claimLiteral(relation, L0X.HasUnit, unit, Bindings.STRING);
+ if (unit != null) {
+ graph.claimLiteral(relation, L0X.HasUnit, L0.String, unit, Bindings.STRING);
+ } else {
+ graph.denyValue(relation, L0X.HasUnit);
+ }
CommentMetadata cm = graph.getMetadata(CommentMetadata.class);
graph.addMetadata(cm.add("Set unit from " + oldUnit + " to " + unit + " for component/annotation " + type + " property " + relation));