class SPARQL::Algebra::Operator::StrUUID

The SPARQL `uuid` function.

@example

(prefix ((: <http://example.org/>)
         (xsd: <http://www.w3.org/2001/XMLSchema#>))
  (project (?length)
    (extend ((?length (strlen ?uuid)))
      (filter (&& (isLiteral ?uuid) (regex ?uuid "^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$" "i"))
        (extend ((?uuid (struuid)))
          (bgp))))))

@see www.w3.org/TR/sparql11-query/#func-struuid

Constants

NAME

Public Instance Methods

apply(**options) click to toggle source

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:.

@return [RDF::URI]

# File lib/sparql/algebra/operator/struuid.rb, line 27
def apply(**options)
  RDF::Literal(SecureRandom.uuid)
end