It is common when dealing with groups of Agents to want to create a URI to denote those agents. This simple spec gives a way to systematically create a group uri given the URIs of the participants.

This document in an informal draft discussed in the W3C Read Write Web Community Group.

Introduction

It is common when dealing with groups of Agents to want to create a URI to denote those agents. Yet there is no systematic way to create a URI from a set of its participants. This simple spec solves the problem by creating a [[!VCARD]] Group with members the URIs, canonicalizing it, taking the hash, and then creating a URI from that hash.

Read Write Web Community Group

Groupuris is one of several related specifications being discussed by the W3C Read Write Web Community Group.

Overview

First we will create a [[!VCARD]] group from the participants. Then we will canonicalize it, then we will take a hash, to create a URI.

Vocabulary

The ontology / vocabulary used is the [[!VCARD]] vocabulary.

Creating a Group

Groups are simply a [[!VCARD]] Group with members that are the URIs in that Group. Initially a bnode is used as a temporary identifier.

Example

            [] a vcard:Group ;
            vcard:hasMember <http://example.org/alice#me> ;
            vcard:hasMember <http://example.org/bob#me> .
          

Canonicalization

It is useful to canonicalize the group before taking a hash so that the same participants independently hashed will yield the same URI.

The canonicalization follows typical RDF patterns and consists of creating ntriples, one per line, which are sorted alphabetically.

Example

_: <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2006/vcard/ns#Group> .
_: <http://www.w3.org/2006/vcard/ns#hasMember> <http://example.org/alice#me> .
_: <http://www.w3.org/2006/vcard/ns#hasMember> <http://example.org/bob#me> .
          

Hashing

For convenience is it often useful to hash the normalized RDF into a short hash. Suggested is sha256 for this to create an ni:/// hash as per [[!RFC6920]].

Example

            ni:///sha256;5meXUPQdxaERrrM10YKQYIsUrAm15VQ46sUHsdnYebI
          

Implementations

A reference implementation is available in npm and nodejs.

JavaScript

JavaScript

NPM

NPM