public static final String ERRORS = "Errors";
public static final String PROPERTY_VALUE_EXCEPTIONS = "_PropertyValueExceptions";
-
- public NodeRequest(Variable node) {
- super(node);
- }
- @SuppressWarnings("unchecked")
- @Override
- public JSONObject perform(ReadGraph graph) throws DatabaseException {
-
- long s = System.nanoTime();
-
- Pair<JSONObject, Collection<Variable>> attribs = graph.syncRequest(new AttributesRequest(variable));
-
- JSONObject staticContent = attribs.first;
- if(attribs.second.isEmpty()) {
-
- 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;
- }
-
- Map<String,Object> dynamicContent = graph.syncRequest(new NodeRequestDynamic(variable));
- if(dynamicContent.isEmpty()) {
- return staticContent;
- }
-
- JSONObject result = staticContent.clone();
- result.add(dynamicContent);
+ public NodeRequest(Variable node) {
+ super(node);
+ }
- if(dynamicContent.containsKey(ERRORS) || staticContent.getJSONField(ERRORS) != null) {
- ArrayList<String> errorList = new ArrayList<>();
+ @SuppressWarnings("unchecked")
+ @Override
+ public JSONObject perform(ReadGraph graph) throws DatabaseException {
- if(dynamicContent.containsKey(ERRORS))
- errorList.addAll((List<String>)dynamicContent.get(ERRORS));
+ long s = System.nanoTime();
- if(staticContent.getJSONField(ERRORS) != null)
- errorList.addAll((List<String>)staticContent.getJSONField(ERRORS));
+ JSONObject staticContent = graph.syncRequest(new AttributesRequest(variable));
- result.addJSONField(ERRORS, errorList);
- }
+ 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));
+ }
+ }
- 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 result;
+ return staticContent;
}