-
Notifications
You must be signed in to change notification settings - Fork 22
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] linkml version #455
[wip] linkml version #455
Conversation
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 removing some sh:nodeKind sh:BlankNode (not sure if all were causing problems but some did)
some are blank nodes and were intended to be. for example additionalProperties
adds/replaces properties of an object, hence the object is in isAbout
but the information container is a blank node. we can replace it with a uuid, but it is already contextualized within the graph of activity/protocol.
imageUrl
toimage
(i believe i was told that imageUrl is not used anywhere else)
could we just say that image is ether str (or urlor theImageObjectfromschema`?
i left a comment about this that as far as i know jsonld doesn't/didn't allow multiple target types. also, i think we use imageURL
in some of our lab protocols and/or the library.
I'm still not completely happy about the langString.
would be a good one to discuss with linkml community. however, the whole point was to have the jsonld representation be compact, hence we didn't want the more complex form. once we build tools so that humans don't have to edit json, i'd be fine with the change. but adding boilerplate was exactly what we were trying to avoid.
linkml-schema/reproschema.yaml
Outdated
title: addProperties | ||
comments: | ||
- An array of objects to describe the various properties added to assessments | ||
and fields. |
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 see the comments in pydantic which will make it hard for people to use the code without referring to this document. i would suggest using description
instead of comments
throughout this schema.
linkml-schema/reproschema.yaml
Outdated
any_of: | ||
- range: Thing |
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.
simplify to range
when not targeting Union
.
linkml-schema/reproschema.yaml
Outdated
image: | ||
title: image | ||
comments: | ||
- An image of the item. This can be a <a class="localLink" href="http://schema.org/URL">URL</a> | ||
or a fully described <a class="localLink" href="http://schema.org/ImageObject">ImageObject</a>. | ||
slot_uri: schema:image | ||
range: uriorcurie |
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.
there is a difference between this and imageURL
in the current schema. image
targets an object (a node in a graph), and imageURL
targets a content url directly. since jsonld does not have (as far as i know) a way of representing multitargets, we created this separation.
as a result here it should at least be any_of
, if we are to simplify to just an image. for the moment perhaps we can also add imageURL
and not change the schema for this. i would like to minimize updating the library when we make this transition.
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.
so you would like to add imageURL
as a separate slot?
For the future, I understand you would like to have something like this?
image:
any_of:
- range: uriocurie
- range: ImageObject
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.
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.
so you would like to add imageURL as a separate slot?
yes
For the future, I understand you would like to have something like this?
yes
re: audio and video
audio
/video
/image
in schema.org are all similar in that they support multiple targets. however, audio
/video
don't have a URL
option while image
does. so for now i would file an issue if that is not handled in the current schema.
yes, happy to discuss it next week. For now we can still keep the current jsonld format, but the python function that reads the jsonld would have to be doing the transformation. |
… and adding @language:en to context; bringing back imageUrl; splitting UI class to multiple classes for UI for Activity, Field and Protocol
@satra, here are examples of n-triples from the examples, I think they look good, but please take a look:
|
and difference in the n-triples:
|
…contexts and shacl
it moved to #456 |
This is the linkml model with semi-automatically generated shacl, context and pydantic. I will generate a separate PR with full scripts on how to generate the formats, but just want to show the current state and discuss some issues that I still have.
After I understood the process more the additional changes to the context and shacl files after linkml generators are not as big:
SHACL:
sh:class
I have to either change tosh:datatype
orsh:node
sh:nodeKind sh:BlankNode
(not sure if all were causing problems but some did)I will try to talk about the issues next week during the hackathon
CONTEXT:
"@container": "@language"
in several places to be able to sue this shorter syntax forlangString
EXAMPLES:
There are tiny changes to the examples that are required to pass the shack validation with reproschema (i.e.
reproschema -l DEBUG validate --shapefile ...
):valueRequired
imageUrl
toimage
(i believe i was told thatimageUrl
is not used anywhere else)Issues that still have to be discussed:
I could not find a way to represent
ui
the same way as it was, I've decided for now to separate another classUI
, since this allow me to pass shacl validation. I've started conversation with the linkml community here: Add equivalent to pydantic AliasPaths or jsonld @nest to allow for nesting intermediate structures linkml/linkml#1846I'm still not completely happy about the
langString
. The shacl validation work after I added"@container": "@language"
to the context, but I'm not sure what should be the best approach for validation with pydantic. My first approach is to try to addtext
andlang
field toLangString
and to convert the format when reading from:to
[{"lang": "en", "text": "Little interest or pleasure in doing things"}, {"lang": "es", "text": "Poco interés o placer en hacer cosas"}]
Would this be ok?
image
with specifictype
? Could we just say thatimage
is ether str (or urlor the
ImageObjectfrom
schema`?