-
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
Add QualifierConstraint.qualified_predicate property #368
Comments
In our documentation, we need to make it clear that AND logic applies between elements within a single QualifierConstraint object – i.e. all components in the constraint must match an edge for it to be returned. OR logic applies across distinct QualifierConstraint objects - i.e. Edges in the data that match the patterns specified in any one QualifierConstraint object should be returned. For example, if you want to return edges that assert some chemical that causes increased activity or expression of your gene of interest, your query would contain two QualifierConstraint objects – one that defines the 'causes' 'increased' 'activity' constraint, and one that defines the 'causes' 'increased' 'expression' constraint. Edges that matched the patterns defined in either of these constraint objects would be returned. Below is a TRAPI query example illustrating this more concretely - and demonstrates use of the proposed We would use the following json to query for 'Chemicals that increase activity or expression of the PPARA gene':
This query would return any Edges that state a ChemicalSubstance causes increased activity of PPARA, or increased expression of PPARA. e.g.:
@sierra-moxon @edeutsch please review proposal. Happy to create a PR if that helps. |
sure, agreed, note that we already do state that if there are multiple qualifier_constraints, there is a an OR relationship: ReasonerAPI/TranslatorReasonerAPI.yaml Lines 688 to 689 in 7520ac5
But feel free to make a PR to amplify this. It is true that we don't very explicitly declare that the items in a qualifier_set have an AND relationship (although I assumed by calling them a "set", this was obvious): ReasonerAPI/TranslatorReasonerAPI.yaml Lines 892 to 894 in 7520ac5
But feel free to make a PR to amplify this. |
While the above is easy to shoo into TRAPI 1.3 because it is just a clarification that was already intended, your other proposal to pull qualified_predicate out of the qualifier_set is far more disruptive to the late-stage of TRAPI 1.3. Do you intend this for TRAPI 1.4? Should we create a branch for 1.4 so that we can start creating PRs against that? Or are you keen to see this be put in 1.3 before release? |
Hi Eric. Re: the proposed enhancements to types / properties - IMO these will help clarify some of the observed and anticipated confusion regarding use of qualifier constraints in queries. Even if all some of the suggestions do is amplify / repeat key info in different places in the spec. I'll draft a PR for these simpler changes and let you/others decide if you want to accept, and massage text as needed. Re: splitting our the qualified_predicate into its own property (instead of permitting this to be included in a QualifierConstraint.qualifier_set) - I do think this will make the overall paradigm of qualifiers and qualifier-based querying more clear and consistent for users. But as you point out - we can already support constraint on a qualified_predicate by including it in the qualifier_set (even though technically it is not a qualifier). I'll leave it up to you as to when to consider implementing this change. If too late to get into 1.3, we can wait to 1.4. I think we also need to consider if/how we will support for specifying a primary predicate that goes with a qualifier set (for cases where a TRAPI query includes >1 primary predicates) . . . so it may make sense to do these things at the same time in 1.4. @sierra-moxon your thoughts on this? |
Outcomes from 8-25-22 TRAPI Call:
|
On a recent TRAPI call, we discussed the requirement to allow specification of the qualified predicate that pairs with a set of qualifiers used to constrain a query, so the query itself is clear and complete. This came up in the context of the example query Sierra presented here - where a constraint on the qualified predicate had to be captured in a Qualifier object (even though qualified predicates are not themselves considered to be Qualifiers).
To better accommodate this requirement, we propose adding a new property to the
QualifierConstraint
object calledqualified_predicate
with cardinality 0..1, that would sit alongside the existingqualifier_set
property.QualifierConstraint.qualified_predicate
: the qualified predicate that pairs with the qualifiers specified in a qualifier set. As part of a QueryConstraint, this qualified predicate must be present with the constrained qualifiers in order for a given Edge to be returned. This property is not required in a QualifierConstraint object however, as not all qualified Edges in knowledge graphs include a qualified predicate.We also propose the following updates to descriptions of existing objects and properties, which we feel provide additional clarification.
Qedge.qualifier_constraints
: a list of QualifierConstraints that constrain a query to match specified patterns of qualifiers that must be present on an Edge.QualifierConstraint
: Defines a query constraint based on the types and values of qualifiers in an Edge. This constraint may optionally include the qualified predicate that pairs with these qualifiers to provide a precise reading of the full statement expressed in the Edge. For example, we us this to constrain a "ChemicalX - affects - ?Gene" query to return only edges where ChemicalX specifically 'increases' the 'expression' of the Gene, by requiring the Edge to have anobject_aspect_qualifier
with the value "expression", anobject_direction_qualifier
with the value "increased", and aqualified_predicate
with the value "causes".QualifierConstraint.qualifier_set
: a set of one or more Qualifiers that are found in a single Edge. As part of a QueryConstraint, this set of qualifiers must be found together on a given Edge in order for that Edge to be returned.QualifierConstraint.qualified_predicate
: the qualified predicate that pairs with the qualifiers specified in a qualifier set. As part of a QueryConstraint, this qualified predicate must be present with the specified qualifiers in a given Edge in order for it to be returned. This property is not required in a QualifierConstraint however, as not all Edges in a knowledge graph that contain qualifiers include a qualified predicate.The text was updated successfully, but these errors were encountered: