lib/browser_web_data_entity_sumarization/entity_sumarization_statistics.rb
###
# The method helps to continue of process find links in nif dataset.
#
# @param [String] resource_uri
# @param [Hash] actual_resource_data Part data extracted from nif dataset for given resource_uri
# @param [String] type Type from http://mappings.dbpedia.org/server/ontology/classes/
#
# @return [Hash] out
The method helps to continue of process find links in nif dataset.
The method helps to continue of process find links in nif dataset .
def find_relations(resource_uri, actual_resource_data, type)
        out = {
          sections: {},
          relations: []
        }
        puts "- properties to find size[#{actual_resource_data.size}]" if @console_output
        time = Benchmark.realtime {
          out[:relations] = actual_resource_data.map! { |resource_data|
            section_group = resource_data[:section].scan(SCAN_REGEXP[:group])
            type_key = resource_data[:section].force_encoding('utf-8')
            out[:sections][type_key] ||= {
              type: section_group[0][0],
              from: section_group[0][1].to_i,
              to: section_group[0][2].to_i,
            }
            result = get_predicates_by_link(resource_uri, resource_data[:link], type)
            resource_data[:properties] = result[:properties]
            resource_data[:strict_properties] = result[:strict_properties]
            resource_data
          }.compact || []
        }
        out[:time] = time.round(2)
        puts "- properties found in #{out[:time]}" if @console_output
        out
      end
def find_relations ( resource_uri , actual_resource_data , type ) out = { sections : { } , relations : [ ] } puts "- properties to find size[#{actual_resource_data.size}]" if @console_output time = Benchmark . realtime { out [ :relations ] = actual_resource_data . map! { | resource_data | section_group = resource_data [ :section ] . scan ( SCAN_REGEXP [ :group ] ) type_key = resource_data [ :section ] . force_encoding ( 'utf-8' ) out [ :sections ] [ type_key ] ||= { type : section_group [ 0 ] [ 0 ] , from : section_group [ 0 ] [ 1 ] . to_i , to : section_group [ 0 ] [ 2 ] . to_i , } result = get_predicates_by_link ( resource_uri , resource_data [ :link ] , type ) resource_data [ :properties ] = result [ :properties ] resource_data [ :strict_properties ] = result [ :strict_properties ] resource_data } . compact || [ ] } out [ :time ] = time . round ( 2 ) puts "- properties found in #{out[:time]}" if @console_output out end
The method helps to continue of process find links in nif dataset.
The method helps to continue of process find links in nif dataset .
None
Hash
resource_uri
<not_specific>
actual_resource_data
<not_specific>
type
<not_specific>
<not_specific>
None