Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

QueryResultsUtilities


The QueryResultsUtilities class allows to parse the XML and create an associated data structure which can be processed.

The various methods of this class will return a QueryResults instance which will hold the results.

Example

Suppose the following query:
   SELECT ?number ?type
   WHERE { 
      ?alarm rdf:type inav:Alarm .
      ?alarm inav:AlarmNumber ?number .
      ?alarm inav:hasAlarmType ?type .
   }    
The following code will print the ?number and ?type of each result:
   public void subscribe(ServiceInstance service) {
      QueryResults results = (QueryResults) service.getData("response").getValue();
      Iterator<QueryResults.Result> it = results.getOrderedResultsList().iterator();
      while (it.hasNext()) {
       QueryResults.Result result = it.next();
        int number = result.getValue("number").getValueAsInt();
        String type = result.getValue("type").getValueAsString();
        System.out.println("Alarm " + number + ": " + type);
      }
   }

See also


Categories: Queryresults

Copyright 2025 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence