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

Add support for extension slots #375

Merged
merged 10 commits into from
Aug 6, 2024
Merged

Conversation

gouttegd
Copy link
Contributor

@gouttegd gouttegd commented Jul 23, 2024

Resolves #328

  • docs/ have been added/updated if necessary
  • make test has been run locally
  • tests have been added/updated (not applicable)
  • CHANGELOG.md has been updated.

If you are proposing a change to the SSSOM metadata model, you must

  • provide a full, working and valid example in examples/
  • provide a link to the related GitHub issue in the see_also field of the linkml model
  • provide a link to a valid example in the see_also field of the linkml model
  • run SSSOM-Py test suite against the updated model

This PR updates the SSSOM model to allow for defined extensions as proposed in #328.

It also updates the description of the data model to describe the use of both defined and undefined extension, and the specification of the SSSOM/TSV format to explain how SSSOM/TSV parsers and writers should deal with such extensions.

Overall, this is exactly what was proposed in this comment in #328, except that here we need to split the specification in two parts (one about extensions in general, independently of the serialisation format, and one about the SSSOM/TSV serialisation of extensions), while the initial proposition was in a single block.

We add a new slot to the MappingSet object , representing the
definitions of extension slots that may be used within the set (as a
list of "extension definition" objects).

Each "extension definition" is made of up to three elements:

* the name of the extension slot,
* the identifier of an associated property,
* a type hint.

We also add a sample file that demonstrates the use of such extension
slots.
We add a section in the description of the data model to explain what
extension slots are and how they should be used.

We add a section in the specification of the SSSOM/TSV format to explain
how extension slots should be managed in that format.
We add the two following prefix names:

* xsd: http://www.w3.org/2001/XMLSchema#
* linkml: https://w3id.org/linkml/

to the list of built-in prefix names. They are intended to be used when
defining "extension slots" (as the value of the `type_hint` slot, to
define the expected type of the slot), so for convenience we make them
built-in.
@gouttegd gouttegd self-assigned this Jul 23, 2024
@gouttegd gouttegd requested a review from matentzn July 23, 2024 18:52
@gouttegd gouttegd added the enhancement New feature or request label Jul 23, 2024
The IRI of the "uriorcurie" data type is
`https://w3id.org/linkml/Uriorcurie`, _not_ `.../uriOrCurie`. Not sure
where I got the incorrect casing from.
@gouttegd gouttegd force-pushed the add-support-for-extension-slots branch from 7f03542 to b0754c9 Compare July 23, 2024 19:17
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it. Made some comments, have not done any testing yet.

examples/schema/extension-slots.sssom.tsv Show resolved Hide resolved
src/docs/spec-formats-tsv.md Show resolved Hide resolved
src/docs/spec-model.md Outdated Show resolved Hide resolved
src/docs/spec-model.md Outdated Show resolved Hide resolved
Clear out possible ambiguity when referring to the "LinkML model".

Clarify the possible types of extension values.
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some last round of comments, I looked how the generated schemas look like and I am satisfied with the formal representation. The most important part of this PR is in any case the update to the specification.

src/sssom_schema/schema/sssom_schema.yaml Outdated Show resolved Hide resolved
src/docs/spec-formats-tsv.md Outdated Show resolved Hide resolved
src/docs/spec-model.md Outdated Show resolved Hide resolved
src/docs/spec-model.md Show resolved Hide resolved
src/docs/spec-model.md Show resolved Hide resolved
Clarify reference to `slot_name` in the description of the `property`
slot.

Fix incorrect reference to a SSSOM/TSV _writer_ (not _reader_) when we
state that unknown slots MUST NOT be written in SSSOM/TSV files.

Replace "catenate" by "concatenate". My understanding is that the two
terms are actually equivalent, but "concatenate" is for some reason more
widely used at least in computer science.
matentzn
matentzn previously approved these changes Aug 4, 2024
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, done now, getting other reviewers in!

Copy link
Contributor

@hrshdhgd hrshdhgd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as #386

Any change to the YAML file should be accompanied by a make all to update the corresponding python file.

hrshdhgd
hrshdhgd previously approved these changes Aug 5, 2024
matentzn
matentzn previously approved these changes Aug 5, 2024
@matentzn
Copy link
Collaborator

matentzn commented Aug 5, 2024

Ready to merge!

@gouttegd gouttegd dismissed stale reviews from matentzn and hrshdhgd via b8dec8d August 6, 2024 07:53
@gouttegd
Copy link
Contributor Author

gouttegd commented Aug 6, 2024

To re-reviewers: the only change was to the changelog, to fix the merge conflict caused by the merge of #386.

This is the expected consequence of the requirement (stated in the PR template) that the changelog must be updated in every PR (instead of updating it in one go before a release). All additions to the changelog are done at exactly the same place, so when there are several concurrent PR there cannot not be a merge conflict.

@gouttegd gouttegd mentioned this pull request Aug 6, 2024
8 tasks
@matentzn
Copy link
Collaborator

matentzn commented Aug 6, 2024

This PR is next in line for the merging, can you update the branch and resolve conflicts?

@gouttegd
Copy link
Contributor Author

gouttegd commented Aug 6, 2024

Will do by this evening. :)

@gouttegd gouttegd requested a review from matentzn August 6, 2024 16:23
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome feature!

@matentzn matentzn requested a review from hrshdhgd August 6, 2024 16:39
@gouttegd gouttegd merged commit 47d2a3f into master Aug 6, 2024
3 checks passed
@gouttegd gouttegd deleted the add-support-for-extension-slots branch August 6, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dealing with non-standard slots
3 participants