}
@Override
- public Collection<?> getChildren(ReadGraph graph, Object parent) throws DatabaseException {
+ public Collection<Resource> getChildren(ReadGraph graph, Object parent) throws DatabaseException {
+ Resource parentResource;
+
+ if (parent instanceof Variable) {
+ parentResource = ((Variable)parent).getRepresents(graph);
+ } else {
+ parentResource = (Resource)parent;
+ }
ModelingResources MOD = ModelingResources.getInstance(graph);
Variable ruleVariable = Variables.getVariable(graph, rule);
- Function1<Object,List<?>> getChildren = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLChildRule_getChildren);
+ Function1<Object,List<Resource>> getChildren = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLChildRule_getChildren);
if(getChildren == null) return Collections.emptyList();
SCLContext sclContext = SCLContext.getCurrent();
Object oldGraph = sclContext.get("graph");
try {
sclContext.put("graph", graph);
- Object value = getChildren.apply(parent);
- return (Collection<?>)value;
+ return getChildren.apply(parentResource);
} catch (Throwable t) {
throw new DatabaseException(t);
} finally {