Class: SPARQL::Algebra::Operator::StrUUID
- Includes:
- Evaluatable
- Defined in:
- lib/sparql/algebra/operator/struuid.rb
Overview
[121] BuiltInCall ::= ... | 'STRUUID' NIL
Constant Summary collapse
- NAME =
:struuid
Instance Method Summary collapse
-
#apply(**options) ⇒ RDF::URI
Return a string that is the scheme specific part of UUID.
-
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
Methods included from Evaluatable
#evaluate, #memoize, #replace_aggregate!, #replace_vars!
Instance Method Details
#apply(**options) ⇒ RDF::URI
Return a string that is the scheme specific part of UUID. That is, as a simple literal, the result of generating a UUID, converting to a simple literal and removing the initial urn:uuid:.
38 39 40 |
# File 'lib/sparql/algebra/operator/struuid.rb', line 38 def apply(**) RDF::Literal(SecureRandom.uuid) end |
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
47 48 49 |
# File 'lib/sparql/algebra/operator/struuid.rb', line 47 def to_sparql(**) "STRUUID(" + operands.to_sparql(delimiter: ', ', **) + ")" end |