File tree Expand file tree Collapse file tree
src/elimity_insights_client/api/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from typing import List
1+ from typing import List , Optional , Set
22
33from elimity_insights_client .api ._api import Config
44from elimity_insights_client .api ._api import query as api_query
1010from elimity_insights_client .api .entities ._query import query
1111
1212
13- def entities (config : Config , entity_type : EntityType ) -> List [Entity ]:
13+ def entities (
14+ config : Config ,
15+ entity_type : EntityType ,
16+ linked_source_ids : Optional [Set [int ]] = None ,
17+ ) -> List [Entity ]:
1418 """
1519 List all entities of the given entity type from the given source.
1620
17- The resulting entities also include all attribute assignments, and links for every other entity type of the given
18- source .
21+ The resulting entities also include all attribute assignments, and links for every other entity type
22+ of one of the given linked sources. If linked_source_ids is None, then all other existing sources are used .
1923 """
2024
2125 sos = sources (config )
22- schemas = {source .id : source .domain_graph_schema for source in sos }
26+ schemas = {
27+ source .id : source .domain_graph_schema
28+ for source in sos
29+ if linked_source_ids is None or source .id in linked_source_ids
30+ }
2331 que = query (entity_type , schemas )
2432 queries = [que ]
2533 (page ,) = api_query (config , queries )
You can’t perform that action at this time.
0 commit comments