Replies: 5 comments 4 replies
-
Following up just to make sure: you grant it's a suited language, but do I interpret you correctly that you deem it a better choice [for representing a UML class model] than RDFS/OWL for the reasons I laid out? Furthermore: I'd be happy to contribute to the docs. I could try to make a pull request? |
Beta Was this translation helpful? Give feedback.
-
If someone could follow up on this I would still love more information. To clarify: I' want to understand what's happening when I define two attributes in different classes with the same name. Since both implicitly define a global slot with the same name, how does this work? I understand this slot will have both classes as applicable classes (I'm not sure I understand exactly what that means either), but how will this single global slot be applied in those two classes with different implementations (different descriptions for the slot, different cardinalities, etc.). Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @bartkl - I think @cmungall will always have better answers to your questions, but I will also try to add some info here as I just spent some time in SchemaView's Some helpful doc links to aid in our discussion here:
All that being said, here's a test that illustrates some of this (it builds on our runtime test schema, kitchen_sink.yaml, and there are a lot of existing tests that explore functionality already (but we need a bit more doc). The two slots(aka: attributes) that try to exercise your question in this branch are
Schema snippet:
Test output:
For a class like
Noting here also, that next month's community call will also have a presentation on semantic web + LinkML and the complexity of slot_uri's and class_uri's in addition to this test, might be a good one to bring up and explore further. |
Beta Was this translation helpful? Give feedback.
-
Wow, thanks for the elaborate explanation @sierra-moxon! First let me ask for some minor clarifications, and I will then present some thoughts of my own.
Got it. And if your schema is not monotonic, currently this can cause unexpected results in induction and schema generation? Or is the behavior well-defined, but possibly not desired or intuitive to people? Furthermore, your final example (with overriding the requiredness value in
So, if a slot exists already, and I create a class attribute with that slot's name, this is equivalent to using
I noticed this. I'm not sure what's best, but this touches on the complexity I wish to comment on down below.
That sounds great, as it will improve uniformity in approach and therefore consistency/predictability of the generators, correct? This encourages and makes easier acting against the derived model, which I think is the desired basis for generating schemas (with perhaps obscure exceptions). Let me know if I got that right :). So far my questions. Now I'd like to share a few thoughts. Honestly I worry a bit about the complexity involved here. The selling point of LinkML is its accessibility, but some of its semantics are honestly quite complex and hard to predict. Let me elaborate. First of all, many who are drawn to LinkML are developers and IT people who don't have a background in formal knowledge representation. The concept of a slot as a first-class citizen is alien to them, and they expect attributes to be owned by classes. Not only is this not the case, but by naming them "attributes" it is suggested. I myself am very familiar with RDF and OWL, and at first I also assumed attributes are bound to classes, whereas slots are not, i.e. I thought of attributes as locally scoped slots. If this were supported it's expressivity I would appreciate. It would also make certain generators easier/safer to implement (many schema languages have locally scoped attributes/slots). On top of all this, the experience of having to be vigilant about potential name clashes of attributes across different classes is quite tedious and uncomfortable. So it's unfamiliar and not explicit, but it's also quite complex. Attribute definitions either imply a new global slot definition, unless there's already one present, then it is a slot usage refinement. You can specify How I would move forward. I understand metamodel changes are impactful and hard, so I want to try and suggest as cautiously and constructively as I can. Some ideas and actual suggestions. Simplify attributes/slots/slot usageSimplify! Deprecate the For example: Beforeclasses:
Person:
slots:
- person_id
slot_usage:
person_id:
multivalued: true
attributes:
name:
range: string
slots:
person_id:
range: string AfterThis is way easier to write (less redundant and verbose), avoids the confusion with regards to what attributes are, and somewhat less complex also. It's clear everything is a slot explicitly. classes:
Person:
slots:
name:
range: string
person_id:
multivalued: true
slots:
person_id:
range: string Slot definitions only at the top-levelThis would not only remove Attributes as locally scoped slots or different things from slotsConnecting with the intuition of many users: re-introduce attributes to be locally scoped slots. As discussed this would improve familiarity and accessbility, as well as enhance the expressivity of the language. This would make This does probably have lots of impact, and this is by far the most complicated option of these suggested here. Again, these are quite radical and I'm sure there's many implications worth considering, but I'm just thinking out loud. Definitely not at the stage where I would recommend anything. I really do want to help see LinkML getting adopted more :) and I hope this gets a constructive dialogue started. |
Beta Was this translation helpful? Give feedback.
-
These are great thoughts and i share some of the confusion sometimes, appreciate the thread all y'all. An attribute with the same name as a slot defined in the same schema (or schema-cluster, as imports are unfortunately always flat at the moment) is different, and thus effectively locally defined, at least programmatically. I think they also should be in identity too, though i am not sure about that since the RDF/JSON-LD generators are mostly the holders of the notion of 'identity' in the linked data sense right? and i don't have close knowledge of those yet. there is sort of subtle behavior in induced slot that answers some of these questions i think. an induced slot is created in one of two ways (that are relevant here) induced_slot(slot_name: str, class_name: None): ...
induced_slot(slot_name: str, class_name: str): ... those names are not absolute URIs, but the local name within the schema.
first we check if
then, down below, if we did not find an the rest of the method propagates there is a missing piece of logic here and that is preserving the source of that slot in the case that it is modified by slot_usage, but not receiving its identity. URI is not one of the inheritable slots, but maybe a slot that is used by a class should have an to summarize - programmatically an attribute on a class is effectively private to that class, even if it shares a name with a slot. as far as identity in a linked data context goes, i think there should always be both identifiers, and they aren't in conflict to me:
@nlharris did a great job of explaining the current behavior w/ inheritance and declaration already so i'll skip that part. I wanted to add that i personally consider the possibility of getting an un-induced class through schemaview a bug - the to answer questions, then:
no, they are different :)
attributes are bound to classes, at least programmatically. though i am not sure about identity either in the RDF/etc. generators or in the metamodel. attributes are locally scoped slots programmatically.
i think these can coexist peacefully as described above - all identifiers exist, and their relationships should be annotated in the materialized model.
this does seem like a bug to me too - the same differentiation between slots and attributes from above should carry through. eg. if we have a lineage like |
Beta Was this translation helpful? Give feedback.
-
(Saving as a discussion as per @cmungall's request)
Bart wrote (in Slack):
Chris:
Beta Was this translation helpful? Give feedback.
All reactions