} else {
return formattedOutput;
}
- //
- // Variant variant = value.value;
- // Datatype dt = variant.getBinding().type();
- // if (Datatypes.STRING.equals(dt)) {
- // String s = (String) variant.getValue(Bindings.STRING);
- // if (s.contains("\n")) {
- // return "\"\"\"" + s + "\"\"\"";
- // } else {
- // return "\"" + s + "\"";
- // }
- // } else if (Datatypes.BOOLEAN.equals(dt)) {
- // Boolean i = (Boolean) variant.getValue(Bindings.BOOLEAN);
- // return i ? "true" : "false";
- // } else if (Datatypes.INTEGER.equals(dt)) {
- // Integer i = (Integer) variant.getValue(Bindings.INTEGER);
- // return i.toString();
- // } else if (Datatypes.LONG.equals(dt)) {
- // Long i = (Long) variant.getValue(Bindings.LONG);
- // return i.toString();
- // } else if (Datatypes.DOUBLE.equals(dt)) {
- // Double d = (Double) variant.getValue();
- // return d.toString();
- // } else if (Datatypes.FLOAT.equals(dt)) {
- // Float f = (Float) variant.getValue();
- // return f.toString();
- // } else if (Datatypes.STRING_ARRAY.equals(dt)) {
- // return Arrays.toString((String []) variant.getValue());
- // } else if (Datatypes.BOOLEAN_ARRAY.equals(dt)) {
- // return Arrays.toString((boolean []) variant.getValue());
- // } else if (Datatypes.INTEGER_ARRAY.equals(dt)) {
- // return Arrays.toString((int []) variant.getValue());
- // } else if (Datatypes.LONG_ARRAY.equals(dt)) {
- // return Arrays.toString((long []) variant.getValue());
- // } else if (Datatypes.DOUBLE_ARRAY.equals(dt)) {
- // return Arrays.toString((double []) variant.getValue());
- // } else if (Datatypes.FLOAT_ARRAY.equals(dt)) {
- // return Arrays.toString((float []) variant.getValue());
- // } else if (Datatypes.BYTE_ARRAY.equals(dt)) {
- // return Arrays.toString((byte []) variant.getValue());
- //// } else if (dt instanceof ArrayType) {
- //// return Arrays.toString((Object []) variant.getValue());
- // } else {
- // byte[] data =
- // Bindings.getSerializerUnchecked(variant.getBinding()).serialize(variant.getValue());
- // m.reset();
- // m.update(data, 0, data.length);
- // return "\"" + new BigInteger(1, m.digest()).toString(16) + "\"";
- // }
-
}
- // void fixInstanceOf(TransferableGraph1 graph, ResourceInfo info) {
- // Identity id = getIdentity(graph, info.resource);
- // if(id == null) return;
- // if(id.definition instanceof Internal) {
- // Identity instanceOf = findExternal(graph,
- // "http://www.simantics.org/Layer0-1.1/InstanceOf");
- // Identity library = findExternal(graph,
- // "http://www.simantics.org/Layer0-1.1/Library");
- // info.statements.add(instanceOf.resource);
- // info.statements.add(library.resource);
- // }
- // }
-
public static String getExternalURI(TransferableGraph1 tg, External ext) {
String name = ext.name;
if (name.contains(" "))
"http://www.simantics.org/Modeling-1.2/DiagramConnectionToConnection");
for (ResourceInfo infoo : infos.valueCollection()) {
- Identity elemTo = TransferableGraphUtils.findExternal(graph,
- "http://www.simantics.org/Modeling-1.2/ElementToComponent");
+ Identity elemTo = TransferableGraphUtils.findExternal(graph, "http://www.simantics.org/Modeling-1.2/ElementToComponent");
if (elemTo != null) {
int elemToComponent = TransferableGraphUtils.getPossibleObject2(graph, infoo.resource, elemTo);
if (elemToComponent != TransferableGraphUtils.NOT_FOUND) {
Identity component = TransferableGraphUtils.getIdentity(graph, elemToComponent);
Identity internal = TransferableGraphUtils.getIdentity(graph, infoo.resource);
if (internal.definition instanceof Internal && component.definition instanceof Internal) {
- Internal iCOmponent = (Internal) component.definition;
- infoo.name = infoo.name.substring(0, infoo.name.lastIndexOf(".") + 1) + iCOmponent.name;
+ Internal iComponent = (Internal) component.definition;
+ infoo.name = infoo.name.substring(0, infoo.name.lastIndexOf(".") + 1) + iComponent.name;
}
}
}
connection, possibleInverse);
parentId = iPossibleInverse.parent;
} else {
- LOGGER.error("THIS UNSUPPORTED for " + infoo + " " + iPossibleInverse);
+ log("Unsupported inverse relation found for {} {}", infoo, iPossibleInverse);
}
} else if (possibleInverse.definition instanceof External) {
External ePossibleInverse = (External) possibleInverse.definition;
connection, possibleInverse);
parentId = ePossibleInverse.parent;
} else {
- // This is not an inverse
- // LOGGER.error("THIS UNSUPPORTED
- // TOO");
+ log("This external inverse is unsupported for {} {}", infoo, ePossibleInverse);
}
} else {
- LOGGER.error("UNSUPPORTED for " + infoo + " ");
+ log("This type of definition is not supported {}", infoo);
}
if (inverseRelation != TransferableGraphUtils.NOT_FOUND) {
// Ok found something
} else if (object.definition instanceof External) {
objectName = ((External) object.definition).name;
} else {
- LOGGER.error("UNSUPPORTED " + infoo);
+ log("This type of definition is not supported {}", infoo);
throw new Error("UNSUPPORTED " + infoo);
}
if (parent.definition instanceof Internal) {
} else if (parent.definition instanceof External) {
parentName = ((External) parent.definition).name;
} else {
- LOGGER.error("UNSUPPORTED " + infoo);
+ log("This type of definition is not supported {}", infoo);
throw new Error("UNSUPPORTED " + infoo);
}
String fullName = parentName + "_" + objectName;
nameParts.add(fullName);
} else {
- LOGGER.error("THIS IS ALSO UNSupported");
+ log("No inverse relation found for {}", infoo);
}
} else {
- LOGGER.error("HERE");
+ log("Did not find possible inverse relation for {}", infoo);
}
}
nameParts.sort((o1, o2) -> o1.compareTo(o2));