Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

Configuration



The SparqlHelperConfig class contains the configuration of the library.

Library release version

The SparqlHelperConfig.getVersion() method return the version of the library.

The SparqlHelperConfig.getDate() method return the date of the release of the library.

The SparqlHelperConfig.printRelease() method print the release of the library.

For example:
   SparqlHelperConfig.printRelease();
will print on System.out:
      SparlHelper version: 0.3 release: 11/03/2026

Default prefix declarations

Main Article: Prefix declarations

The SparqlHelperConfig.setDefaultPrefixDeclarations(SparqlPrefixDeclarations decl) method allows to set the default prefix declarations for all subsequent SPARQLRequest creation.

The SparqlHelperConfig.resetDefaultPrefixDeclarations() resets the default prefix declarations.

Of course, if you explictly specify the prefix declarations when you create your SPARQLRequest (such as for example with SPARQLRequest(String prefix, SparqlPrefixDeclarations decl)), the default prefix declarations will not be used.

Usage

For example with the following code:
   SparqlPrefixDeclarations prefixDecl = new SparqlPrefixDeclarations();      
   prefixDecl.addPrefix("sitac", "http://example.com/");    
   prefixDecl.addGeoSparqlPrefix();
   prefixDecl.addOwlTimePrefix();      
   SparqlHelperConfig.getInstance().setDefaultPrefixDeclarations(prefixDecl);  
      
   SparqlRequest request = new SparqlRequest("sitac");
   request.addSelect("zone");
   request.addType("zone", "TaskZone");
   request.addPropertyValue("zone", "isTasked", true);
   String sparql = request.getSPARQL();
The result will be:
   PREFIX owl: <http://www.w3.org/2002/07/owl#>
   PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   PREFIX geo: <http://www.opengis.net/ont/geosparql#>
   PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
   PREFIX sitac: <http://example.com/>
   PREFIX time: <http://www.w3.org/2006/time#>
   PREFIX unit: <http://qudt.org/vocab/unit#>
   PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/#>
   SELECT ?zone
   WHERE {
     ?zone rdf:type sitac:TaskZone .
     ?zone sitac:isTasked "true" .
   }      

See also


Categories: General

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