Resource model = DiagramUtils.getModel(graph, res);
Resource configuration = DiagramUtils.getConfiguration(graph, model);
Set<String> names = new HashSet<String>();
+ if (configuration == null)
+ return names;
Collection<Resource> composites = getAllComposites(graph, configuration);
for (Resource composite : composites) {
names.addAll(getAllModuleNamesForComposite(graph, composite));
* @throws ManyObjectsForFunctionalRelationException
* @throws ServiceException
*/
- private static Resource getDiagramFromComposite(ReadGraph g, Resource compositeType) throws DatabaseException {
+ public Resource getDiagramFromComposite(ReadGraph g, Resource compositeType) throws DatabaseException {
ModelingResources m = ModelingResources.getInstance(g);
Collection<Resource> diagramTemplates = g.getAssertedObjects(compositeType, m.HasModelingTemplate);
for (Resource diagramTemplate : diagramTemplates) {
while (r != null) {
if (graph.isInstanceOf(r, sim.Model))
return r;
+ if (graph.isInstanceOf(r, l0.SharedOntology))
+ return r;
r = graph.getPossibleObject(r, l0.PartOf);
}
return r;
public static Resource getConfiguration(ReadGraph graph, Resource model) throws DatabaseException {
SimulationResource sim = SimulationResource.getInstance(graph);
- return graph.getSingleObject(model, sim.HasConfiguration);
+ return graph.getPossibleObject(model, sim.HasConfiguration);
}
}