-
Notifications
You must be signed in to change notification settings - Fork 68
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
parse_yaml_predictions
doesn't correctly get predicate
#353
Comments
Hi @serenalotreck - that last PR doesn't actually add any support for n-ary relations, but you're right, it's still making a lot of assumptions about binary relations. Some objects with multiple attributes may not be relations, though, and the schemas intentionally don't require that level of modeling detail to be defined. If I have a We could just assume that everything is a triple, like in RDF, but that may defeat the purpose of LinkML, plus it's kind of messy.
This is a workaround. I will accept your changes in the linked PR then open another issue+PR to add the above solution, enabling other predicate parsing cases. There's a more elegant solution here in which the |
Fixes #353 -- not sure how universal this fix is, so would appreciate feedback! In particular, it seemed like the previous implementation assumed that the relation dictionaries would have the keys `"subject", "predicate", "object"`, which at least in the case of the schema I've been working with, isn't the case; the relation dictionary keys are entity types, and there's no entry for the predicate. For the moment, I just used the `rel_type` as the predicate in addition to the category; previously I had converted the lowercase&pluralized `rel_type` to the camelcase&singular relation type from the schema with a function that didn't use SchemaView; I assume using SchemaView is what I should do here, but for some reason, my SchemaView seems to be empty, even though my schema is properly formatted (at least, I assume it is since it works when I run `ontogpt extract`!). The `try/except` needs to be updated to catch n-ary relations -- just wanted to wait to do that until I was sure the initial changes were good. Thanks!
Awesome, thanks so much! |
Not sure how widespread this formatting is, or if it's something specific to my schema, but it seems like the support for n-ary relations introduced in #349 breaks support for binary relations, so wanted to ask about it.
The relations in my YAML output are formatted as dictionaries that only contain the subject and object, and I was previously pulling the predicate from the type of the relation -- e.g. for
gene_gene_interactions = [{'gene1': 'MAPK', 'gene2': 'SIPK'}]
, I would use the schema to convertgene_gene_interactions
toGeneGeneInteraction
and use that as the predicate.With the updated code, I get the following for all relations in my dataset, and the resulting relations df is emtpy:
Let me know if that's expected behavior!
The text was updated successfully, but these errors were encountered: