FILTER

Narrow results with boolean expressions.

0/2 done

Theory

FILTER drops bindings that fail a boolean test:

SELECT ?ninja ?age WHERE {
  ?ninja a :Ninja ; :age ?age .
  FILTER(?age >= 18)
}

The operators you'll reach for most often inside FILTER(...):

OperatorDoes
= / !=Equality / inequality on RDF terms
< <= > >=Numeric / date comparison
&& / ||Boolean AND / OR
regex(?s, "^foo")Regex match on a string
lang(?lit) = "en"Match a language tag on a literal
bound(?x)Did this variable get a binding? (esp. OPTIONAL)

Reading in progress · 0 of 2 activities done