app/services/rdf/deep_indexing_service.rb
# We're overiding the default indexer in order to index the RDF
# labels. In order for this to be called, you must specify at least
# one default indexer on the property.
#
# @param [Hash] solr_doc
# @param [String] solr_field_key
# @param [Hash] field_info
# @param [ActiveTriples::Resource, String] val
We're overiding the default indexer in order to index the RDF
labels. In order for this to be called, you must specify at least
one default indexer on the property.
We ' re overiding the default indexer in order to index the RDF labels . In order for this to be called you must specify at least one default indexer on the property .
def fetch_external
    object.controlled_properties.each do |property|
      object[property].each do |value|
        resource = value.respond_to?(:resource) ? value.resource : value
        next unless resource.is_a?(ActiveTriples::Resource)
        next if value.is_a?(ActiveFedora::Base)
        old_label = resource.rdf_label.first
        next unless old_label == resource.rdf_subject.to_s || old_label.nil?
        fetch_value(resource) if resource.is_a? ActiveTriples::Resource
        next if old_label == resource.rdf_label.first
        next if resource.rdf_label.first == resource.rdf_subject.to_s
        resource.persist!
      end
    end
  end
def fetch_external object . controlled_properties . each do | property | object [ property ] . each do | value | resource = value . respond_to? ( :resource ) ? value . resource : value next unless resource . is_a? ( ActiveTriples :: Resource ) next if value . is_a? ( ActiveFedora :: Base ) old_label = resource . rdf_label . first next unless old_label == resource . rdf_subject . to_s || old_label . nil? fetch_value ( resource ) if resource . is_a? ActiveTriples :: Resource next if old_label == resource . rdf_label . first next if resource . rdf_label . first == resource . rdf_subject . to_s resource . persist! end end end
We're overiding the default indexer in order to index the RDF
labels.
We ' re overiding the default indexer in order to index the RDF labels .
# Store the fetched values into our marmotta triplestore
None