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.
18 19 20 21 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 18 def initialize(managed_concept, = {}) @concept = managed_concept @options = end |
Class Method Details
.transform(managed_concept, options = {}) ⇒ Object
6 7 8 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 6 def self.transform(managed_concept, = {}) new(managed_concept, ).build end |
.transform_document(concepts, options = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 10 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
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/glossarist/transforms/concept_to_skos_transform.rb', line 23 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 |