UUID String Function

This is a comment for the "SPARQL 1.1 Query Language" working draft
(05 January 2012) [1] and the "SPARQL 1.1 Update) working draft (05
January 2012) [2].

One useful feature I would like to see in SPARQL is a string function
that returns a 128 bit UUID (as defined by [3]).  This could be used
to construct IRIs [4] or string literals.  In particular, this would
assist greatly in minting new resources in a query for entities that
may not otherwise lend themselves to a good naming scheme.

Relational databases currently supply this functionality (see [5],
[6]).  I don't believe the implementation cost would be very high, as
libraries exist in many languages to generate UUIDs.  The particular
RFC 4122 UUID variant could be left up to the implementation.

-Stephen


[1] http://www.w3.org/TR/2012/WD-sparql11-query-20120105/
[2] http://www.w3.org/TR/2012/WD-sparql11-update-20120105/
[3] http://tools.ietf.org/html/rfc4122
[4] iri(concat("urn:uuid:", uuid())
[5] http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid
[6] http://www.postgresql.org/docs/8.4/static/uuid-ossp.html

Received on Monday, 6 February 2012 22:42:42 UTC