iptc / newsinjson

Home of the IPTC ninjs standard
https://iptc.org/standards/ninjs/
Other
34 stars 9 forks source link

Uniqueness of Unique ID, also local system IDs #172

Open himslm01 opened 3 months ago

himslm01 commented 3 months ago

The ninjsType includes the uri field described as a globaly unique identifier, but there can be no guarantee that it is globally unique.

"uri": { 
   "title": "Uniform Resource Identifier", 
   "description": "The global unique identifier for this news object. This is the only required property and should identify the ninjs object, not be used for links to external resources etc. nar:newsItem@guid", 
   "type": "string", 
   "format": "uri" 
}, 

Am I missing recommendations for making the uri unique, and what systems should do when they receive, as they will, objects where the uri is not unique - even within their own system?

From the LPX hack day noticed that the Arqiva API does nothing when it receives and stores multiple events with identical uris.

From the LPX hack day I also noticed that the Arqiva API adds its own local-system unique id field to the ninjsType objects.

Since the the ninjsType does not set "additionalProperties": false or "unevaluatedProperties": false then I guess that’s okay, but implementers will need to know to extend the ninjsType object for this specific API in order to fully unmarshall the data.

In the Arqiva API the id is the system-unique ID for updating and deleting the event.

iyoung commented 1 month ago

GUID aspect looks to have been taken from NAR in the early days of NinJS. We could look to clarify the requirement in the schema document so it's clear. Is it actually just a URI and we recommend for ease of use this is an addressable URL, unique in nature or does it actually have to be globally unique. @mephinet are you aware of the background for the guid use in NAR and how that might relate to the NinJS URI?

pmougin commented 1 month ago

A unique identifier for each news-related item is needed in news workflows. In particular, it is needed when implementing the ability for a system to send an update (i.e., a new version) of a news-related item to another system, as there must be a way for the sender to tell the receiver what item is updated. In order to support global news workflow (i.e., systems exchanging news-related items with any numbers of other systems from any number of other organizations), NAR and ninjs specify that the identifier must be globally unique. It is specified as being an URI but there is no need for it to be dereferenceable and we do not specifically advise for it to be. To mint URIs that are globally unique, I advise to use the URN namespace specified in RFC 3085bis. It is an expired draft but will hopefully be presented again by IPTC for adoption at some point.