-
Notifications
You must be signed in to change notification settings - Fork 73
fix: add missing enum connectors to resolve ModuleNotFoundError #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,88 @@ | ||||||
| """ | ||||||
| Enum connectors for populating taxonomy and enumeration data in the AIOD database. | ||||||
|
|
||||||
| This module provides connectors for various enumeration types used throughout | ||||||
| the AIOD platform, such as application areas, resource types, event modes, etc. | ||||||
| """ | ||||||
|
|
||||||
| import pathlib | ||||||
| from typing import Type, TypeVar | ||||||
|
|
||||||
| from connectors.example.example_connector import ExampleConnector | ||||||
| from database.model.named_relation import NamedRelation | ||||||
|
|
||||||
| T = TypeVar('T', bound=NamedRelation) | ||||||
|
|
||||||
| ENUM_RESOURCE_PATH = pathlib.Path(__file__).parent / "resources" / "enum" | ||||||
|
|
||||||
|
|
||||||
| class BaseEnumConnector(ExampleConnector[T]): | ||||||
| """Base class for enum connectors that load enumeration data from JSON files.""" | ||||||
|
|
||||||
| def __init__(self, enum_filename: str, enum_class: Type[T]): | ||||||
| json_path = ENUM_RESOURCE_PATH / f"{enum_filename}.json" | ||||||
| super().__init__(json_path, enum_class) | ||||||
|
|
||||||
|
|
||||||
| class EnumConnectorApplicationArea(BaseEnumConnector): | ||||||
| """Connector for application area enumeration data.""" | ||||||
|
|
||||||
| def __init__(self): | ||||||
| from database.model.concept.application_area import ApplicationArea | ||||||
|
||||||
| from database.model.concept.application_area import ApplicationArea | |
| from database.model.ai_resource.application_area import ApplicationArea |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.educational_resource_type does not exist, so this connector cannot be constructed. Import EducationalResourceType from database.model.educational_resource.educational_resource_type.
| from database.model.concept.educational_resource_type import EducationalResourceType | |
| from database.model.educational_resource.educational_resource_type import EducationalResourceType |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.event_mode does not exist. EventMode is defined via create_taxonomy in database.model.event.event, so this import will fail at runtime.
| from database.model.concept.event_mode import EventMode | |
| from database.model.event.event import EventMode |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.event_status does not exist. EventStatus is defined in database.model.event.event, so this import will fail when the connector is used.
| from database.model.concept.event_status import EventStatus | |
| from database.model.event.event import EventStatus |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.language does not exist. Language is defined in database.model.agent.language (via create_taxonomy), so this import will fail.
| from database.model.concept.language import Language | |
| from database.model.agent.language import Language |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.license does not exist. License is defined in database.model.ai_asset.license, so this import will fail when running the fill script.
| from database.model.concept.license import License | |
| from database.model.ai_asset.license import License |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.organisation_type does not exist. OrganisationType is defined in database.model.agent.organisation (via create_taxonomy), so this import will fail.
| from database.model.concept.organisation_type import OrganisationType | |
| from database.model.agent.organisation import OrganisationType |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database.model.concept.news_category does not exist. NewsCategory is defined in database.model.news.news_category (via create_taxonomy), so this import will fail.
| from database.model.concept.news_category import NewsCategory | |
| from database.model.news.news_category import NewsCategory |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [ | ||
| { | ||
| "name": "machine learning", | ||
| "definition": "Applications involving machine learning algorithms and techniques", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "natural language processing", | ||
| "definition": "Applications focused on processing and understanding human language", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "computer vision", | ||
| "definition": "Applications involving image and video analysis", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "robotics", | ||
| "definition": "Applications in robotics and autonomous systems", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [ | ||
| { | ||
| "name": "course", | ||
| "definition": "A structured educational program or series of lessons", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "tutorial", | ||
| "definition": "Step-by-step instructional content", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "documentation", | ||
| "definition": "Technical documentation and guides", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "video", | ||
| "definition": "Video-based educational content", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [ | ||
| { | ||
| "name": "online", | ||
| "definition": "Virtual events conducted over the internet", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "offline", | ||
| "definition": "In-person events at physical locations", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "hybrid", | ||
| "definition": "Events combining both online and offline participation", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [ | ||
| { | ||
| "name": "upcoming", | ||
| "definition": "Events scheduled for the future", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "ongoing", | ||
| "definition": "Events currently taking place", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "completed", | ||
| "definition": "Events that have finished", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "cancelled", | ||
| "definition": "Events that have been cancelled", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [ | ||
| { | ||
| "name": "english", | ||
| "definition": "English language", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "german", | ||
| "definition": "German language", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "french", | ||
| "definition": "French language", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "spanish", | ||
| "definition": "Spanish language", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "italian", | ||
| "definition": "Italian language", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [ | ||
| { | ||
| "name": "mit", | ||
| "definition": "MIT License - permissive open source license", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "apache-2.0", | ||
| "definition": "Apache License 2.0 - permissive open source license", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "gpl-3.0", | ||
| "definition": "GNU General Public License v3.0 - copyleft license", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "bsd-3-clause", | ||
| "definition": "BSD 3-Clause License - permissive open source license", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "cc-by-4.0", | ||
| "definition": "Creative Commons Attribution 4.0 International", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [ | ||
| { | ||
| "name": "research", | ||
| "definition": "News related to research developments and findings", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "technology", | ||
| "definition": "Technology-related news and updates", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "events", | ||
| "definition": "Announcements and coverage of events", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "funding", | ||
| "definition": "News about funding opportunities and grants", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "partnerships", | ||
| "definition": "News about collaborations and partnerships", | ||
| "official": true | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [ | ||
| { | ||
| "name": "university", | ||
| "definition": "Academic institution providing higher education", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "research institute", | ||
| "definition": "Organization focused on research activities", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "company", | ||
| "definition": "Commercial business organization", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "non-profit", | ||
| "definition": "Non-profit organization", | ||
| "official": true | ||
| }, | ||
| { | ||
| "name": "government", | ||
| "definition": "Government agency or department", | ||
| "official": true | ||
| } | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New enum connectors and their JSON resources are not covered by tests. Since
src/tests/connectors/example/test_example_connector.pyalready exercises example connectors, add similar pytest coverage for eachEnumConnector*to ensure the modules import correctly andfetch()can parse the new JSON files.