SparqlRequest request = new SparqlRequest("sitac"); boolean isValid = request.addSelect("myVar");The ISparqlRequestGroup.getVariables() method return all the variables which are part of the SELECT expression.
SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("myVar"); request.removeSelect("myVar");
SparqlRequest request = new SparqlRequest("sitac"); boolean isValid = request.addAdditionalVariable("myVar"); String varName = request.addAutoVariable("myOtherVar"); // varName is "myOtherVar" varName = request.addAutoVariable("myOtherVar"); // varName is "myOtherVar1" varName = request.addAutoVariable(); // varName is "auto_1" varName = request.addAutoVariable(); // varName is "auto_2"
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . ?zone sitac:isTasked "true" . }We will have:
Variable var = request.getVariable("zone"); Map<String, PrefixedName> types = var.fromTypes(); boolean contains = types.containsKey("sitac:TaskZone"); PrefixedName firstType = var.getFirstType(); // this is the prefixed name "sitac:TaskZone"
Copyright 2025 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence