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

implement yml scheme integration for Goo models #29

Closed
3 tasks done
syphax-bouazzouni opened this issue Feb 28, 2023 · 1 comment
Closed
3 tasks done

implement yml scheme integration for Goo models #29

syphax-bouazzouni opened this issue Feb 28, 2023 · 1 comment

Comments

@syphax-bouazzouni
Copy link

syphax-bouazzouni commented Feb 28, 2023

Context

Currently, when we want to add metadata to a model attribute (e.g description, helpText, label), we need to put them directly in the code.

Which overloads the code and makes it hard to read it and figure out the logic behind

For example, the attribute natrualLanguage of submissions, is currently so

    attribute :naturalLanguage, namespace: :omv, enforce: [:list], extractedMetadata: true,
                metadataMappings: ["dc:language", "dct:language", "doap:language", "schema:inLanguage"],
                helpText: "The language of the content of the ontology.<br>Consider using a <a target="_blank" href="http://www.lexvo.org/">Lexvo URI</a> with ISO639-3 code.<br>e.g.: http://lexvo.org/id/iso639-3/eng",
                enforcedValues: {
                  "http://lexvo.org/id/iso639-3/eng" => "English",
                  "http://lexvo.org/id/iso639-3/fra" => "French",
                  "http://lexvo.org/id/iso639-3/spa" => "Spanish",
                  "http://lexvo.org/id/iso639-3/por" => "Portuguese",
                  "http://lexvo.org/id/iso639-3/ita" => "Italian",
                  "http://lexvo.org/id/iso639-3/deu" => "German"
                }

Gaol

The goal is to extract the metadata fields in a YAML file, that will present the scheme of a model.

So that in the code we have

     model :ontology_submission,  scheme: 'path to yaml file'

    attribute :naturalLanguage, namespace: :omv, enforce: [:list],  extractedMetadata: true,
     

and in the YAML file, we will have the following

naturalLanguage:
     metadataMappings: ["dc:language", "dct:language", "dop:language", "schema:inLanguage"]
     helpText: "The language of the content of the ontology.<br>Consider using a <a target="_blank" href="http://www.lexvo.org/">Lexvo URI</a> with ISO639-3 code.<br>e.g.: http://lexvo.org/id/iso639-3/eng"
     enforcedValues: {
        "http://lexvo.org/id/iso639-3/eng": "English",
        "http://lexvo.org/id/iso639-3/fra": "French",
        "http://lexvo.org/id/iso639-3/spa": "Spanish",
        "http://lexvo.org/id/iso639-3/por": "Portuguese",
        "http://lexvo.org/id/iso639-3/ita": "Italian",
        "http://lexvo.org/id/iso639-3/deu": "German",
     }

Requirement

  • Read a yaml file
  • Append yaml file content to a model settings
  • Add tests
@syphax-bouazzouni
Copy link
Author

Done with #30

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

No branches or pull requests

1 participant