Language maps in builtin vocabularies

Up until now, the Ruby versions of standard vocabularies contained in the ruby-rdf gem [1] contained only english values for literals. Recent changes to the rdf gem [2] 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. Please comment on the GitHub issue [3] if possible, or in response to this email, otherwise.

Gregg Kellogg
gregg@greggkellogg.net

[1] https://github.com/ruby-rdf/rdf-vocab
[2] https://github.com/ruby-rdf/rdf/commit/9fb42b64d945f594c6af8a3cd9d503b9e7ccad2d
[3] https://github.com/ruby-rdf/rdf-vocab/issues/74

Received on Tuesday, 1 February 2022 00:37:08 UTC