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" } }
Individuals as here is valid:SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); Individual individual = new Individual(request, "TheZone"); Individual individual2 = new Individual(request, "TheZone2"); List<? extends Object> list = SparqlRequest.createValuesList(individual, individual2); request.addType("zone", "TaskZone"); request.addPropertyValues("zone", list);It will return the following SPARQL result:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . VALUES ?zone { <http://localhost#TheZone> <http://localhost#TheZone2> } }Or here using
IRIs:SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); IRI iri1 = new IRI("http://localhost#TheZone"); IRI iri2 = new IRI("http://localhost#TheZone2"); List<? extends Object> list = SparqlRequest.createValuesList(iri1, iri2); request.addType("zone", "TaskZone"); request.addPropertyValues("zone", list);It will return the same SPARQL result:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . VALUES ?zone { <http://localhost#TheZone> <http://localhost#TheZone2> } }
Set or a List of Strings (or a Boolean, or a Number)Set or a List of IndividualsSet or a List of IRIsSparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); request.addType("zone", "TaskZone"); request.addPropertyValues("zone", "Label", SparqlRequest.createValuesList("label1", "label2"));It will return the following SPARQL result:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . ?zone sitac:Label ?zone . VALUES ?zone { "label1" "label2" } }This is also valid:
SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); request.addType("zone", "TaskZone"); Set<String> set = new TreeSet<>(); set.add("label1"); set.add("label2"); request.addPropertyValues("zone", "Label", SparqlRequest.createValuesList(set));It will return the same SPARQL result:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . ?zone sitac:Label ?zone . VALUES ?zone { "label1" "label2" } }
Set or a List of Strings which will represent an IRISparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); request.addType("zone", "TaskZone"); request.addPropertyValues("zone", "Label", SparqlRequest.createIRIValuesList("http://localhost#TheZone", "http://localhost#TheZone2"));It will return the following SPARQL result:
SELECT ?zone WHERE { ?zone rdf:type sitac:TaskZone . VALUES ?zone { <http://localhost#TheZone> <http://localhost#TheZone2> } }
SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("zone"); request.addType("zone", "TaskZone"); request.addPropertyValues("zone", "Label", SparqlRequestHelper.createValuesList("label1", "label2"));
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