We need more information than this to help you, please provide a minimal reproducible example
I.e. include a minimal sample of your data that reproduces your issue (preferably in a readable syntax like Turtle) and show the results you get and the results you expect Telling us that "it does not return the correct solution" is entirely useless if you don't tell us what you expect the correct solution to be or provide any data for us to test with. Regards, Rob On 21/01/2014 08:38, "Nagore Salaberria" <[email protected]> wrote: >Sorry , this is the code: > > > > > >*.....* >* PREFIX rdf: ><http://www.w3.org/1999/02/22-rdf-syntax-ns# ><http://www.w3.org/1999/02/22-rdf-syntax-ns#>> " +* >* " PREFIX gr: <http://purl.org/goodrelations/v1# ><http://purl.org/goodrelations/v1#>> " +* >* " PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ><http://www.w3.org/2001/XMLSchema#>> " +* >* " SELECT * WHERE {" +* >* " ?x a gr:Offering . " +* >* " ?x gr:name ?d . "+* >* " ?x gr:hasPriceSpecification ?ps ." +* >* " ?ps gr:hasCurrencyValue ?p . " +* >* " FILTER (?p >= '300^^xsd:float' ) " +* >* "}";* > >com.hp.hpl.jena.query.Query query = QueryFactory.create(querys); > QueryExecution qexec = QueryExecutionFactory.create(query, model); > try { > ResultSet results = qexec.execSelect(); > while ( results.hasNext() ) { > QuerySolution soln = results.nextSolution(); > Literal name = soln.getLiteral("d"); > System.out.println(name); > > } > } finally { > qexec.close(); > } >} >} > > Thank you, > >Nagore. > > > > >2014/1/21 Nagore Salaberria <[email protected]> > >> >> Good afternoon everyone, >> >> I am making a SPARQL query with filters and although syntactically >>correct >> me does not return the correct solution. I have an online store and >>want to >> extract the names of items to be priced higher than € 300. >> >> *PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# >> <http://www.w3.org/1999/02/22-rdf-syntax-ns#>> " +* >> * " PREFIX gr: <http://purl.org/goodrelations/v1# >> <http://purl.org/goodrelations/v1#>> " +* >> * " PREFIX xsd: <http://www.w3.org/2001/XMLSchema# >> <http://www.w3.org/2001/XMLSchema#>> " +* >> * " SELECT * WHERE {" +* >> * " ?x a gr:Offering . " +* >> * " ?x gr:hasPriceSpecification ?ps ." +* >> * " ?ps gr:hasCurrencyValue ?p . " +* >> * " FILTER (?p >= '300^^xsd:float' ) " +* >> * "}";* >> >> >> What is the error? >> >> Thank you, >> >> Nagore. >> -- >> Nagore Salaberria<[email protected]> >> > > > >-- >Nagore Salaberria<[email protected]>
