Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Include Page
Working Documents (navigation) - Best Practices for Authoritative Data (C2)
Working Documents (navigation) - Best Practices for Authoritative Data (C2)

Expand
titleTable of Contents

Table of Contents

Overview

This proposes a change document structure using Activity Streams.  It includes examples for each type of change.

Activity Streams

References:

Specification for Activity Stream 2.0

Sidecar specification describing activity types (e.g. add, delete, etc.)

Add Example:

Code Block
languagenone
titleAdd a single triple
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> 'milk'@en."
}
Code Block
languagenone
titleAdd an entity with multiple triples
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/hasLabel> 'cow milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/broader_term> <http://my_repo/entity/milk>.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> <http://my_repo/entity/bovine_milk>. }
Code Block
languagenone
titleAdd an entity with a blank node
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> b1:.
            <b1:> <http://my.authority/vocab/label> 'milk'@en."
}

Delete Example:

Code Block
titleDelete a single triple
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete term milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> 'milk'@en."
}
Code Block
titleDelete an entity with multiple triples
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete term cow milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/hasLabel> 'cow milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/broader_term> <http://my_repo/entity/milk>.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> <http://my_repo/entity/bovine_milk>. }
Code Block
titleDelete a triple with blank node
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete term milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> b1:.
            <b1:> <http://my.authority/vocab/label> "milk"@en."
}

Deprecate Example:

Code Block
titleDelete a single triple
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Deprecate term milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/status> 'deprecated'.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/bovine_milk>."
}

Change Example:

Code Block
titleChange a single triple
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete term milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> 'milk'@en."
}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Add term Milk as a replacement of term milk", 
  "type": "Add", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> 'Milk'@en" 
}
Code Block
titleChange multiple triples for an entity at once
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete narrower terms for milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  }, 
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> 'bovine milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> 'oxen milk'@en."
}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Add narrower terms for milk", 
  "type": "Add", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> 'Bovine milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/narrow_term> 'Oxen milk'@en."
}
Code Block
titleChange a triple with blank node intermediary
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Delete term milk",
  "type": "Delete",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  }, 
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> b1:.
            <b1:> <http://my.authority/vocab/label> 'milk'@en."}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Add term Milk as a replacement of term milk", 
  "type": "Add", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/milk> <http://my.authority/vocab/hasLabel> b2:.
            <b2:> <http://my.authority/vocab/label> 'milk'@en."}
}

Split Example:

NOTE: For entities, Deprecation is preferred over Delete.  As such, the entity being split is shown as deprecated.

Code Block
titleSplit an entity with a single triple into two entities
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term bovine milk split from cow milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/bovine_milk> <http://my.authority/vocab/hasLabel> 'bovine milk'@en."
}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Add term oxen milk split from cow milk", 
  "type": "Add", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/oxen_milk> <http://my.authority/vocab/hasLabel> 'oxen milk'@en" 
}

{ 
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Deprecate term cow milk. Split into bovine milk and oxen milk.", 
  "type": "Deprecated", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  }, 
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/status> 'deprecated'.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/bovine_milk>.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/oxen_milk>."
}
Code Block
titleSplit an entity with multiple triples into two entities
collapsetrue
{ 
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Deprecate triples related to cow milk.",
  "type": "Delete", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",    
    "name": "My Authority"
   },  
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/altLabel> 'bovine milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/altLabel> 'oxen milk'@en."
}  

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term bovine milk split from cow milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/bovine_milk> <http://my.authority/vocab/hasLabel> 'bovine milk'@en. 
            <http://my_repo/entity/bovine_milk> <http://my.authority/vocab/altLabel> 'cow milk'@en."
}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Add term oxen milk split from cow milk", 
  "type": "Add", 
  "actor": { 
    "type": "Authority", 
    "id": "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/oxen_milk> <http://my.authority/vocab/hasLabel> 'oxen milk'@en.
            <http://my_repo/entity/oxen_milk> <http://my.authority/vocab/altLabel> 'cow milk'@en."
}

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Deprecate term cow milk. Split into bovine milk and oxen milk.",
  "type": "Deprecated",
  "actor": {
    "type": "Authority",
    "id": "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/status> 'deprecated'.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/bovine_milk>.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/oxen_milk>."
}

Merge Example:

NOTE: For entities, Deprecation is preferred over Delete.  As such, the entities being merged are shown as deprecated.

Code Block
titleMerge entities into a single entity
collapsetrue
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Add term cow milk merged from bovine milk and oxen milk",
  "type": "Add",
  "actor": {
    "type": "Authority",
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/cow_milk> <http://my.authority/vocab/hasLabel> 'cow milk'@en." 
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/altLabel> 'bovine milk'@en.
            <http://my_repo/entity/cow_milk> <http://my.authority/vocab/altLabel> 'oxen milk'@en."}

{
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Deprecate term oxen milk merged with bovine milk into cow milk", 
  "type": "Deprecate", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  },
  "graph": "<http://my_repo/entity/oxen_milk> <http://my.authority/vocab/hasLabel> 'oxen milk'@en"
            <http://my_repo/entity/oxen_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/cow_milk>. 
}

{ 
  "@context": "https://www.w3.org/ns/activitystreams", 
  "summary": "Deprecate term bovine milk merged with oxen milk into cow milk", 
  "type": "Deprecated", 
  "actor": { 
    "type": "Authority", 
    "id":   "http://my.authority",
    "name": "My Authority"
  }, 
  "graph": "<http://my_repo/entity/bovine_milk> <http://my.authority/vocab/status> 'deprecated'."
            <http://my_repo/entity/bovine_milk> <http://my.authority/vocab/use_instead> <http://my_repo/entity/cow_milk>.
}

RDF Diff

RDF*

Specification (draft) of RDF* and SPARQL* - https://w3c.github.io/rdf-star/cg-spec/editors_draft.html

Other Refs

IIIF Change Discovery

Specification: https://iiif.io/api/discovery/0.9/

...


Moved to Google Doc for easier collaboration.  See Activity Streams - Example Change Documents for Authoritative Data