Skip to content

Commit

Permalink
get total count of wikidata organizations
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-kamran-ali committed Jul 16, 2024
1 parent b4c1da3 commit 561e341
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions mex/backend/auxiliary/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
transform_seed_primary_sources_to_extracted_primary_sources,
)
from mex.common.types import TextLanguage
from mex.common.wikidata.extract import search_organizations_by_label
from mex.common.wikidata.extract import (
get_count_of_found_organizations_by_label,
search_organizations_by_label,
)
from mex.common.wikidata.transform import (
transform_wikidata_organizations_to_extracted_organizations,
)
Expand All @@ -37,6 +40,7 @@ def search_organization_in_wikidata(
Returns:
Paginated list of ExtractedOrganization
"""
total_orgs = get_count_of_found_organizations_by_label(q, lang)
organizations = search_organizations_by_label(q, offset, limit, lang)

extracted_organizations = list(
Expand All @@ -46,7 +50,7 @@ def search_organization_in_wikidata(
)

return PagedResponseSchema(
total=len(extracted_organizations),
total=total_orgs,
offset=offset,
limit=limit,
results=[organization for organization in extracted_organizations],
Expand Down
16 changes: 8 additions & 8 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires-python = "<3.13,>=3.11"
dependencies = [
"fastapi==0.111.0",
"httpx==0.27.0",
"mex-common@git+https://github.com/robert-koch-institut/mex-common.git@0.28.0",
"mex-common@git+https://github.com/robert-koch-institut/mex-common.git@0.30.0",
"neo4j==5.21.0",
"pydantic==2.7.4",
"uvicorn[standard]==0.30.1",
Expand Down

0 comments on commit 561e341

Please sign in to comment.