app/models/concerns/concept.rb
# add res as a top level concept to the concept scheme
add res as a top level concept to the concept scheme
add res as a top level concept to the concept scheme
def add_top_level_concept(resource, opts={})
      cs = nil
      begin
        cs = ConceptScheme.find(self.resource_concept_scheme_uri.to_s)
      rescue Tripod::Errors::ResourceNotFound
        cs = ConceptScheme.new(self.resource_concept_scheme_uri.to_s, self.get_graph_uri)
        cs.label = self.resource_concept_scheme_label
      end
      cs.has_top_concept = cs.has_top_concept << resource.uri
      cs.save!(:transaction => opts[:transaction])
    end
def add_top_level_concept ( resource , opts = { } ) cs = nil begin cs = ConceptScheme . find ( self . resource_concept_scheme_uri . to_s ) rescue Tripod :: Errors :: ResourceNotFound cs = ConceptScheme . new ( self . resource_concept_scheme_uri . to_s , self . get_graph_uri ) cs . label = self . resource_concept_scheme_label end cs . has_top_concept = cs . has_top_concept << resource . uri cs . save! ( :transaction => opts [ :transaction ] ) end
add res as a top level concept to the concept scheme
add res as a top level concept to the concept scheme
# find the concept scheme, or make it if it doesn't exist # add to the top concepts
resource
<not_specific>
opts
<not_specific>