o-ref: Omeka S portable references

Two terms that identify and link Omeka S resources by a property value instead of by internal id.

Namespacehttps://omeka-s-contrib.github.io/omeka-s-ref/ns#
Prefixo-ref
Version0.1.0
FormatsTurtle, JSON-LD, RDF/XML

Why

Omeka S links one resource to another by internal id: an item lists its item sets as {"o:id": 42}, and a value that points to another item does the same. That id only means something on the installation that assigned it. A record exported from one installation and imported into another needs a link that survives the move. These terms name the linked resource by one of its property values instead, and the importing side looks it up.

Terms

o-ref:id
At the top level of a record. The record's own identity, used to find an existing copy of it before creating it, so the same record is not imported twice.
o-ref:ref
Where Omeka S writes {"o:id": …}: an entry of o:item_set, or a value that links to another resource. A link to another record, resolved to that record's id on import.

Both take an object with exactly one property and one value:

{"<term>": "<value>"}

The property is a term of a vocabulary the installation knows, such as dcterms:identifier. o-ref:id says “this record is the resource that has this value”; o-ref:ref says “link to the one resource that has this value”.

Example

An item set and an item in it, adapted from Omeka-S-Cli's documentation examples. The item set identifies itself by its dcterms:identifier:

{
    "@context": {
        "dcterms": "http://purl.org/dc/terms/",
        "o": "http://omeka.org/s/vocabs/o#",
        "o-ref": "https://omeka-s-contrib.github.io/omeka-s-ref/ns#"
    },
    "@type": "o:ItemSet",
    "o-ref:id": {"dcterms:identifier": "set-paintings"},
    "o:title": "Paintings",
    "dcterms:title": [{"type": "literal", "@value": "Paintings"}],
    "dcterms:identifier": [{"type": "literal", "@value": "set-paintings"}]
}

The item names that item set by the same value, where Omeka S would write its id:

{
    "@context": {
        "dcterms": "http://purl.org/dc/terms/",
        "o": "http://omeka.org/s/vocabs/o#",
        "o-ref": "https://omeka-s-contrib.github.io/omeka-s-ref/ns#"
    },
    "@type": "o:Item",
    "o-ref:id": {"dcterms:identifier": "obj-1"},
    "o:title": "Mona Lisa",
    "o:item_set": [{"o-ref:ref": {"dcterms:identifier": "set-paintings"}}],
    "dcterms:title": [{"type": "literal", "@value": "Mona Lisa"}],
    "dcterms:identifier": [{"type": "literal", "@value": "obj-1"}]
}

On import, the item set is created first (or found, by its o-ref:id); the item's o-ref:ref then resolves to that item set's id on the new installation.

Matching

Consumers

Stability

Source

omeka-s-contrib/omeka-s-ref, under the MIT license. ns.ttl is the source of truth; the JSON-LD and RDF/XML are generated from it.