-
Notifications
You must be signed in to change notification settings - Fork 24
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
Breaking change: correcting the definition of subject_type
and object_type
#323
Comments
As per this , I'm guessing |
My guess is something like:
But then it'll be considered as a string rather than a |
Right @hrshdhgd - after looking at the code, I don't think rdfgen will automatically expand those strings to URIs. Is that ok? There is a bit of code in owlgen that we probably want to add to rdfgen. |
We would want it to be URIs. may be useful, Nico? |
Thank you both for your support. Before we look into solutions for the problem, I would like to understand what the design intention is here on the LinkML side. The question is simply: can an instance of an enum (a value) be an entity reference ( So if I have
or
Can the enum that restricts
|
I think so yeah; it's just that not all generators are feature-complete. The OWL generator code that I and Harshad linked is the implementation that I think we need to add to rdfgen (you are using rdfgen in SSSOM right?) |
Thank you. It is good to hear that it is not a conceptual issue. So forgetting about RDF for now - can I somehow specify the base type of the enum? Stating that it is an instance of say, uri or curie or is this currently not possible in the spec? |
No, we can't specify the range of a permissible value at this point, but I like the idea. "meaning" range is restricted to a uriorcurie however, so we can assume that the meaning can be translated in a constrained kind of way based on the serialization. |
@gouttegd can you articulate your position on this? You prefer "owl class" as the rendering of the a lot value in TSV and JSON? |
@matentzn It’s not a matter of what I prefer. First, I think such a breaking change at this stage, so close to 1.0, would be harmful, for little to no benefit, especially since what you seem to want should be achievable without the need for a breaking change (more on that latter). Consider that it has already been more than one year since I don’t know why you prefer
over
but it is almost certain the second form is going to still be present in the wild for the years to come. So I’d recommend not changing the enum now. What seems to really bother you is that you would like the enum value to be rendered as an IRI when serialising to RDF, am I correct? Well then, just amend the spec to state that, when serialising to RDF, a value of type Arguably this could even be specified once and for all at the LinkML level, not only for SSSOM and not only for This would seem to me like a perfectly reasonable behaviour, and actually the behaviour that I would expect – because otherwise I quite don’t see the point of the But my real concern is with this:
Please don’t. An enum value is of the type of that particular enum, nothing more, nothing less. Each language has its own way of representing enumerations – in particular, in many languages, they are integers. Specifying straight in the data model that enum values should be of a certain type is only going to make supporting SSSOM in non-Python languages even more complicated. Basically the point I am trying to make is: let enum values be opaque values and if you want some of them to be serialised in a certain way, enforce that at the level of the parser/serialiser, not at the level of the data model. |
@gouttegd is correct. And in fact the current behavior for rdf serialization is to use the meaning URI if present. json and python use the text. This needs to be clarified in the docs: https://linkml.io/linkml/schemas/enums.html#mapping-permissible-values-to-ontologies |
We discussed this on the linkml. We weren't totally clear if this pertained to schema or data. Note rdfgen, which was mentioned (and all the Either way: |
Ok. Let's leave things as they are then. I have slept a few nights now on the matter, and am fine with not making a change. I guess I will see what that means for the Json serialisation, because I long forgot checking if it is based on JSON-LD (which means I would expect it roundtrips with RDF) or some other standard representation. |
Currently the
subject_type
andobject_type
fields are defined using an enum.When I added this, I intended to be able to use this enum like this:
Now I learn, that, according to the LinkML model, this is how it would look like on data level:
I still need to find our how to define an enum that takes exactly owl:Class, owl:ObjectProperty, owl:AnnotationProperty as values, but in a way that it is understood that these are curies?
So when I translate say this dataset:
into RDF, that I get:
Help @sierra-moxon @hrshdhgd
The text was updated successfully, but these errors were encountered: