- public JSONObject perform(ReadGraph graph) throws DatabaseException {
-
- long s = System.nanoTime();
-
- JSONObject staticContent = graph.syncRequest(new NodeRequestStatic(variable));
- Map<String,Object> dynamicContent = graph.syncRequest(new NodeRequestDynamic(variable));
-
- if(dynamicContent.isEmpty()) {
- return staticContent;
- }
-
- JSONObject result = staticContent.clone();
- result.add(dynamicContent);
-
- if(dynamicContent.containsKey(ERRORS) || staticContent.getJSONField(ERRORS) != null) {
- ArrayList<String> errorList = new ArrayList<String>();
-
- if(dynamicContent.containsKey(ERRORS))
- errorList.addAll((List<String>)dynamicContent.get(ERRORS));
-
- if(staticContent.getJSONField(ERRORS) != null)
- errorList.addAll((List<String>)staticContent.getJSONField(ERRORS));
-
- result.addJSONField(ERRORS, errorList);
- }
-
- if(DocumentRequest.PROFILE) {
- long dura = System.nanoTime()-s;
- System.err.println("NodeRequest " + System.identityHashCode(this) + " " + variable.getURI(graph) + " in " + 1e-6*dura + "ms." + result);
- }
-
- return result;
-
- }
+ public JSONObject perform(ReadGraph graph) throws DatabaseException {
+
+ long s = System.nanoTime();
+
+ JSONObject staticContent = graph.syncRequest(new AttributesRequest(variable));
+
+ if(DocumentRequest.PROFILE) {
+ long dura = System.nanoTime()-s;
+ if(dura > DocumentRequest.PROFILE_THRESHOLD_NODEREQUEST * 1e3) {
+ System.err.println("NodeRequest " + System.identityHashCode(this) + " in " + 1e-6*dura + "ms. " + variable.getURI(graph));
+ }
+ }
+
+ return staticContent;
+
+ }