\r
String finalRvi = currentRVI + "/" + graph.getPossibleRelatedValue(component, l0.HasName, StringBindingDefault.INSTANCE);\r
\r
- Variable rootVariable = graph.adapt(model, Variable.class);\r
- Variable var = rootVariable.browsePossible(graph, finalRvi);\r
+ // This is ugly but it has to be done like this because WorkModel example has too PartOfs\r
+ Resource rootLibrary = graph.getPossibleObject(model, l0.PartOf);\r
+ while(!graph.getObjects(rootLibrary, l0.PartOf).isEmpty()) {\r
+ for(Resource possibleLibrary : graph.getObjects(rootLibrary, l0.PartOf)){\r
+ if(graph.isInstanceOf(possibleLibrary, l0.Library)) {\r
+ rootLibrary = possibleLibrary;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ Variable rootVariable = graph.adapt(rootLibrary, Variable.class);\r
+ \r
+ String moduleUri = modelURI + "/BaseRealization" + finalRvi;\r
+ Variable var = rootVariable.browsePossible(graph, moduleUri.substring(6));\r
if(var == null) {\r
finalRvi = "";\r
}\r