Class: Hyrax::ControlledVocabularies::Location

Inherits:
ActiveTriples::Resource
  • Object
show all
Includes:
ResourceLabelCaching
Defined in:
lib/hyrax/controlled_vocabularies/location.rb

Constant Summary

Constants included from ResourceLabelCaching

ResourceLabelCaching::CACHE_KEY_PREFIX

Instance Method Summary collapse

Methods included from ResourceLabelCaching

#fetch, #rdf_label

Instance Method Details

#full_labelObject



16
17
18
# File 'lib/hyrax/controlled_vocabularies/location.rb', line 16

def full_label
  location_service.full_label(rdf_subject.to_s)
end

#solrizeObject

Return a tuple of url & label



10
11
12
13
14
# File 'lib/hyrax/controlled_vocabularies/location.rb', line 10

def solrize
  label = full_label || rdf_label.first.to_s
  return [rdf_subject.to_s] if label.blank? || label == rdf_subject.to_s
  [rdf_subject.to_s, { label: "#{label}$#{rdf_subject}" }]
end