Skip to content

Api example: registration

der edited this page Mar 27, 2015 · 7 revisions

Table of contents

In all the examples below a registration action is performed by a POST to the endpoint http://registry/reg1.

We omit prefix declarations for simplicity of presentation. Similarly we omit versioning of register items.

An arbitrary allocated identification number is shown as “xx”.

Simple registration of external entity

Payload

<http://example.com/anentity> a skos:Concept;
    skos:prefLabel "an entity"@en;
.

Result

<http://registry/reg1/_xx> a reg:RegisterItem;
    rdfs:label "an entity"@en;
    reg:itemClass skos:Concept;
    reg:notation "xx";
    dct:dateSubmitted "2012-11-11T09:40:00Z"^^xsd:dateTime ;
    reg:status  reg:statusProposed ;
    reg:definition <http://registry/reg1/_xx:1#entityRef> ;
    version:interval [ time:hasBeginning [ time:inXSDDateTime "2012-11-11T09:40:00Z"^^xsd:dateTime ] ];
.
<http://registry/reg1/_xx:1#entityRef> a reg:EntityReference;
    reg:entity <http://example.com/anentity> ;
    reg:sourceGraph <http://registry/reg1/_xx:1#graph> ;
.
<http://registry/reg1/_xx:1#graph> {
    <http://example.com/anentity> a skos:Concept;
        skos:prefLabel "an entity"@en;
    .    
}

Simple registration of an internal entity with explicit URI

Payload

<eg> a skos:Concept;
    skos:prefLabel "an example entity"@en;
.

Result

<http://registry/reg1/_eg> a reg:RegisterItem;
    rdfs:label "an example entity"@en;
    reg:itemClass skos:Concept;
    reg:notation "eg";
    dct:dateSubmitted "2012-11-11T09:40:00Z"^^xsd:dateTime ;
    reg:status  reg:statusProposed ;
    reg:definition <http://registry/reg1/_eg:1#entityRef> ;
    version:interval [ time:hasBeginning [ time:inXSDDateTime "2012-11-11T09:40:00Z"^^xsd:dateTime ] ];
.
<http://registry/reg1/_eg:1#entityRef> a reg:EntityReference;
    reg:entity <http://registry/reg1/eg> ;
    reg:sourceGraph <http://registry/reg1/_eg:1#graph> ;
.
<http://registry/reg1/_eg:1#graph> {
    <http://registry/reg1/eg> a skos:Concept;
        skos:prefLabel "an example entity"@en;
    .    
}

Simple registration with automatic identifier allocation

Payload

<> a skos:Concept;
    skos:prefLabel "an allocated entity"@en;
.

Result

<http://registry/reg1/_xx> a reg:RegisterItem;
    rdfs:label "an allocatedentity"@en;
    reg:itemClass skos:Concept;
    reg:notation "xx";
    dct:dateSubmitted "2012-11-11T09:40:00Z"^^xsd:dateTime ;
    reg:status  reg:statusProposed ;
    reg:definition <http://registry/reg1/_xx:1#entityRef> ;
    version:interval [ time:hasBeginning [ time:inXSDDateTime "2012-11-11T09:40:00Z"^^xsd:dateTime ] ];
.
<http://registry/reg1/_xx:1#entityRef> a reg:EntityReference;
    reg:entity <http://registry/reg1/xx> ;
    reg:sourceGraph <http://registry/reg1/_xx:1#graph> ;
.
<http://registry/reg1/_xx:1#graph> {
    <http://registry/reg1/xx> a skos:Concept;
        skos:prefLabel "an allocated entity"@en;
    .    
}

Registration with an explicit item definition

<_eg2> a reg:RegisterItem;
    dct:license eg:openlicense;
    reg:definition [
        reg:entity <eg2>;
    ]
.    
<eg2> a skos:Concept;
    skos:prefLabel "an embedded entity"@en;
.

Result

<http://registry/reg1/_eg2> a reg:RegisterItem;
    rdfs:label "an embedded entity"@en;
    reg:itemClass skos:Concept;
    reg:notation "eg2";
    dct:license eg:openlicense;
    dct:dateSubmitted "2012-11-11T09:40:00Z"^^xsd:dateTime ;
    reg:status  reg:statusProposed ;
    reg:definition <http://registry/reg1/_eg2:1#entityRef> ;
    version:interval [ time:hasBeginning [ time:inXSDDateTime "2012-11-11T09:40:00Z"^^xsd:dateTime ] ];
.
<http://registry/reg1/_eg2:1#entityRef> a reg:EntityReference;
    reg:entity <http://registry/reg1/eg2> ;
    reg:sourceGraph <http://registry/reg1/_eg2:1#graph> ;
.
<http://registry/reg1/_eg2:1#graph> {
    <http://registry/reg1/eg2> a skos:Concept;
        skos:prefLabel "an embedded entity"@en;
    .    
}
Clone this wiki locally