glossarist / glossarist-ruby

Concept modeller in Ruby
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

add a `ConceptSet` class in glossarist #49

Closed HassanAkbar closed 1 year ago

HassanAkbar commented 1 year ago

we should have a class called ConceptSet. This Set will have the bibliographic data

ronaldtse commented 1 year ago

Originally from https://github.com/geolexica/isotc204.geolexica.org/pull/12#discussion_r973148842

The "ConceptSet" instance represents a set of Glossarist concepts, which also includes:

All these objects need to have their own Ruby class definitions.

HassanAkbar commented 1 year ago

@ronaldtse For clarification what we should do is create a new class named ConceptSet and that class will have further 2 attributes ManagedConceptCollection and Bibliography. something like below.

class ConceptSet
  attr_accessor :concept_collection, :bibliography
end

Is this what you have in mind or am I going in the wrong direction?

ronaldtse commented 1 year ago

@HassanAkbar yes this is correct. Something like this:

class Glossarist::ConceptSet
  attr_accessor :concepts, # concepts leads to a collection of `Concept`s
                :bib_db # bib_db leads to a `BibCollection` object
                :assets # an `AssetsCollection` object

  # The `concept` objects in `concepts` can refer to Relaton references in the `bib_db`
  def initialize(concepts)
    # ...
    # Fills in the bib_db
    concepts.each do |concept|
      bib_db.add(concept.ref) if concept.ref
    end
  end
end

# Relaton provides some basic classes to work with bibliographic items
class Glossarist::BibCollection < Relaton::Database
   # ...
end

# A set of assets that can be referred to by concepts
class Glossarist::AssetsCollection < Set
  # ...
end

# Represents a figure, an image, or an asset.
class Glossarist::Asset
  # ...
end
HassanAkbar commented 1 year ago

@ronaldtse What I have done so far

Questions

ronaldtse commented 1 year ago

For Collections::AssetCollection How are we going to initially populate this? Will the list of assets be passed to it or will it be genertaed by us using some algorithm that will work based on the concepts collection?

Yes, assets are passed to it on the creation of the ConceptSet.