mex.backend.extracted package¶
Submodules¶
mex.backend.extracted.helpers module¶
- mex.backend.extracted.helpers.get_extracted_items_from_graph(stable_target_id: str | None = None, entity_type: list[str] | None = None, limit: int = 100) list[ExtractedAccessPlatform | ExtractedActivity | ExtractedBibliographicResource | ExtractedConsent | ExtractedContactPoint | ExtractedDistribution | ExtractedOrganization | ExtractedOrganizationalUnit | ExtractedPerson | ExtractedPrimarySource | ExtractedResource | ExtractedVariable | ExtractedVariableGroup] ¶
Get a list of extracted items for the given id and type.
- Parameters:
stable_target_id – Optional stable target ID filter
entity_type – Optional entity type filter
limit – How many items to return at most
- Raises:
InconsistentGraphError – When the graph response cannot be parsed
- Returns:
List of extracted items
- mex.backend.extracted.helpers.search_extracted_items_in_graph(query_string: str | None = None, stable_target_id: str | None = None, entity_type: list[str] | None = None, skip: int = 0, limit: int = 100) ExtractedItemSearch ¶
Search for extracted items in the graph.
- Parameters:
query_string – Full text search query term
stable_target_id – Optional stable target ID filter
entity_type – Optional entity type filter
skip – How many items to skip for pagination
limit – How many items to return at most
- Raises:
InconsistentGraphError – When the graph response cannot be parsed
- Returns:
ExtractedItemSearch instance
mex.backend.extracted.main module¶
- mex.backend.extracted.main.search_extracted_items(q: Annotated[str, Query(PydanticUndefined)] = '', stableTargetId: Identifier | None = None, entityType: Annotated[Sequence[ExtractedType], Query(PydanticUndefined)] = [], skip: Annotated[int, Query(PydanticUndefined)] = 0, limit: Annotated[int, Query(PydanticUndefined)] = 10) ExtractedItemSearch ¶
Search for extracted items by query text or by type and id.
mex.backend.extracted.models module¶
- class mex.backend.extracted.models.ExtractedItemSearch(*, items: list[Annotated[ExtractedAccessPlatform | ExtractedActivity | ExtractedBibliographicResource | ExtractedConsent | ExtractedContactPoint | ExtractedDistribution | ExtractedOrganization | ExtractedOrganizationalUnit | ExtractedPerson | ExtractedPrimarySource | ExtractedResource | ExtractedVariable | ExtractedVariableGroup, FieldInfo(annotation=NoneType, required=True, discriminator='entityType')]], total: int)¶
Bases:
BaseModel
Result of searching for extracted items in the graph.
- items: list[Annotated[ExtractedAccessPlatform | ExtractedActivity | ExtractedBibliographicResource | ExtractedConsent | ExtractedContactPoint | ExtractedDistribution | ExtractedOrganization | ExtractedOrganizationalUnit | ExtractedPerson | ExtractedPrimarySource | ExtractedResource | ExtractedVariable | ExtractedVariableGroup, FieldInfo(annotation=NoneType, required=True, discriminator='entityType')]]¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_max_length': 100000, 'str_min_length': 1, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'items': FieldInfo(annotation=list[Annotated[Union[ExtractedAccessPlatform, ExtractedActivity, ExtractedBibliographicResource, ExtractedConsent, ExtractedContactPoint, ExtractedDistribution, ExtractedOrganization, ExtractedOrganizationalUnit, ExtractedPerson, ExtractedPrimarySource, ExtractedResource, ExtractedVariable, ExtractedVariableGroup], FieldInfo(annotation=NoneType, required=True, discriminator='entityType')]], required=True), 'total': FieldInfo(annotation=int, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- total: int¶