+ @SCLValue(type = "VariableMap")
+ public static VariableMap methodsPropertyDomainProperties = new VariableMapImpl() {
+
+ @Override
+ public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {
+ Variable parent = context.getParent(graph);
+ Resource container = parent.getPossibleRepresents(graph);
+ if(container == null)
+ return null;
+ Map<String,Resource> methods = graph.syncRequest(new UnescapedMethodMapOfResource(container));
+ Resource predicate = methods.get(name);
+ if(predicate != null) {
+ Layer0 L0 = Layer0.getInstance(graph);
+ PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(L0.Entity_method));
+ Resource value = graph.getSingleObject(container, predicate);
+ return new StandardGraphPropertyVariable(context, null, container, info, value);
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {
+ Variable parent = context.getParent(graph);
+ Resource container = parent.getPossibleRepresents(graph);
+ if(container == null)
+ return Collections.emptyMap();
+ Map<String,Resource> methods = graph.syncRequest(new UnescapedMethodMapOfResource(container));
+ for(Map.Entry<String, Resource> entry : methods.entrySet()) {
+ String name = entry.getKey();
+ Resource predicate = entry.getValue();
+ Layer0 L0 = Layer0.getInstance(graph);
+ PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(L0.Entity_method));
+ Resource value = graph.getSingleObject(container, predicate);
+ if(map == null) map = new HashMap<>();
+ map.put(name, new StandardGraphPropertyVariable(context, null, container, info, value));
+ }
+ return map;
+ }
+
+ };
+