- Layer0 L0 = Layer0.getInstance(graph);
- Collection<Resource> objects = graph.getObjects(resource, L0.ConsistsOf);
- CollectionSupport cs = graph.getService(CollectionSupport.class);
- Map<String,Resource> result = cs.createObjectResourceMap(String.class, objects.size());
- for(Resource r : objects) {
- String name = graph.getPossibleRelatedValue(r, L0.HasName, Bindings.STRING);
- if(name != null) {
- Resource old = result.put(name, r);
- if (old != null)
- LOGGER.error("The database contains siblings with the same name " + name + " (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ", previous child=$" + old.getResourceId() + ").");
- } else {
- if(Development.DEVELOPMENT)
- LOGGER.error("The database contains a child with no unique name (resource=$" + resource.getResourceId() + ", child=$" + r.getResourceId() + ").");
- }
- }
- return result;
- }
-