On 25/01/14 11:07, Nagore Salaberria wrote:
And if I want to put in the FILTER two values​​, as would be the syntax ?

is this??

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
" PREFIX gr: <http://purl.org/goodrelations/v1#> " +
" PREFIX xsd: <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' && ?p >= '800')  " +
"}";


Thank you,

Nagore.

Yes, the syntax is right but I would guess, because you are asking, it does not do what you think it does.

> " FILTER (?p <= '300' && ?p >= '800')  " +

'300' is a string; it is not a numeric value of 300.

And also, the filter is never true!

FILTER (?p <= 300 && ?p >= '800')

How can ?p be less than or equal to 300 and also greater than or equal to 800? It can't whether it's a number or a string.

Did you mean one of:

FILTER (?p >= 300 && ?p <= 800)

i.e. ?p in the range 300 to 800

FILTER (?p <= 300 || ?p >= 800)

i.e ?p is less than or equal to 300 OR ?p is greater than or equal to 800

        Andy

Reply via email to