-
Notifications
You must be signed in to change notification settings - Fork 28
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
A more complete Qualifiers implementation #330
Conversation
TranslatorReasonerAPI.yaml
Outdated
type: array | ||
description: >- | ||
A list of contraints applied to a query edge. | ||
A list of attribute contraints applied to a query edge. | ||
If there are multiple items, they must all be true (equivalent | ||
to AND) | ||
items: | ||
$ref: '#/components/schemas/QueryConstraint' |
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.
Now that we have the ability to constrain queries based on values of Attributes and Qualifiers, consider renaming the QueryConstraint object 'AttributeConstraint' or 'AttributeQueryConstraint'? And then name the object that defines a constraint based on a Qualifier value a 'QualifierConstraint' or 'QualifierQueryConstraint'. (This object is currently named 'QualifierSet' in this PR). This would make naming more clear and consistent.
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 we can use AttributeConstraint
and QualifierConstraint
to distinguish the two kinds of constrains.
TranslatorReasonerAPI.yaml
Outdated
predicate it is qualifying via the | ||
QualiferSet.qualified_predicate property. | ||
items: | ||
$ref: '#/components/schemas/QualifierSet' |
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.
As noted above, consider renaming 'QualifierSet' --> 'QualifierConstraint' or 'QualifierQueryConstraint', to be more clear and consistent with the name of the object that holds a constraint definition based on Attribute 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 was initially skeptical, but now agree that 'QualifierSet' --> 'QualifierConstraint' may perhaps be a little better.
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.
After pondering further, I'm convinced that QualifierConstraint is better. I have updated the PR.
TranslatorReasonerAPI.yaml
Outdated
description: >- | ||
The value associated with the type of the qualifier, drawn from | ||
a set of controlled values by the type as specified in | ||
the Biolink model (e.g. 'decreased' or 'increased' for the type |
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.
Consider making the example here consistent with the example of a qualifier_type_id above (where you used 'subject_aspect'). So here, say "(e.g. 'expression' or 'abundance' for the qualifier type 'subject_aspect', etc)." And then change the example below from 'decreased' to 'expression'.
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.
good idea, fixed.
TranslatorReasonerAPI.yaml
Outdated
example: decreased | ||
nullable: false | ||
required: | ||
- type |
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.
Should the required 'type' property here read 'qualifier_type_id'?
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, definitely, fixed, thanks.
TranslatorReasonerAPI.yaml
Outdated
QualifierSet: | ||
additionalProperties: false | ||
description: >- | ||
A set of Qualifiers that act together to add nuance to an assertion. |
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 definition here seems too general - is this because the notion of a QualifierSet is menat to be used elsewhere, for purposes other than constraining a query?
If not, consider the proposed renaming/reframing of this object, and updating definition to something like:
"Defines a query constraint based on the type and value of a Qualifier attached to an edge. e.g. can constrain a "ChemicalX - affects - ?Gene" query to return only edges where ChemicalX specifically affects the 'expression' of the Gene, by constraining on the qualifier_type "object_aspect" with a value of "expression".
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.
Qualifier is used both for QEdges and Edges. So it used both for querying and for conveying assertions. That is why the definition is slanted more toward the assertion side. In the context of queries, it specifies the constraints on the desired assertions. So okay as is?
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.
True that 'Qualifier' object is used in asserting knowledge and querying for it. But the definition here is for a 'QualifierSet' object, which we agreed above to rename 'QualifierConstraint' (because its express purpose is to allow constraining queries based on the values of Qualifiers on an edge).
So given that we are now defining a 'QualifierConstraint' object, it makes sense to me to update the definition so that it clearly conveys this purpose of this object in constraining queries.
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 now. Yes, agreed. Updated with minor edits. See if the committed version seems agreeable.
TranslatorReasonerAPI.yaml
Outdated
items: | ||
$ref: '#/components/schemas/Qualifier' | ||
nullable: false | ||
qualified_predicate: |
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.
'qualified_predicate' is the name of an edge property defined in Biolink. It may be confusing to have a TRAPI property with the same name. Consider the name 'constrained_predicate'?
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 am neutral, but fine to change if it seems less conflicting with Biolink.
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 better now and after pondering further, I'm convinced that constrained_predicate is better. I have updated the PR.
TranslatorReasonerAPI.yaml
Outdated
description: >- | ||
A set of Qualifiers that act together to add nuance to an assertion. | ||
properties: | ||
qualifiers: |
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.
If we rename QualifierSet --> QualifierConstraint, I would consider renaming this field from 'qualifiers' --> 'qualifier_set'. 'qualifiers' is fine, but I feel like 'qualifier_set' indicates more clearly that the qualifiers in this array are to be considered together in constraining the query.
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 was initially skeptical, but now agree that 'qualifier_set' may perhaps be a little better.
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.
After pondering further, I'm convinced that qualifier_set is better. I have updated the PR.
TranslatorReasonerAPI.yaml
Outdated
description: >- | ||
The predicate that is to be qualified in cases where there | ||
are multiple predicates in a query and there thus might be | ||
ambiguity. |
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.
In this initial draft of an object to support Qualifier-based query constraints, I would also include a boolean 'not' property, as exists for the QueryConstraint object used for Attribute-based constraints . Key for the basic functionality of excluding specific qualifiers from a result.
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.
hmm, I think this needs more discussion. I view "not" and "exclude" as two very different things. In my view, "not" should be used as:
- Which drugs do not treat disease X? (e.g. clinical trials were run and the the result was that the drug does not treat X)
while "exclude" has a different functionality:
- Which drugs are related to disease X, excluding those that are contraindicated for disease X
This exclude flag was proposed to be a direct QEdge property. although no consensus was reached and it remains ARAX-only functionality
The "not" property was also deferred until such a time as we would carefully think through and document how this would be implemented (regarding inheritance and inference, etc.)
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 I think we should avoid this unless we have more discussion.
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 suggestion was motivated by an example query Valdo provided that asks "What compounds increase the activity or phosphorylation of PPARA but not its abundance". But as you point out, negation/exclusion are tricky and perhaps it is best to leave this out for now, until we look into it more closely.
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.
okay, let's leave it out for now
- update value to qualifier_value - Correct the names of the required fields - update the qualifier_value example and description to be consistent with the qualifier_type_id
So this is where I see the current PR: and this is what @mbrush is suggesting: I am fine with these changes except for the "not". That might need some more discussion. |
I drafted some example qualifier-based Associations in the document here - and included a few queries illustrating the qualifier constraint proposal above (with modifications I suggested). These queries are at the end of the document - and I think align well with the bottom part of Eric's diagram. |
okay, everyone, after updating the PR based on @mbrush excellent comments, we now have this structure in the PR: Please everyone examine carefully and review. This is our release candidate for qualifier support in TRAPI. |
The proposal looks pretty good to me. I might consider minor tweaks to two property names and definitions (but not a big deal if we keep things as they are):
I understand that the current proposal is motivated to use the same property name ( |
Thanks for the review. I think your definition adjustments all seem sensible and I will make those unless there are objections. But I would like to discuss the property name a bit further:
It is true that you requested in the previous round to change QualifierConstraint.qualifiers to QualifierConstraint.qualifier_set, and then I went ahead and also changed Edge.qualifiers to Edge.qualifier_set even though you didn't suggest it. I did that for what I perceived as consistency. So I am surprised that you would have us change it back for consistency. It seems to make more sense to me to keep both QualifierConstraint.qualifier_set and Edge.qualifier_set consistent since they are essentially the same thing. rather than aim for consistency between Edge.attributes and Edge.qualifier[_set|s]. I thought calling it qualifier_set rather made a lot of sense because the Qualifiers within a set really do work together closely. Whereas the attributes are mostly a pile of independent things (some are provenance, some are inherent properties, some are assigned attributes, etc.) So I rather like qualifier_set. But I'm happy to be outvoted. How about all readers that made it this far put in their votes?
|
I am fine with either name for the Edge property. I don't feel like we need to use the same property name in the Edge and QualifierConstraint objects, since the referenced/nested Qualifier objects are serving different purposes in these different objects/contexts. I have a slight preference for |
@mbrush Yes, I think they're great. I was leaving a little time for others to chime in, but hearing none, the latest commit to the PR now uses your definitions. Seem good? |
@edeutsch looks good to me! Still slight preference for the name Edge.qualifiers over Edge.qualifier_set . . . but if Hearts vs Rockets vote above remains 1-1 we can keep it as is. Thanks for your work on this! |
Removed constrained_predicate for now. It may come back in TRAPI 1.4 with more thought: ``` constrained_predicate: $ref: '#/components/schemas/BiolinkPredicate' description: >- The predicate that is to be qualified in cases where there are multiple predicates in a query and there thus might be ambiguity. nullable: true ```
okay, based on today's TRAPI call and follow-up with @mbrush, I have made the following changes to the PR: Removed constrained_predicate Rename Edge.qualifier_set to Edge.qualifiers Did I do this correctly? |
TranslatorReasonerAPI.yaml
Outdated
$ref: '#/components/schemas/Qualifier' | ||
nullable: false | ||
required: | ||
- qualifiers |
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.
@edeutsch , shouldn't required
field in QualifierConstraint
contain qualifier_set
instead of qualifiers
?
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, absolutely, good catch! Fixed in PR with f4bcfc5
thanks!
No description provided.