true if the operation is valid[1]
SparqlRequest request = new SparqlRequest("people"); request.addSelect("person"); request.addPropertyValue("person", "hasFirstName", "Paul");Will return the following SPARQL content:
SELECT ?person WHERE { ?person people:hasFirstName "Paul" . }
SparqlPrefixDeclarations decl = new SparqlPrefixDeclarations(false); decl.addPrefix("sitac", "http://localhost/SITAC"); SparqlRequest request = new SparqlRequest("sitac", decl); request.addSelect("group0"); request.addPropertyIndividualRef("group0", "isClassifiedAs", "Own");Will have the following SPARQL result:
SELECT ?group0 WHERE { ?group0 sitac:isClassifiedAs ?auto_1 . VALUES ?auto_1 { <http://localhost/SITAC#Own> } }
SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); request.addType("zone", "TaskZone"); request.addAdditionalVariable("label"); request.addPropertyRef("zone", "Label", "label"); request.addPropertyValues("label", SparqlRequest.createValuesList("label1", "label2"));Will return the following SPARQL content:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . ?zone sitac:Label ?label . VALUES ?label {"label1" "label2" } }
boolean: the datatype IRI will be xsd:booleanint: the datatype IRI will be xsd:intSparqlRequest request = new SparqlRequest("sitac"); request.addSelect("elt"); request.addType("elt", "Waypoint"); request.addPropertyValue("elt", "inFlightPlan", true); String query = request.getSPARQL();We will generate the following query:
SELECT ?elt WHERE { ?elt rdf:type sitac:Waypoint . ?elt sitac:inFlightPlan "true"^^xsd:boolean . }But this code:
SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("elt"); request.addType("elt", "Waypoint"); request.addPropertyValue("elt", "inFlightPlan", "true"); String query = request.getSPARQL();We will generate the following query:
SELECT ?elt WHERE { ?elt rdf:type sitac:Waypoint . ?elt sitac:inFlightPlan "true" . }
Copyright 2025 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence
Project Web Hosted by
Copyright 1999-2010 -
Geeknet, Inc., All Rights Reserved
About
-
Legal
-
Help