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

Default attributes from yaml file is not working #70

Closed
imadbourouche opened this issue Feb 4, 2025 · 0 comments
Closed

Default attributes from yaml file is not working #70

imadbourouche opened this issue Feb 4, 2025 · 0 comments
Assignees
Labels

Comments

@imadbourouche
Copy link
Member

When defining default values for attributes in a yaml file like this

acronym:
  display: "general" 
  label: "Acronym"
  helpText: "The Acronym of the catalog which is described by these metadata."
  example: 'agroportal'
  default: 'ontoportal'

and defining the attribute in the model

model :SemanticArtefactCatalog, namespace: :mod, scheme: File.join(__dir__, '../../../../config/schemes/semantic_artefact_catalog.yml'),
                                                            name_with: ->(s) { RDF::URI.new(LinkedData.settings.id_url_prefix) }

attribute :acronym, namespace: :omv, enforce: [:unique]

When we call save method to save the mode in triple store we will have this error

NoMethodError: undefined method `call' for "ontoportal":String
    /home/bourouch/work/MOD-API/goo/lib/goo/base/resource.rb:258:in `block in save'
    /home/bourouch/work/MOD-API/goo/lib/goo/base/resource.rb:255:in `each'
    /home/bourouch/work/MOD-API/goo/lib/goo/base/resource.rb:255:in `save'
    /home/bourouch/work/MOD-API/ontologies_linked_data/lib/ontologies_linked_data/models/base.rb:13:in `save'
    /home/bourouch/work/MOD-API/ontologies_linked_data/test/models/mod/test_artefact_catalog.rb:11:in `test_create_artefact_catalog'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant