+
+ private static class PrimitivePropertyStatementsProcedure implements AsyncProcedure<DirectStatements> {
+
+ public DirectStatements result;
+
+ @Override
+ public void execute(AsyncReadGraph graph, DirectStatements result) {
+ this.result = result;
+ }
+
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable throwable) {
+ }
+
+ }
+
+ @SCLValue(type = "VariableMap")
+ public static VariableMap primitiveProperties = new VariableMapImpl() {
+
+ @Override
+ public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {
+ return All.getStandardPropertyDomainPropertyVariableFromValue(graph, context, name);
+ }
+
+ @Override
+ public Map<String, Variable> getVariables(final ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {
+
+ Variable parent = context.getParent(graph);
+
+ DocumentationResource DOC = DocumentationResource.getInstance(graph);
+
+ if(parent instanceof StandardProceduralChildVariable) {
+
+ StandardProceduralChildVariable procedural = (StandardProceduralChildVariable)parent;
+ for(Variable property : procedural.getProperties(graph/*, DocumentationResource.URIs.Document_AttributeRelation*/)) {
+ if(property instanceof StandardAssertedGraphPropertyVariable) {
+ StandardAssertedGraphPropertyVariable ass = (StandardAssertedGraphPropertyVariable)property;
+ if("datadefinitions".equals(ass.property.name) || "commands".equals(ass.property.name)) {
+ Object value = property.getPossibleValue(graph);
+ if(value != null) map.put(ass.property.name, new ConstantPropertyVariable(parent, ass.property.name, value, null));
+ }
+ continue;
+ }
+ Resource predicate = property.getPossiblePredicateResource(graph);
+ if(predicate != null) {
+ PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(predicate));
+ if(info.hasClassification(DocumentationResource.URIs.Document_AttributeRelation)) {
+ Variable prop = parent.getProperty(graph, predicate);
+ Object value = prop.getValue(graph);
+ if(map == null) map = new HashMap<String,Variable>();
+ map.put(info.name, new ConstantPropertyVariable(parent, info.name, value, null));
+ }
+ }
+ }
+
+ } else {
+
+ DirectQuerySupport dqs = graph.getService(DirectQuerySupport.class);
+ PrimitivePropertyStatementsProcedure foo = new PrimitivePropertyStatementsProcedure();
+
+ dqs.forEachDirectPersistentStatement(graph, parent.getRepresents(graph), foo);