Sha256: 7d1c2b8bd89f72d140956f35b4e1ba6ba7b6358d44030c392010c335b72c23f5
Contents?: true
Size: 1.03 KB
Versions: 28
Compression:
Stored size: 1.03 KB
Contents
require 'securerandom' module SPARQL; module Algebra class Operator ## # 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 http://www.w3.org/TR/sparql11-query/#func-struuid class StrUUID < Operator::Nullary include Evaluatable NAME = :struuid ## # 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] def apply RDF::Literal(SecureRandom.uuid) end end # StrUUID end # Operator end; end # SPARQL::Algebra
Version data entries
28 entries across 28 versions & 1 rubygems