Conversation
… Knowledge collector
… status extraction
…ts and enhance SDG processing
…or FAO Open Knowledge collector
…ses for consistency
…s and metadata validation
…PDF extraction logic
…nces and enhance document processing
…ng and error handling
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates the FAO Open Knowledge data source into the system, enabling automated document discovery, validation, and ingestion from the FAO Open Knowledge repository.
Changes:
- Added comprehensive FAO Open Knowledge integration including data models, URL collector, and document collector plugin
- Implemented dataclass serialization utilities to properly handle structured metadata before database storage
- Added extensive unit tests covering various edge cases (embargoed, withdrawn, unauthorized documents, HTTP errors)
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| welearn_datastack/plugins/rest_requesters/fao_open_knowledge.py | New collector plugin that fetches and processes FAO Open Knowledge documents |
| welearn_datastack/data/source_models/fao_open_knowledge.py | Pydantic models for FAO Open Knowledge API responses |
| welearn_datastack/collectors/fao_open_knowledge_collector.py | URL collector for discovering FAO Open Knowledge documents |
| welearn_datastack/modules/computed_metadata.py | Added dataclass serialization utilities |
| welearn_datastack/nodes_workflow/DocumentHubCollector/document_collector.py | Integrated dataclass serialization into workflow |
| welearn_datastack/plugins/rest_requesters/init.py | Registered FAO collector plugin |
| welearn_datastack/nodes_workflow/URLCollectors/node_fao_open_knowledge_collect.py | Workflow node for FAO URL collection |
| tests/source_models/test_fao_open_knownledge.py | Tests for FAO data models |
| tests/document_collector_hub/plugins_test/test_fao_open_knowledge.py | Tests for FAO collector plugin |
| welearn_datastack/plugins/rest_requesters/open_alex.py | Removed blank line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
welearn_datastack/plugins/rest_requesters/fao_open_knowledge.py
Outdated
Show resolved
Hide resolved
welearn_datastack/plugins/rest_requesters/fao_open_knowledge.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
welearn_datastack/nodes_workflow/DocumentHubCollector/document_collector.py
Show resolved
Hide resolved
sandragjacinto
approved these changes
Feb 5, 2026
… Feature/FAO-open-knowledge
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive support for the FAO Open Knowledge data source, including new data models, a URL collector, and extensive unit tests. It also adds new utility functions for serializing dataclass instances and integrates this serialization into the document collection workflow. These changes improve the system's ability to ingest, validate, and process FAO Open Knowledge documents, while ensuring robust error handling and test coverage.
FAO Open Knowledge integration:
fao_open_knowledge.pyto represent FAO Open Knowledge items, bundles, bitstreams, and related metadata, enabling structured parsing and validation of API responses.FAOOpenKnowledgeURLCollectorinfao_open_knowledge_collector.pyto fetch and constructWeLearnDocumentobjects from the FAO Open Knowledge API, supporting automated document discovery and ingestion.Testing and validation:
Dataclass serialization utilities:
is_dataclass_instance,_inner_serialize_dataclass, andserialize_dataclass_instanceincomputed_metadata.pyto recursively serialize dataclass instances, improving compatibility with downstream processing and storage. [1] [2]Workflow integration:
document_collector.py, ensuring that all document details are properly serialized before database insertion. [1] [2] [3]