Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

SPARQL query serialization



The ISPARQLRequest.getSPARQL() returns the constructed SPARQL request.

Returning the request without comments

The following method return the request without comments:

Returning the request with comments

The following methods return the request with comments:

Clearing the serialized result cache

By default the serialized result of the ISPARQLRequest.getSPARQL() or the ISPARQLRequest.getSPARQL(boolean includeComments) methods will be cached and only recomputed if the structure of the SPARQL request is changed.

However the SPARQLRequest.resetSPARQLResult() method will clear the cached result, which for example would allow to get consecutively the result with or without comments. For example:
   SparqlRequest request = new SparqlRequest("sitac");
   request.addSelect("elt");
   WhereForm form = request.getWhereForm();
   OperationResult<Property> property = request.addType("elt", "Aircraft");
   property.setComment("the comment of the type");
      
   String query = request.getSPARQL(); // serialize the SPARQL request without commments
      
   request.resetSPARQLContent(); // clear the cached result
   query = request.getSPARQL(true); // serialize the SPARQL request with commments      

See also


Categories: Requestcreation

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

Project Web Hosted by SourceForge.net Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved About - Legal - Help