-
Notifications
You must be signed in to change notification settings - Fork 21
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
WIP: updated branch with changes to support linkml schema #456
Conversation
… and adding @language:en to context; bringing back imageUrl; splitting UI class to multiple classes for UI for Activity, Field and Protocol
here is a comparison to @djarecka 's branch for clarity: |
I also had some updates, but not sure if I will be able to merge with yours... |
I looked quickly at the context and yaml, and I noticed, that:
|
@satra - your branch gives shacl errors under validations, let me know if you want me to fix it, and work on your branch |
btw. for the |
I don't think that I changed description to string. Let's make sure we are
looking at the same branch.
Regarding id in landingpage it's for a couple of reasons. That one is to
indicate that the URL is the identifier for that page.
…On Sat, Feb 17, 2024, 5:58 PM Dorota Jarecka ***@***.***> wrote:
I looked quickly at the context and yaml, and I noticed, that:
- sometimes you changed my langString to string, e.g. in description,
but I took langString from your shacl
- if you use proper @vocab, like here:
https://github.com/ReproNim/reproschema/blob/90d853cb8e4cbd974df5175c9d1069f44dbd9c68/contexts/reproschema_new#L23,
you could remove ***@***.***": "reproschema:landingPage",
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABM57ZSMKFFCC7P567JI4DYUEY2NAVCNFSM6AAAAABDNT2UK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJQGQ4TQMJQGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That's a good idea. Having that as a built in type would be nice.
…On Sat, Feb 17, 2024, 6:20 PM Dorota Jarecka ***@***.***> wrote:
btw. for the langString and marking this as a class, I was thinking for
creating langString under types in linkml, but was trying multiple ways
without success. Was planning to create an issue with questions
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABM573XLMHP3W3NWZJSOG3YUE3KDAVCNFSM6AAAAABDNT2UK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJQGUZDSMJVGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, I was wrong about |
i adjusted it to only be in places where having multiple languages made some sense. regarding the shacl part, as long as it is not just pure hand edit. perhaps first try to read all the protocols/activities/items from the library using the pydantic model and if no model changes are required then generate shacl and edit it. |
if I use
|
class_uri: schema:VideoObject | ||
|
||
enums: | ||
AllowedType: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this list should also contain Skipped
or the activity1.jsonld
form the examples should be changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should really be AllowSkip
and the other one in missing enum Skipped
. activity1
should be adjusted for the new flag.
btw, for any of the enums, the autogenerated python needs to be updated to have reproschema:
in front of the values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that I understand, so let me confirm:
- in
AllowedType
enum I should add one more permissible value:AllowSkip
MissingType
should leave as it is withSkipped
- in the
activity1
I should useAllowSkip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also noticed that in the pydantic you're changing lang String
to str
, so perhaps I should move lang String
to types
as in the example I posted yesterday. However we will loose the check from shacl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirming the first question.
pydantic was auto generated. the only thing i changed were the enums. the class langString
in the model now has slots similar to prefix
in the linkml model as chris had suggested. so technically it should be a class in pydantic with two fields. can you give an example of where you are seeing the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's very inconsistent..
but actually having type Dict[str, str]
makes this version valid with the data. If you use really langString
it will fail since the keys do not match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we will simply create a class that we list all possible languages we use as attributes, so you can get in pydantic something like this:
class LangString(ConfiguredBaseModel):
en: str = Field(..., description="""The english version of the string""")
es: str = Field(..., description="""The spanish version of the sting.""")
This would allow to keep you short version of langstring in the jsonld
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i understand we can also set a handful of languages in yaml and add extra=Extra.allow
to the pydantic version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw. I think you had Dict[str, str]
instead of langString
because you used key: true
. I haven't used it before, but in a way it makes sense that it translated to Dcit[str, str]
. Still should be consistent though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know how we would deal with hyphenated langs like the ones here: https://github.com/ReproNim/reproschema-library/blob/9be140d0297ae0671d50466448ae67dea86d3bfd/activities/PHQ-9/PHQ9_schema#L13
for now let's keep it as key, value pairs like linkml prefixes and then we can adjust later.
adding AllowSkip and fixing activity1
changing LangString to Dict[str, str]
you want to keep this still as a separate branch? |
we can merge this, but if we do, we should remove/filter out the python file, unless there is a clear reason to keep one in this repo. we should either remove the shacl file and add a set of TODOs to the README before we release. |
so what about I will try to fix the shacl and in the meantime i will create a new branch in repronim-py with the |
@satra - working on test for Some of the classes, e.g. |
all classes should inherit from creativework/namedthing . |
…ativeWork slots; slightly different formatting from the linkml generator
adding CreativeWork to most of the classes
…l to have consistent with video and audio
removing imageUrl and CreativeWork
add proprietary flag to activities
@djarecka - can we make citation just a string? is there a reason it's a |
removing decimal
…merging reproschema-py)
cleaning: removing some fles and changing test (will not work before …
running pre-commit
merging master
fixing links
@satra @yibeichan - i think this can be merged, but unfortunately the python package workflow depends on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation folder is gone.
This is giving us a dead link in the doc.
@djarecka - adding an updated branch here.
i was testing the pydantic side with a snippet like this. for this snippet i copied the pydantic python file into the reproschema python library as
model.py
.i have updated the context in various places to match the current context and also refactored the yaml quite a bit. some major changes:
prefixes
in linkml)for now i have left
ui
as a jsonld@nest
still. but did not update the shacl to make corresponding changes. the shacl generation is not deterministic and we should figure a way for patching shacl perhaps using rdflib or something that we can query the object and alter it. also because we are using various classes in linkml, some expressions which should be simplyrdf:langString
as datatype are turning into class constraints. we may want to ask if there is someway to tell linkml generator that if a class hasclass_uri
:rdf:langString
treat it as datatype.anyway, i hope this gets us closer. the python part also requires some patching (for the enum values), but i think the base libary works.