Exemple #1
0
 def get_special_nodes(id_: int) -> list[Entity]:
     domain_ids = [
         link_['domain_id']
         for link_ in Link.get_links_by_type(g.types[id_])
     ]
     range_ids = [
         link_['range_id'] for link_ in Link.get_links_by_type(g.types[id_])
     ]
     return get_entities_by_ids(range_ids + domain_ids)
Exemple #2
0
 def get_entities(parser: Dict[str, Any]) -> List[Entity]:
     entities = []
     if parser['entities']:
         entities.extend(get_entities_by_ids(parser['entities']))
     if parser['codes']:
         for code_ in parser['codes']:
             entities.extend(GetByCode.get_by_view(code_, parser))
     if parser['system_classes']:
         for system_class in parser['system_classes']:
             entities.extend(
                 GetBySystemClass.get_by_system(system_class, parser))
     if parser['classes']:
         for class_ in parser['classes']:
             entities.extend(GetByClass.get_by_class(class_, parser))
     return entities
Exemple #3
0
 def get(id_: int) -> Union[tuple[Resource, int], Response, dict[str, Any]]:
     entities = GetTypeEntitiesAll.get_node_all(id_)
     if not entities:
         entities = get_entities_by_ids(
             GetTypeEntitiesAll.get_special_node(id_, []))
     return resolve_entities(entities, entity_.parse_args(), id_)