ruby-rdf / rdf-vocab

Common RDF Vocabularies
The Unlicense
50 stars 29 forks source link

Update vocabularies to use language maps #74

Closed gkellogg closed 2 years ago

gkellogg commented 2 years ago

This is implemented in a6d073b6ac647645b7d9f5a6bd7f8688bb7378f6.

This updates numerous vocabularies to use a language-map representation for literal values, where appropriate. Recent changes to the rdf gem (https://github.com/ruby-rdf/rdf/commit/9fb42b64d945f594c6af8a3cd9d503b9e7ccad2d) allow for the use of language-maps in term definitions, for example:

property :actor,
  comment: {en: "Subproperty of as:attributedTo that identifies the primary actor"},
  domain: "https://www.w3.org/ns/activitystreams#Activity”,

Generally this change is transparent, if you use a standard accessor such as RDF::Vocab::AS.actor.comment. But, if you rely on the underlying attribute mechanism such as `RDF::Vocab::AS.actor.attributes[:comment], you will now see the language-map representation (where ‘en’, if present, will always come first)

RDF::Vocab::AS.actor.comment #=> #<RDF::Literal:0x2b84("Subproperty of as:attributedTo that identifies the primary actor"@en)>

RDF::Vocab::AS.actor.attributes[:comment] #=> {en: "Subproperty of as:attributedTo that identifies the primary actor”}

While this affects many vocabulary definitions in rdf-vocab, it adds some long missing capability to the built-in vocabulary definitions.

Without objection, this will be released in version 3.2.1 in the coming days, but as it has the potential to affect some uses of the builtin vocabularies, I wanted to call it out specifically to this group.

gkellogg commented 2 years ago

cc/ @wu-lee

gkellogg commented 2 years ago

Released in 3.2.1