lib/publisher/file_generator.rb
###
# normalizes a type configuration
# each property listed in the config is transformed to an object with attributes:
#  - varname, to be used in the query for the value eg ?resource <property> ?var_name
#  - uri, which is the property wrapped by <> if it's a uri or the property if it uses a prefix
###
normalizes a type configuration
each property listed in the config is transformed to an object with attributes:
varname, to be used in the query for the value eg ?resource  ?var_name
uri, which is the property wrapped by <> if it's a uri or the property if it uses a prefix
normalizes a type configuration each property listed in the config is transformed to an object with attributes : varname to be used in the query for the value eg ?resource ?var_name uri which is the property wrapped by < > if it ' s a uri or the property if it uses a prefix
def normalize(config)
    c = { optional_properties: {}, required_properties: {}, additional_filter: config[:additional_filter] }
    i = 0
    [:optional_properties, :required_properties].each do |prop_type|
      config[prop_type].each do |prop|
        c[prop_type][prop] = {}
        c[prop_type][prop]["varname"] = "prop_#{prop_type[0..2]}_#{i}"
        i += 1
        c[prop_type][prop]["uri"] = prop.start_with?("http") ? "<#{prop}>" : prop
      end
    end
    c
  end
def normalize ( config ) c = { optional_properties : { } , required_properties : { } , additional_filter : config [ :additional_filter ] } i = 0 [ :optional_properties , :required_properties ] . each do | prop_type | config [ prop_type ] . each do | prop | c [ prop_type ] [ prop ] = { } c [ prop_type ] [ prop ] [ "varname" ] = "prop_#{prop_type[0..2]}_#{i}" i += 1 c [ prop_type ] [ prop ] [ "uri" ] = prop . start_with? ( "http" ) ? "<#{prop}>" : prop end end c end
normalizes a type configuration
each property listed in the config is transformed to an object with attributes:
 varname, to be used in the query for the value eg ?resource <property> ?var_name
 uri, which is the property wrapped by <> if it's a uri or the property if it uses a prefix
normalizes a type configuration each property listed in the config is transformed to an object with attributes : varname to be used in the query for the value eg ?resource <property > ?var_name uri which is the property wrapped by < > if it ' s a uri or the property if it uses a prefix
config