Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

SPARQL request parsing



The SPARQLParser class allows to parse SPARQL requests expressed as a String, and generate a SPARQLRequest.

To create a SPARQLRequest from a String:
parsequery

Parser creation options

Main Article: Prefix declarations

There are several options to create the parser:

Example

Suppose the following SPARQL request as a String:
   SELECT ?zone
   WHERE {
     ?zone rdf:type sitac:TaskZone .
     ?zone sitac:isTasked "true" .
   }
To parse this request, we can do:
   SPARQLParser parser = new SPARQLParser("sitac");
   SparqlRequest request = parser.parseQuery(<the request String>);

Notes

  1. ^ The SPARQLParser.parseQuery(URL, String) method allows to specify the charset to use when parsig the URL, the SPARQLParser.parseQuery(URL) method assume an UTF-8 encoded content

See also


Categories: Requestcreation

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