Skip to content
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

Merged
merged 12 commits into from
Jul 1, 2022
80 changes: 75 additions & 5 deletions TranslatorReasonerAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ components:
If there are multiple items, they must all be true (equivalent
to AND)
items:
$ref: '#/components/schemas/QueryConstraint'
$ref: '#/components/schemas/AttributeConstraint'
default: []
additionalProperties: true
QEdge:
Expand Down Expand Up @@ -632,14 +632,27 @@ components:
Corresponds to the map key identifier of the
object concept node anchoring the query filter
pattern for the query relationship edge.
constraints:
attribute_constraints:
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'
$ref: '#/components/schemas/AttributeConstraint'
default: []
qualifier_constraints:
type: array
description: >-
A list of QualifierConstraints that provide nuance to the QEdge.
If multiple QualifierConstraints are provided, there is an OR
relationship between them. If the QEdge has multiple
predicates or if the QNodes that correspond to the subject or
object of this QEdge have multiple categories or multiple
curies, then qualifier_constraints MUST NOT be specified
because these complex use cases are not supported at this time.
items:
$ref: '#/components/schemas/QualifierConstraint'
default: []
additionalProperties: true
required:
Expand Down Expand Up @@ -784,10 +797,67 @@ components:
items:
$ref: '#/components/schemas/Attribute'
nullable: true
qualifiers:
type: array
description: >-
A set of Qualifiers that act together to add nuance
or detail to the statement expressed in an Edge.
items:
$ref: '#/components/schemas/Qualifier'
nullable: true
additionalProperties: false
required:
- subject
- object
Qualifier:
additionalProperties: false
description: >-
An additional nuance attached to an assertion
type: object
properties:
qualifier_type_id:
type: string
description: >-
The category of the qualifier, drawn from a hierarchy of qualifier
slots in the Biolink model (e.g. subject_aspect, subject_direction,
object_aspect, object_direction, etc).
example: subject_aspect
nullable: false
qualifier_value:
type: string
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. 'expression' or 'abundance' for the
qualifier type 'subject_aspect', etc).
example: expression
nullable: false
required:
- qualifier_type_id
- qualifier_value
QualifierConstraint:
additionalProperties: false
description: >-
Defines a query constraint based on the
qualifier_types and qualifier_values of a set of
Qualifiers attached to an edge. For example, it 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 qualifier_value of "expression".
properties:
qualifier_set:
type: array
description: >-
A set of Qualifiers that serves to add nuance to a query,
by constraining allowed values held by Qualifiers
on queried Edges.
items:
$ref: '#/components/schemas/Qualifier'
nullable: false
required:
- qualifier_set
type: object
BiolinkEntity:
description: >-
Compact URI (CURIE) for a Biolink class, biolink:NamedThing
Expand Down Expand Up @@ -943,7 +1013,7 @@ components:
nullable: true
required:
- attribute_type_id
QueryConstraint:
AttributeConstraint:
type: object
description: >-
Generic query constraint for a query node or query edge
Expand Down