-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/sennetconsortium/entity-api
- Loading branch information
Showing
9 changed files
with
202 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from lib.constraints.base import build_constraint, build_constraint_unit, build_search_constraint_unit | ||
from lib.ontology import Ontology | ||
|
||
|
||
# can be the descendant of / ---> | ||
def build_all_epicollection_constraints(entity): | ||
|
||
ancestor = build_constraint_unit(Ontology.ops().entities().DATASET) | ||
descendant = build_constraint_unit(entity) | ||
|
||
return [ | ||
build_constraint(ancestor, [descendant]) | ||
] | ||
|
||
def build_epicollection_search_constraints(entity): | ||
descendant = build_constraint_unit(entity) | ||
ancestor = build_search_constraint_unit('entity_type.keyword', Ontology.ops().entities().DATASET) | ||
|
||
return [ | ||
build_constraint([ancestor], [descendant]) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.