| 1 | [[TOC]] |
| 2 | = UUID conventions = |
| 3 | |
| 4 | == General == |
| 5 | |
| 6 | UUIDs (Universal Unique IDentifiers) in Eden follow the Python uuid implementation, |
| 7 | which is specified in RFC4122: |
| 8 | |
| 9 | http://www.faqs.org/rfcs/rfc4122.html |
| 10 | |
| 11 | However, other systems do not necessarily follow this convention (especially data sets |
| 12 | outside of IT systems), but we still must be able to identify such data resources. |
| 13 | |
| 14 | Therefore, in every shared resource (XML+JSON), the UUID shall be prefixed by the domain |
| 15 | name of the originating instance (authoritative domain) plus a slash ("/"), e.g. |
| 16 | |
| 17 | {{{ |
| 18 | haiti.sahanafoundation.org/12345678-1234-5678-1234-567812345678 |
| 19 | }}} |
| 20 | |
| 21 | Generally, a "domain name" here can be any arbitraty XML name except it must not contain |
| 22 | any slashes. However, the domain name must be unique, of course - and therefore it is |
| 23 | recommended to use the internet domain name of the current instance. This in turn requires |
| 24 | that all applications which share that domain name and take part in the data exchange adhere |
| 25 | to the same UUID convention (UUID's have to be unique at least within the same domain). |
| 26 | |
| 27 | == Implementation Guideline == |
| 28 | |
| 29 | At '''import''', when the system receives a resource with a prefixed UUID and the prefix matches |
| 30 | the domain of the current instance, then the prefix gets removed to identify the resource |
| 31 | in the database. If the prefix differs from our domain, then the prefix is retained in the |
| 32 | database record. |
| 33 | |
| 34 | At '''export''', all unprefixed UUIDs from the database get prefixed by the domain name of the |
| 35 | current instance. In those UUIDs which already have a prefix (because they have been imported |
| 36 | from another domain), the prefix is retained. |
| 37 | |