Class: Glossarist::Transforms::ConceptToSkosTransform
- Inherits:
-
Object
- Object
- Glossarist::Transforms::ConceptToSkosTransform
- Defined in:
- lib/glossarist/transforms/concept_to_skos_transform.rb
Class Method Summary collapse
- .transform(managed_concept, options = {}) ⇒ Object
- .transform_document(concepts, options = {}) ⇒ Object
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(managed_concept, options = {}) ⇒ ConceptToSkosTransform
constructor
A new instance of ConceptToSkosTransform.
Constructor Details
#initialize(managed_concept, options = {}) ⇒ ConceptToSkosTransform
Returns a new instance of ConceptToSkosTransform.
20 21 22 23 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 20 def initialize(managed_concept, = {}) @concept = managed_concept @options = end |
Class Method Details
.transform(managed_concept, options = {}) ⇒ Object
8 9 10 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 8 def self.transform(managed_concept, = {}) new(managed_concept, ).build end |
.transform_document(concepts, options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 12 def self.transform_document(concepts, = {}) Rdf::SkosVocabulary.new( id: [:shortname] || "glossary", title: [:title], concepts: concepts.map { |c| transform(c, ) }, ) end |
Instance Method Details
#build ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 25 def build Rdf::SkosConcept.new( code: concept_code, labels: build_labels, definitions: build_definitions, alt_labels: build_alt_labels, scope_notes: build_scope_notes, domain: build_domain, sources: build_sources, date_accepted: build_date_accepted, ) end |