Module: RDF::Term

Includes:
SPARQL::Algebra::Expression
Defined in:
lib/sparql/algebra/extensions.rb

Overview

Extensions for RDF::Term.

Constant Summary

Constants included from SPARQL::Algebra::Expression

SPARQL::Algebra::Expression::PATTERN_PARENTS

Instance Method Summary collapse

Methods included from SPARQL::Algebra::Expression

cast, #constant?, extension, extension?, extensions, for, #invalid?, new, #node?, open, #optimize!, parse, register_extension, #to_sxp_bin, #valid?, #validate!, #variable?

Instance Method Details

#aggregate?Boolean

Returns:

  • (Boolean)


260
# File 'lib/sparql/algebra/extensions.rb', line 260

def aggregate?; false; end

#evaluate(bindings, **options) ⇒ RDF::Term

Parameters:

  • bindings (RDF::Query::Solution)

    a query solution containing zero or more variable bindings

  • options (Hash{Symbol => Object})

    ({}) options passed from query

Returns:



256
257
258
# File 'lib/sparql/algebra/extensions.rb', line 256

def evaluate(bindings, **options)
  self
end

#ndvarsArray<RDF::Query::Variable>

Return the non-destinguished variables contained within this operator



265
266
267
# File 'lib/sparql/algebra/extensions.rb', line 265

def ndvars
  vars.reject(&:distinguished?)
end

#optimize(**options) ⇒ RDF::Term

A duplicate of this term.

Returns:

See Also:



281
282
283
284
285
# File 'lib/sparql/algebra/extensions.rb', line 281

def optimize(**options)
  optimized = self.deep_dup
  #optimized.lexical = nil if optimized.respond_to?(:lexical=)
  #optimized
end

#to_sparql(**options) ⇒ String

Returns a partial SPARQL grammar for this term.

Returns:

  • (String)


292
293
294
# File 'lib/sparql/algebra/extensions.rb', line 292

def to_sparql(**options)
  to_sxp(**options)
end

#varsArray<RDF::Query::Variable>

Return the variables contained within this operator



272
273
274
# File 'lib/sparql/algebra/extensions.rb', line 272

def vars
  variable? ? [self] : []
end