Sha256: 97a39885acace832ff2e293068696ed54bb3809e1c2d96360b707ae8c27281c7
Contents?: true
Size: 1.54 KB
Versions: 8
Compression:
Stored size: 1.54 KB
Contents
module SPARQL; module Algebra class Operator ## # The SPARQL relational `<=` (less than or equal) comparison operator. # # [114] RelationalExpression ::= NumericExpression ('<=' NumericExpression)? # # @example SPARQL Grammar # PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> # PREFIX : <http://example.org/things#> # SELECT ?x # WHERE { ?x :p ?v . FILTER ( ?v <= 1 ) } # # @example SSE # (prefix # ((xsd: <http://www.w3.org/2001/XMLSchema#>) (: <http://example.org/things#>)) # (project (?x) (filter (<= ?v 1) (bgp (triple ?x :p ?v))))) # # @see https://www.w3.org/TR/sparql11-query/#OperatorMapping # @see https://www.w3.org/TR/xpath-functions/#func-compare # @see https://www.w3.org/TR/xpath-functions/#func-numeric-less-than # @see https://www.w3.org/TR/xpath-functions/#func-boolean-less-than # @see https://www.w3.org/TR/xpath-functions/#func-dateTime-less-than class LessThanOrEqual < Compare NAME = :<= ## # Returns `true` if the first operand is less than or equal to the # second operand; returns `false` otherwise. # # @param [RDF::Literal] left # a literal # @param [RDF::Literal] right # a literal # @return [RDF::Literal::Boolean] `true` or `false` # @raise [TypeError] if either operand is not a literal def apply(left, right, **options) RDF::Literal(super <= RDF::Literal(0)) end end # LessThanOrEqual end # Operator end; end # SPARQL::Algebra
Version data entries
8 entries across 8 versions & 1 rubygems