Class: Glossarist::Rdf::GlossReference

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/glossarist/rdf/gloss_reference.rb

Overview

Unified RDF view for bibliographic citations and concept references.

Replaces the former GlossCitation and GlossConceptReference classes. Both model “a reference to an item within a collection”:

- Citation: collection=document series, item=document, position=clause
- ConceptReference: collection=termbase, item=concept

Class Method Summary collapse

Class Method Details

.slug(ref) ⇒ Object



44
45
46
47
48
# File 'lib/glossarist/rdf/gloss_reference.rb', line 44

def self.slug(ref)
  slug = [ref.source, ref.id].compact.join("/")
  slug = Digest::MD5.hexdigest(ref.text || "")[0..11] if slug.empty?
  slug
end