Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add portal configuration model reading from config file #155

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

syphax-bouazzouni
Copy link

fix agroportal/project-management#592, by adding a model to define the portal configuration, containing the following attributes:

      model :SemanticArtefactCatalogue, namespace: :mod, name_with: :acronym
      attribute :acronym, enforce: [:unique, :existence]
      attribute :title, namespace: :dcterms, enforce: [:existence]
      attribute :color, enforce: [:existence, :valid_hash_code]
      attribute :description, namespace: :dcterms
      attribute :logo, namespace: :foaf, enforce: [:url]
      attribute :numberOfArtefacts, namespace: :mod, handler: :ontologies_count
      attribute :federated_portals
      attribute :fundedBy, enforce: [:list] 

the model is not saved in the triple store, but use the configuration files, to fill its attributes.

    config.ui_name                       = 'Bioportal'
    config.title                         = 'NCBO BioPortal'
    config.description                   = "The world's most comprehensive repository of biomedical ontologies "
    config.color                         = '#234979'
    config.logo                          = ''
    config.fundedBy                      = [
        {
          img_src: 'https://identity.stanford.edu/wp-content/uploads/sites/3/2020/07/block-s-right.png',
          url: 'https://www.stanford.edu',

        },
        {
          img_src: 'https://ontoportal.org/images/logo.png',
          url: 'https://ontoportal.org/',
        }
    ]
    config.federated_portals = {
          'agroportal' => {
            api: 'http://data.agroportal.lirmm.fr',
            ui: 'http://agroportal.lirmm.fr',
            apikey: 'XXXX',
            color: '#1e2251'
          },
          'bioportal' => {
                  api: 'http://data.bioontology.org',
                  ui: 'http://bioportal.bioontology.org',
                  apikey: 'XXXX',
                  color: '#234979'
           },

    }

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.

Project coverage is 81.90%. Comparing base (337dce9) to head (560783f).
Report is 19 commits behind head on development.

Files with missing lines Patch % Lines
lib/ontologies_linked_data/models/portal_config.rb 87.09% 4 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #155      +/-   ##
===============================================
+ Coverage        81.31%   81.90%   +0.59%     
===============================================
  Files               89      101      +12     
  Lines             6512     6666     +154     
===============================================
+ Hits              5295     5460     +165     
+ Misses            1217     1206      -11     
Flag Coverage Δ
unittests 81.90% <87.09%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant