Projektziel
+{{ euProject.objective }}
+diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py
index 98aaf28c..028d5eb7 100644
--- a/service/src/main/inse/model.py
+++ b/service/src/main/inse/model.py
@@ -55,10 +55,44 @@ class ESIndex(StrEnum):
OPENALEX_AUTHORS = "openalex-authors"
OPENALEX_INSTITUTIONS = "openalex-institutions"
OPENALEX_PUBLICATIONS = "openalex-publications"
-
- CORDIS_EU_ORGANIZATIONS_WILDCARD = "cordis_eu_*_organizations"
- CORDIS_EU_PROJECTS_WILDCARD = "cordis_eu_*_projects"
- CORDIS_EU_PUBLICATIONS_WILDCARD = "cordis_eu_*_publications"
+
+ EPO_INDEX = "epo_index_1.0"
+ USPTO_INDEX = "uspto_patents_3.0"
PROJECTS_BUND_V1 = "projects_bund_v1"
- PROJECTS_DFG_ALL = "projects_dfg_all"
\ No newline at end of file
+ PROJECTS_DFG_ALL = "projects_dfg_all"
+
+ CORDIS_EU_ORGANIZATIONS_WILDCARD = "cordis_eu_*_organizations"
+ CORDIS_EU_PROJECTS_WILDCARD = "cordis_eu_*_projects"
+ CORDIS_EU_PUBLICATIONS_WILDCARD = "cordis_eu_*_publications"
+ CORDIS_EU_FP7_OGANIZATIONS = "cordis_eu_fp7_organizations"
+ # FP7
+ CORDIS_EU_FP7_ORGANIZATIONS = "cordis_eu_fp7_organizations"
+ CORDIS_EU_FP7_PUBLICATIONS = "cordis_eu_fp7_publications"
+ CORDIS_EU_FP7_PROJECT_IPRS = "cordis_eu_fp7_project_iprs"
+ CORDIS_EU_FP7_REPORT_SUMMARIES = "cordis_eu_fp7_report_summaries"
+ CORDIS_EU_FP7_TOPICS = "cordis_eu_fp7_topics"
+ CORDIS_EU_FP7_WEB_LINKS = "cordis_eu_fp7_web_links"
+ CORDIS_EU_FP7_EUROSCIVOC = "cordis_eu_fp7_euroscivoc"
+ CORDIS_EU_FP7_LEGAL_BASIS = "cordis_eu_fp7_legal_basis"
+
+ # Horizon 2020
+ CORDIS_EU_HORIZON_2020_ORGANIZATIONS = "cordis_eu_horizon_2020_organizations"
+ CORDIS_EU_HORIZON_2020_PUBLICATIONS = "cordis_eu_horizon_2020_publications"
+ CORDIS_EU_HORIZON_2020_DELIVERABLES = "cordis_eu_horizon_2020_deliverables"
+ CORDIS_EU_HORIZON_2020_REPORT_SUMMARIES = "cordis_eu_horizon_2020_report_summaries"
+ CORDIS_EU_HORIZON_2020_TOPICS = "cordis_eu_horizon_2020_topics"
+ CORDIS_EU_HORIZON_2020_WEB_LINKS = "cordis_eu_horizon_2020_web_links"
+ CORDIS_EU_HORIZON_2020_EUROSCIVOC = "cordis_eu_horizon_2020_euroscivoc"
+ CORDIS_EU_HORIZON_2020_LEGAL_BASIS = "cordis_eu_horizon_2020_legal_basis"
+ CORDIS_EU_HORIZON_2020_ERC_PIS = "cordis_eu_horizon_2020_erc_pis"
+
+ # Horizon Europe
+ CORDIS_EU_HORIZON_EUROPE_ORGANIZATIONS = "cordis_eu_horizon_europe_organizations"
+ CORDIS_EU_HORIZON_EUROPE_PUBLICATIONS = "cordis_eu_horizon_europe_publications"
+ CORDIS_EU_HORIZON_EUROPE_DELIVERABLES = "cordis_eu_horizon_europe_deliverables"
+ CORDIS_EU_HORIZON_EUROPE_REPORT_SUMMARIES = "cordis_eu_horizon_europe_report_summaries"
+ CORDIS_EU_HORIZON_EUROPE_TOPICS = "cordis_eu_horizon_europe_topics"
+ CORDIS_EU_HORIZON_EUROPE_WEB_LINKS = "cordis_eu_horizon_europe_web_links"
+ CORDIS_EU_HORIZON_EUROPE_EUROSCIVOC = "cordis_eu_horizon_europe_euroscivoc"
+ CORDIS_EU_HORIZON_EUROPE_LEGAL_BASIS = "cordis_eu_horizon_europe_legal_basis"
\ No newline at end of file
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py
new file mode 100644
index 00000000..27e2cec2
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7EurosciVoc(BaseModel):
+ """
+ Fp7EurosciVoc
+ """ # noqa: E501
+ code: Optional[StrictStr] = None
+ description: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ path: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7EurosciVoc from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7EurosciVoc from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "code": obj.get("code"),
+ "description": obj.get("description"),
+ "id": obj.get("id"),
+ "path": obj.get("path"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py
new file mode 100644
index 00000000..b4868f44
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7LegalBasis(BaseModel):
+ """
+ Fp7LegalBasis
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart")
+ __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7LegalBasis from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7LegalBasis from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "legalBasis": obj.get("legalBasis"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "uniqueProgrammePart": obj.get("uniqueProgrammePart")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py
new file mode 100644
index 00000000..07814631
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py
@@ -0,0 +1,139 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7Organization(BaseModel):
+ """
+ Fp7Organization
+ """ # noqa: E501
+ sme: Optional[StrictBool] = Field(default=None, alias="SME")
+ active: Optional[StrictBool] = None
+ activity_type: Optional[StrictStr] = Field(default=None, alias="activityType")
+ city: Optional[StrictStr] = None
+ contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm")
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ country: Optional[StrictStr] = None
+ ec_contribution: Optional[StrictFloat] = Field(default=None, alias="ecContribution")
+ end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation")
+ geolocation: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ name: Optional[StrictStr] = None
+ net_ec_contribution: Optional[StrictFloat] = Field(default=None, alias="netEcContribution")
+ nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode")
+ order: Optional[StrictInt] = None
+ organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
+ organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL")
+ post_code: Optional[StrictStr] = Field(default=None, alias="postCode")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ role: Optional[StrictStr] = None
+ short_name: Optional[StrictStr] = Field(default=None, alias="shortName")
+ street: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber")
+ __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7Organization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7Organization from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "SME": obj.get("SME"),
+ "active": obj.get("active"),
+ "activityType": obj.get("activityType"),
+ "city": obj.get("city"),
+ "contactForm": obj.get("contactForm"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "country": obj.get("country"),
+ "ecContribution": obj.get("ecContribution"),
+ "endOfParticipation": obj.get("endOfParticipation"),
+ "geolocation": obj.get("geolocation"),
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "netEcContribution": obj.get("netEcContribution"),
+ "nutsCode": obj.get("nutsCode"),
+ "order": obj.get("order"),
+ "organisationID": obj.get("organisationID"),
+ "organizationURL": obj.get("organizationURL"),
+ "postCode": obj.get("postCode"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "role": obj.get("role"),
+ "shortName": obj.get("shortName"),
+ "street": obj.get("street"),
+ "totalCost": obj.get("totalCost"),
+ "vatNumber": obj.get("vatNumber")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py
new file mode 100644
index 00000000..ca53bf13
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py
@@ -0,0 +1,131 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7Project(BaseModel):
+ """
+ Fp7Project
+ """ # noqa: E501
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7Project from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7Project from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py
new file mode 100644
index 00000000..0f3864f2
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py
@@ -0,0 +1,214 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API - Extended Models
+""" # noqa: E501
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+# Import all the base models
+from inse.models.projects_eu_cordis.fp7.fp7_project import Fp7Project
+from inse.models.projects_eu_cordis.fp7.fp7_organization import Fp7Organization
+from inse.models.projects_eu_cordis.fp7.fp7_publication import Fp7Publication
+from inse.models.projects_eu_cordis.fp7.fp7_project_ipr import Fp7ProjectIPR
+from inse.models.projects_eu_cordis.fp7.fp7_report_summary import Fp7ReportSummary
+from inse.models.projects_eu_cordis.fp7.fp7_topic import Fp7Topic
+from inse.models.projects_eu_cordis.fp7.fp7_web_link import Fp7WebLink
+from inse.models.projects_eu_cordis.fp7.fp7_eurosci_voc import Fp7EurosciVoc
+from inse.models.projects_eu_cordis.fp7.fp7_legal_basis import Fp7LegalBasis
+
+
+class Fp7ProjectDetails(BaseModel):
+ """
+ Comprehensive FP7 Project model combining all related entities.
+ This model extends the base Fp7Project with all associated data.
+ """
+ # Project core information (flattened from Fp7Project)
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+
+ # Related entities (collections)
+ organizations: Optional[List[Fp7Organization]] = Field(default=None, description="Organizations participating in the project")
+ publications: Optional[List[Fp7Publication]] = Field(default=None, description="Publications related to the project")
+ iprs: Optional[List[Fp7ProjectIPR]] = Field(default=None, description="Intellectual Property Rights related to the project")
+ report_summaries: Optional[List[Fp7ReportSummary]] = Field(default=None, description="Report summaries for the project")
+ topics_list: Optional[List[Fp7Topic]] = Field(default=None, alias="topicsList", description="Topics associated with the project")
+ web_links: Optional[List[Fp7WebLink]] = Field(default=None, description="Web links related to the project")
+ eurosci_voc: Optional[List[Fp7EurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications")
+ legal_basis_list: Optional[List[Fp7LegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information")
+
+ # Project statistics (aggregated)
+ organization_count: Optional[int] = Field(default=None, alias="organizationCount")
+ publication_count: Optional[int] = Field(default=None, alias="publicationCount")
+ ipr_count: Optional[int] = Field(default=None, alias="iprCount")
+
+ __properties: ClassVar[List[str]] = [
+ "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate",
+ "endDate", "frameworkProgramme", "fundingScheme", "grantDoi",
+ "humanValidated", "id", "keywords", "legalBasis", "masterCall",
+ "nature", "objective", "rcn", "startDate", "status", "subCall",
+ "title", "topics", "totalCost",
+ "organizations", "publications", "iprs", "reportSummaries",
+ "topicsList", "webLinks", "eurosciVoc", "legalBasisList",
+ "organizationCount", "publicationCount", "iprCount"
+ ]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ populate_by_name=True,
+ )
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7ProjectDetailed from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias."""
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7ProjectDetailed from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ # Project core fields
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost"),
+
+ # Related entities
+ "organizations": [Fp7Organization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None,
+ "publications": [Fp7Publication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None,
+ "iprs": [Fp7ProjectIPR.from_dict(ipr) for ipr in obj.get("iprs", [])] if obj.get("iprs") else None,
+ "reportSummaries": [Fp7ReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None,
+ "topicsList": [Fp7Topic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None,
+ "webLinks": [Fp7WebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None,
+ "eurosciVoc": [Fp7EurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None,
+ "legalBasisList": [Fp7LegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None,
+
+ # Statistics
+ "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0,
+ "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0,
+ "iprCount": len(obj.get("iprs", [])) if obj.get("iprs") else 0,
+ })
+ return _obj
+
+ @classmethod
+ def from_project_with_relations(
+ cls,
+ project: Fp7Project,
+ organizations: Optional[List[Fp7Organization]] = None,
+ publications: Optional[List[Fp7Publication]] = None,
+ iprs: Optional[List[Fp7ProjectIPR]] = None,
+ report_summaries: Optional[List[Fp7ReportSummary]] = None,
+ topics_list: Optional[List[Fp7Topic]] = None,
+ web_links: Optional[List[Fp7WebLink]] = None,
+ eurosci_voc: Optional[List[Fp7EurosciVoc]] = None,
+ legal_basis_list: Optional[List[Fp7LegalBasis]] = None,
+ ) -> Self:
+ """
+ Factory method to create a detailed project from a base project and its relations.
+
+ Args:
+ project: The base Fp7Project object
+ organizations: List of organizations participating in the project
+ publications: List of publications related to the project
+ iprs: List of IPRs related to the project
+ report_summaries: List of report summaries
+ topics_list: List of topics associated with the project
+ web_links: List of web links
+ eurosci_voc: List of EuroSciVoc classifications
+ legal_basis_list: List of legal basis information
+
+ Returns:
+ Fp7ProjectDetailed instance
+ """
+ project_dict = project.to_dict() if project else {}
+
+ return cls(
+ **project_dict,
+ organizations=organizations or [],
+ publications=publications or [],
+ iprs=iprs or [],
+ reportSummaries=report_summaries or [],
+ topicsList=topics_list or [],
+ webLinks=web_links or [],
+ eurosciVoc=eurosci_voc or [],
+ legalBasisList=legal_basis_list or [],
+ organizationCount=len(organizations) if organizations else 0,
+ publicationCount=len(publications) if publications else 0,
+ iprCount=len(iprs) if iprs else 0,
+ )
\ No newline at end of file
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py
new file mode 100644
index 00000000..cfbdd89b
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py
@@ -0,0 +1,125 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7ProjectIPR(BaseModel):
+ """
+ Fp7ProjectIPR
+ """ # noqa: E501
+ applicant_name: Optional[StrictStr] = Field(default=None, alias="applicantName")
+ application_date: Optional[date] = Field(default=None, alias="applicationDate")
+ application_identifier: Optional[StrictStr] = Field(default=None, alias="applicationIdentifier")
+ application_kind: Optional[StrictStr] = Field(default=None, alias="applicationKind")
+ application_prefix: Optional[StrictStr] = Field(default=None, alias="applicationPrefix")
+ award_date: Optional[date] = Field(default=None, alias="awardDate")
+ award_identifier: Optional[StrictStr] = Field(default=None, alias="awardIdentifier")
+ award_kind: Optional[StrictStr] = Field(default=None, alias="awardKind")
+ award_prefix: Optional[StrictStr] = Field(default=None, alias="awardPrefix")
+ epo_app_url: Optional[StrictStr] = Field(default=None, alias="epoAppUrl")
+ epo_pub_url: Optional[StrictStr] = Field(default=None, alias="epoPubUrl")
+ id: Optional[StrictStr] = None
+ organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
+ patent_family_identifier: Optional[StrictStr] = Field(default=None, alias="patentFamilyIdentifier")
+ patent_type: Optional[StrictStr] = Field(default=None, alias="patentType")
+ priority_date: Optional[date] = Field(default=None, alias="priorityDate")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ type: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["applicantName", "applicationDate", "applicationIdentifier", "applicationKind", "applicationPrefix", "awardDate", "awardIdentifier", "awardKind", "awardPrefix", "epoAppUrl", "epoPubUrl", "id", "organisationID", "patentFamilyIdentifier", "patentType", "priorityDate", "projectID", "title", "type"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7ProjectIPR from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7ProjectIPR from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "applicantName": obj.get("applicantName"),
+ "applicationDate": obj.get("applicationDate"),
+ "applicationIdentifier": obj.get("applicationIdentifier"),
+ "applicationKind": obj.get("applicationKind"),
+ "applicationPrefix": obj.get("applicationPrefix"),
+ "awardDate": obj.get("awardDate"),
+ "awardIdentifier": obj.get("awardIdentifier"),
+ "awardKind": obj.get("awardKind"),
+ "awardPrefix": obj.get("awardPrefix"),
+ "epoAppUrl": obj.get("epoAppUrl"),
+ "epoPubUrl": obj.get("epoPubUrl"),
+ "id": obj.get("id"),
+ "organisationID": obj.get("organisationID"),
+ "patentFamilyIdentifier": obj.get("patentFamilyIdentifier"),
+ "patentType": obj.get("patentType"),
+ "priorityDate": obj.get("priorityDate"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "type": obj.get("type")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py
new file mode 100644
index 00000000..2e9ab1ff
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py
@@ -0,0 +1,123 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7Publication(BaseModel):
+ """
+ Fp7Publication
+ """ # noqa: E501
+ authors: Optional[StrictStr] = None
+ collection: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ doi: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs")
+ journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber")
+ journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages")
+ published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear")
+ publisher: Optional[StrictStr] = None
+ qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi")
+ rcn: Optional[StrictStr] = None
+ repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl")
+ title: Optional[StrictStr] = None
+ volume: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7Publication from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7Publication from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "authors": obj.get("authors"),
+ "collection": obj.get("collection"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "doi": obj.get("doi"),
+ "id": obj.get("id"),
+ "isPublishedAs": obj.get("isPublishedAs"),
+ "journalNumber": obj.get("journalNumber"),
+ "journalTitle": obj.get("journalTitle"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "publishedPages": obj.get("publishedPages"),
+ "publishedYear": obj.get("publishedYear"),
+ "publisher": obj.get("publisher"),
+ "qaProcessedDoi": obj.get("qaProcessedDoi"),
+ "rcn": obj.get("rcn"),
+ "repositoryUrl": obj.get("repositoryUrl"),
+ "title": obj.get("title"),
+ "volume": obj.get("volume")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py
new file mode 100644
index 00000000..43ce8910
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7ReportSummary(BaseModel):
+ """
+ Fp7ReportSummary
+ """ # noqa: E501
+ attachments: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ id: Optional[StrictStr] = None
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7ReportSummary from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7ReportSummary from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "attachments": obj.get("attachments"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "id": obj.get("id"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py
new file mode 100644
index 00000000..27a59a47
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7Topic(BaseModel):
+ """
+ Fp7Topic
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ topic: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7Topic from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7Topic from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "topic": obj.get("topic")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py
new file mode 100644
index 00000000..6898b07f
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+ CORDIS FP7 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class Fp7WebLink(BaseModel):
+ """
+ Fp7WebLink
+ """ # noqa: E501
+ archived_date: Optional[datetime] = Field(default=None, alias="archivedDate")
+ available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages")
+ id: Optional[StrictStr] = None
+ link_id: Optional[StrictStr] = Field(default=None, alias="linkId")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ represents: Optional[StrictStr] = None
+ source: Optional[StrictStr] = None
+ status: Optional[StrictStr] = None
+ type: Optional[StrictStr] = None
+ url: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Fp7WebLink from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Fp7WebLink from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "archivedDate": obj.get("archivedDate"),
+ "availableLanguages": obj.get("availableLanguages"),
+ "id": obj.get("id"),
+ "linkId": obj.get("linkId"),
+ "projectID": obj.get("projectID"),
+ "represents": obj.get("represents"),
+ "source": obj.get("source"),
+ "status": obj.get("status"),
+ "type": obj.get("type"),
+ "url": obj.get("url")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py
new file mode 100644
index 00000000..29166ca3
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020Deliverable(BaseModel):
+ """
+ H2020Deliverable
+ """ # noqa: E501
+ collection: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ deliverable_type: Optional[StrictStr] = Field(default=None, alias="deliverableType")
+ description: Optional[StrictStr] = None
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ url: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["collection", "contentUpdateDate", "deliverableType", "description", "projectAcronym", "projectID", "rcn", "url"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020Deliverable from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020Deliverable from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "collection": obj.get("collection"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "deliverableType": obj.get("deliverableType"),
+ "description": obj.get("description"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "url": obj.get("url")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py
new file mode 100644
index 00000000..b16ed4d0
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020ErcPI(BaseModel):
+ """
+ H2020ErcPI
+ """ # noqa: E501
+ first_name: Optional[StrictStr] = Field(default=None, alias="firstName")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ id: Optional[StrictStr] = None
+ last_name: Optional[StrictStr] = Field(default=None, alias="lastName")
+ organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["firstName", "fundingScheme", "id", "lastName", "organisationID", "projectAcronym", "projectID", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020ErcPI from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020ErcPI from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "firstName": obj.get("firstName"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "id": obj.get("id"),
+ "lastName": obj.get("lastName"),
+ "organisationID": obj.get("organisationID"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py
new file mode 100644
index 00000000..f6227b6c
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020EurosciVoc(BaseModel):
+ """
+ H2020EurosciVoc
+ """ # noqa: E501
+ code: Optional[StrictStr] = None
+ description: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ path: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020EurosciVoc from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020EurosciVoc from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "code": obj.get("code"),
+ "description": obj.get("description"),
+ "id": obj.get("id"),
+ "path": obj.get("path"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py
new file mode 100644
index 00000000..43327f68
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020LegalBasis(BaseModel):
+ """
+ H2020LegalBasis
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart")
+ __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020LegalBasis from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020LegalBasis from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "legalBasis": obj.get("legalBasis"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "uniqueProgrammePart": obj.get("uniqueProgrammePart")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py
new file mode 100644
index 00000000..ed63c1a0
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py
@@ -0,0 +1,139 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020Organization(BaseModel):
+ """
+ H2020Organization
+ """ # noqa: E501
+ sme: Optional[StrictBool] = Field(default=None, alias="SME")
+ active: Optional[StrictBool] = None
+ activity_type: Optional[StrictStr] = Field(default=None, alias="activityType")
+ city: Optional[StrictStr] = None
+ contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm")
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ country: Optional[StrictStr] = None
+ ec_contribution: Optional[StrictFloat] = Field(default=None, alias="ecContribution")
+ end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation")
+ geolocation: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ name: Optional[StrictStr] = None
+ net_ec_contribution: Optional[StrictFloat] = Field(default=None, alias="netEcContribution")
+ nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode")
+ order: Optional[StrictInt] = None
+ organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
+ organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL")
+ post_code: Optional[StrictStr] = Field(default=None, alias="postCode")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ role: Optional[StrictStr] = None
+ short_name: Optional[StrictStr] = Field(default=None, alias="shortName")
+ street: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber")
+ __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020Organization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020Organization from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "SME": obj.get("SME"),
+ "active": obj.get("active"),
+ "activityType": obj.get("activityType"),
+ "city": obj.get("city"),
+ "contactForm": obj.get("contactForm"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "country": obj.get("country"),
+ "ecContribution": obj.get("ecContribution"),
+ "endOfParticipation": obj.get("endOfParticipation"),
+ "geolocation": obj.get("geolocation"),
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "netEcContribution": obj.get("netEcContribution"),
+ "nutsCode": obj.get("nutsCode"),
+ "order": obj.get("order"),
+ "organisationID": obj.get("organisationID"),
+ "organizationURL": obj.get("organizationURL"),
+ "postCode": obj.get("postCode"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "role": obj.get("role"),
+ "shortName": obj.get("shortName"),
+ "street": obj.get("street"),
+ "totalCost": obj.get("totalCost"),
+ "vatNumber": obj.get("vatNumber")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py
new file mode 100644
index 00000000..c12b16ec
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py
@@ -0,0 +1,131 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020Project(BaseModel):
+ """
+ H2020Project
+ """ # noqa: E501
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020Project from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020Project from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py
new file mode 100644
index 00000000..0c57f008
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py
@@ -0,0 +1,224 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API - Extended Models
+""" # noqa: E501
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+# Import all the base models
+from inse.models.projects_eu_cordis.horizon2020.h2020_project import H2020Project
+from inse.models.projects_eu_cordis.horizon2020.h2020_organization import H2020Organization
+from inse.models.projects_eu_cordis.horizon2020.h2020_publication import H2020Publication
+from inse.models.projects_eu_cordis.horizon2020.h2020_deliverable import H2020Deliverable
+from inse.models.projects_eu_cordis.horizon2020.h2020_report_summary import H2020ReportSummary
+from inse.models.projects_eu_cordis.horizon2020.h2020_topic import H2020Topic
+from inse.models.projects_eu_cordis.horizon2020.h2020_web_link import H2020WebLink
+from inse.models.projects_eu_cordis.horizon2020.h2020_eurosci_voc import H2020EurosciVoc
+from inse.models.projects_eu_cordis.horizon2020.h2020_legal_basis import H2020LegalBasis
+from inse.models.projects_eu_cordis.horizon2020.h2020_erc_pi import H2020ErcPI
+
+
+class H2020ProjectDetails(BaseModel):
+ """
+ Comprehensive Horizon 2020 Project model combining all related entities.
+ This model extends the base H2020Project with all associated data.
+ """
+ # Project core information (flattened from H2020Project)
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+
+ # Related entities (collections)
+ organizations: Optional[List[H2020Organization]] = Field(default=None, description="Organizations participating in the project")
+ publications: Optional[List[H2020Publication]] = Field(default=None, description="Publications related to the project")
+ deliverables: Optional[List[H2020Deliverable]] = Field(default=None, description="Deliverables of the project")
+ report_summaries: Optional[List[H2020ReportSummary]] = Field(default=None, alias="reportSummaries", description="Report summaries for the project")
+ topics_list: Optional[List[H2020Topic]] = Field(default=None, alias="topicsList", description="Topics associated with the project")
+ web_links: Optional[List[H2020WebLink]] = Field(default=None, alias="webLinks", description="Web links related to the project")
+ eurosci_voc: Optional[List[H2020EurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications")
+ legal_basis_list: Optional[List[H2020LegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information")
+ erc_principal_investigators: Optional[List[H2020ErcPI]] = Field(default=None, alias="ercPrincipalInvestigators", description="ERC Principal Investigators (specific to H2020)")
+
+ # Project statistics (aggregated)
+ organization_count: Optional[int] = Field(default=None, alias="organizationCount")
+ publication_count: Optional[int] = Field(default=None, alias="publicationCount")
+ deliverable_count: Optional[int] = Field(default=None, alias="deliverableCount")
+ erc_pi_count: Optional[int] = Field(default=None, alias="ercPiCount")
+
+ __properties: ClassVar[List[str]] = [
+ "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate",
+ "endDate", "frameworkProgramme", "fundingScheme", "grantDoi",
+ "humanValidated", "id", "keywords", "legalBasis", "masterCall",
+ "nature", "objective", "rcn", "startDate", "status", "subCall",
+ "title", "topics", "totalCost",
+ "organizations", "publications", "deliverables", "reportSummaries",
+ "topicsList", "webLinks", "eurosciVoc", "legalBasisList",
+ "ercPrincipalInvestigators",
+ "organizationCount", "publicationCount", "deliverableCount", "ercPiCount"
+ ]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ populate_by_name=True,
+ )
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020ProjectDetailed from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias."""
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020ProjectDetailed from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ # Project core fields
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost"),
+
+ # Related entities
+ "organizations": [H2020Organization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None,
+ "publications": [H2020Publication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None,
+ "deliverables": [H2020Deliverable.from_dict(deliv) for deliv in obj.get("deliverables", [])] if obj.get("deliverables") else None,
+ "reportSummaries": [H2020ReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None,
+ "topicsList": [H2020Topic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None,
+ "webLinks": [H2020WebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None,
+ "eurosciVoc": [H2020EurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None,
+ "legalBasisList": [H2020LegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None,
+ "ercPrincipalInvestigators": [H2020ErcPI.from_dict(pi) for pi in obj.get("ercPrincipalInvestigators", [])] if obj.get("ercPrincipalInvestigators") else None,
+
+ # Statistics
+ "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0,
+ "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0,
+ "deliverableCount": len(obj.get("deliverables", [])) if obj.get("deliverables") else 0,
+ "ercPiCount": len(obj.get("ercPrincipalInvestigators", [])) if obj.get("ercPrincipalInvestigators") else 0,
+ })
+ return _obj
+
+ @classmethod
+ def from_project_with_relations(
+ cls,
+ project: H2020Project,
+ organizations: Optional[List[H2020Organization]] = None,
+ publications: Optional[List[H2020Publication]] = None,
+ deliverables: Optional[List[H2020Deliverable]] = None,
+ report_summaries: Optional[List[H2020ReportSummary]] = None,
+ topics_list: Optional[List[H2020Topic]] = None,
+ web_links: Optional[List[H2020WebLink]] = None,
+ eurosci_voc: Optional[List[H2020EurosciVoc]] = None,
+ legal_basis_list: Optional[List[H2020LegalBasis]] = None,
+ erc_principal_investigators: Optional[List[H2020ErcPI]] = None,
+ ) -> Self:
+ """
+ Factory method to create a detailed project from a base project and its relations.
+
+ Args:
+ project: The base H2020Project object
+ organizations: List of organizations participating in the project
+ publications: List of publications related to the project
+ deliverables: List of deliverables of the project
+ report_summaries: List of report summaries
+ topics_list: List of topics associated with the project
+ web_links: List of web links
+ eurosci_voc: List of EuroSciVoc classifications
+ legal_basis_list: List of legal basis information
+ erc_principal_investigators: List of ERC Principal Investigators
+
+ Returns:
+ H2020ProjectDetailed instance
+ """
+ project_dict = project.to_dict() if project else {}
+
+ return cls(
+ **project_dict,
+ organizations=organizations or [],
+ publications=publications or [],
+ deliverables=deliverables or [],
+ reportSummaries=report_summaries or [],
+ topicsList=topics_list or [],
+ webLinks=web_links or [],
+ eurosciVoc=eurosci_voc or [],
+ legalBasisList=legal_basis_list or [],
+ ercPrincipalInvestigators=erc_principal_investigators or [],
+ organizationCount=len(organizations) if organizations else 0,
+ publicationCount=len(publications) if publications else 0,
+ deliverableCount=len(deliverables) if deliverables else 0,
+ ercPiCount=len(erc_principal_investigators) if erc_principal_investigators else 0,
+ )
\ No newline at end of file
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py
new file mode 100644
index 00000000..ffe9a440
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py
@@ -0,0 +1,123 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020Publication(BaseModel):
+ """
+ H2020Publication
+ """ # noqa: E501
+ authors: Optional[StrictStr] = None
+ collection: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ doi: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs")
+ journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber")
+ journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages")
+ published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear")
+ publisher: Optional[StrictStr] = None
+ qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi")
+ rcn: Optional[StrictStr] = None
+ repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl")
+ title: Optional[StrictStr] = None
+ volume: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020Publication from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020Publication from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "authors": obj.get("authors"),
+ "collection": obj.get("collection"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "doi": obj.get("doi"),
+ "id": obj.get("id"),
+ "isPublishedAs": obj.get("isPublishedAs"),
+ "journalNumber": obj.get("journalNumber"),
+ "journalTitle": obj.get("journalTitle"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "publishedPages": obj.get("publishedPages"),
+ "publishedYear": obj.get("publishedYear"),
+ "publisher": obj.get("publisher"),
+ "qaProcessedDoi": obj.get("qaProcessedDoi"),
+ "rcn": obj.get("rcn"),
+ "repositoryUrl": obj.get("repositoryUrl"),
+ "title": obj.get("title"),
+ "volume": obj.get("volume")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py
new file mode 100644
index 00000000..e1f7e49f
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020ReportSummary(BaseModel):
+ """
+ H2020ReportSummary
+ """ # noqa: E501
+ attachments: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ id: Optional[StrictStr] = None
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020ReportSummary from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020ReportSummary from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "attachments": obj.get("attachments"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "id": obj.get("id"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py
new file mode 100644
index 00000000..0c6bedbb
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020Topic(BaseModel):
+ """
+ H2020Topic
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ topic: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020Topic from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020Topic from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "topic": obj.get("topic")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py
new file mode 100644
index 00000000..a8e45638
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon 2020 Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class H2020WebLink(BaseModel):
+ """
+ H2020WebLink
+ """ # noqa: E501
+ archived_date: Optional[datetime] = Field(default=None, alias="archivedDate")
+ available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages")
+ id: Optional[StrictStr] = None
+ link_id: Optional[StrictStr] = Field(default=None, alias="linkId")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ represents: Optional[StrictStr] = None
+ source: Optional[StrictStr] = None
+ status: Optional[StrictStr] = None
+ type: Optional[StrictStr] = None
+ url: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of H2020WebLink from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of H2020WebLink from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "archivedDate": obj.get("archivedDate"),
+ "availableLanguages": obj.get("availableLanguages"),
+ "id": obj.get("id"),
+ "linkId": obj.get("linkId"),
+ "projectID": obj.get("projectID"),
+ "represents": obj.get("represents"),
+ "source": obj.get("source"),
+ "status": obj.get("status"),
+ "type": obj.get("type"),
+ "url": obj.get("url")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py
new file mode 100644
index 00000000..ba858158
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUDeliverable(BaseModel):
+ """
+ HEUDeliverable
+ """ # noqa: E501
+ collection: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ deliverable_type: Optional[StrictStr] = Field(default=None, alias="deliverableType")
+ description: Optional[StrictStr] = None
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ url: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["collection", "contentUpdateDate", "deliverableType", "description", "projectAcronym", "projectID", "rcn", "url"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUDeliverable from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUDeliverable from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "collection": obj.get("collection"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "deliverableType": obj.get("deliverableType"),
+ "description": obj.get("description"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "url": obj.get("url")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py
new file mode 100644
index 00000000..586f3777
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUEurosciVoc(BaseModel):
+ """
+ HEUEurosciVoc
+ """ # noqa: E501
+ code: Optional[StrictStr] = None
+ description: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ path: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUEurosciVoc from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUEurosciVoc from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "code": obj.get("code"),
+ "description": obj.get("description"),
+ "id": obj.get("id"),
+ "path": obj.get("path"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py
new file mode 100644
index 00000000..0c4e288e
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEULegalBasis(BaseModel):
+ """
+ HEULegalBasis
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart")
+ __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEULegalBasis from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEULegalBasis from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "legalBasis": obj.get("legalBasis"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "uniqueProgrammePart": obj.get("uniqueProgrammePart")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py
new file mode 100644
index 00000000..069ee71a
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py
@@ -0,0 +1,139 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUOrganization(BaseModel):
+ """
+ HEUOrganization
+ """ # noqa: E501
+ sme: Optional[StrictBool] = Field(default=None, alias="SME")
+ active: Optional[StrictBool] = None
+ activity_type: Optional[StrictStr] = Field(default=None, alias="activityType")
+ city: Optional[StrictStr] = None
+ contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm")
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ country: Optional[StrictStr] = None
+ ec_contribution: Optional[StrictFloat] = Field(default=None, alias="ecContribution")
+ end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation")
+ geolocation: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ name: Optional[StrictStr] = None
+ net_ec_contribution: Optional[StrictFloat] = Field(default=None, alias="netEcContribution")
+ nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode")
+ order: Optional[StrictInt] = None
+ organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
+ organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL")
+ post_code: Optional[StrictStr] = Field(default=None, alias="postCode")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ role: Optional[StrictStr] = None
+ short_name: Optional[StrictStr] = Field(default=None, alias="shortName")
+ street: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber")
+ __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUOrganization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUOrganization from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "SME": obj.get("SME"),
+ "active": obj.get("active"),
+ "activityType": obj.get("activityType"),
+ "city": obj.get("city"),
+ "contactForm": obj.get("contactForm"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "country": obj.get("country"),
+ "ecContribution": obj.get("ecContribution"),
+ "endOfParticipation": obj.get("endOfParticipation"),
+ "geolocation": obj.get("geolocation"),
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "netEcContribution": obj.get("netEcContribution"),
+ "nutsCode": obj.get("nutsCode"),
+ "order": obj.get("order"),
+ "organisationID": obj.get("organisationID"),
+ "organizationURL": obj.get("organizationURL"),
+ "postCode": obj.get("postCode"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "role": obj.get("role"),
+ "shortName": obj.get("shortName"),
+ "street": obj.get("street"),
+ "totalCost": obj.get("totalCost"),
+ "vatNumber": obj.get("vatNumber")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py
new file mode 100644
index 00000000..77607832
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py
@@ -0,0 +1,131 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUProject(BaseModel):
+ """
+ HEUProject
+ """ # noqa: E501
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+ __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUProject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUProject from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py
new file mode 100644
index 00000000..48f69a7f
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py
@@ -0,0 +1,214 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API - Extended Models
+""" # noqa: E501
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+# Import all the base models
+from inse.models.projects_eu_cordis.horizon_europe.heu_project import HEUProject
+from inse.models.projects_eu_cordis.horizon_europe.heu_organization import HEUOrganization
+from inse.models.projects_eu_cordis.horizon_europe.heu_publication import HEUPublication
+from inse.models.projects_eu_cordis.horizon_europe.heu_deliverable import HEUDeliverable
+from inse.models.projects_eu_cordis.horizon_europe.heu_report_summary import HEUReportSummary
+from inse.models.projects_eu_cordis.horizon_europe.heu_topic import HEUTopic
+from inse.models.projects_eu_cordis.horizon_europe.heu_web_link import HEUWebLink
+from inse.models.projects_eu_cordis.horizon_europe.heu_eurosci_voc import HEUEurosciVoc
+from inse.models.projects_eu_cordis.horizon_europe.heu_legal_basis import HEULegalBasis
+
+
+class HEUProjectDetails(BaseModel):
+ """
+ Comprehensive Horizon Europe Project model combining all related entities.
+ This model extends the base HEUProject with all associated data.
+ """
+ # Project core information (flattened from HEUProject)
+ acronym: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ ec_max_contribution: Optional[StrictFloat] = Field(default=None, alias="ecMaxContribution")
+ ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
+ end_date: Optional[date] = Field(default=None, alias="endDate")
+ framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
+ funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
+ grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
+ human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
+ id: Optional[StrictStr] = None
+ keywords: Optional[StrictStr] = None
+ legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
+ master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
+ nature: Optional[StrictStr] = None
+ objective: Optional[StrictStr] = None
+ rcn: Optional[StrictStr] = None
+ start_date: Optional[date] = Field(default=None, alias="startDate")
+ status: Optional[StrictStr] = None
+ sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
+ title: Optional[StrictStr] = None
+ topics: Optional[StrictStr] = None
+ total_cost: Optional[StrictFloat] = Field(default=None, alias="totalCost")
+
+ # Related entities (collections)
+ organizations: Optional[List[HEUOrganization]] = Field(default=None, description="Organizations participating in the project")
+ publications: Optional[List[HEUPublication]] = Field(default=None, description="Publications related to the project")
+ deliverables: Optional[List[HEUDeliverable]] = Field(default=None, description="Deliverables of the project")
+ report_summaries: Optional[List[HEUReportSummary]] = Field(default=None, alias="reportSummaries", description="Report summaries for the project")
+ topics_list: Optional[List[HEUTopic]] = Field(default=None, alias="topicsList", description="Topics associated with the project")
+ web_links: Optional[List[HEUWebLink]] = Field(default=None, alias="webLinks", description="Web links related to the project")
+ eurosci_voc: Optional[List[HEUEurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications")
+ legal_basis_list: Optional[List[HEULegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information")
+
+ # Project statistics (aggregated)
+ organization_count: Optional[int] = Field(default=None, alias="organizationCount")
+ publication_count: Optional[int] = Field(default=None, alias="publicationCount")
+ deliverable_count: Optional[int] = Field(default=None, alias="deliverableCount")
+
+ __properties: ClassVar[List[str]] = [
+ "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate",
+ "endDate", "frameworkProgramme", "fundingScheme", "grantDoi",
+ "humanValidated", "id", "keywords", "legalBasis", "masterCall",
+ "nature", "objective", "rcn", "startDate", "status", "subCall",
+ "title", "topics", "totalCost",
+ "organizations", "publications", "deliverables", "reportSummaries",
+ "topicsList", "webLinks", "eurosciVoc", "legalBasisList",
+ "organizationCount", "publicationCount", "deliverableCount"
+ ]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ populate_by_name=True,
+ )
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUProjectDetailed from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias."""
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUProjectDetailed from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ # Project core fields
+ "acronym": obj.get("acronym"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "ecMaxContribution": obj.get("ecMaxContribution"),
+ "ecSignatureDate": obj.get("ecSignatureDate"),
+ "endDate": obj.get("endDate"),
+ "frameworkProgramme": obj.get("frameworkProgramme"),
+ "fundingScheme": obj.get("fundingScheme"),
+ "grantDoi": obj.get("grantDoi"),
+ "humanValidated": obj.get("humanValidated"),
+ "id": obj.get("id"),
+ "keywords": obj.get("keywords"),
+ "legalBasis": obj.get("legalBasis"),
+ "masterCall": obj.get("masterCall"),
+ "nature": obj.get("nature"),
+ "objective": obj.get("objective"),
+ "rcn": obj.get("rcn"),
+ "startDate": obj.get("startDate"),
+ "status": obj.get("status"),
+ "subCall": obj.get("subCall"),
+ "title": obj.get("title"),
+ "topics": obj.get("topics"),
+ "totalCost": obj.get("totalCost"),
+
+ # Related entities
+ "organizations": [HEUOrganization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None,
+ "publications": [HEUPublication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None,
+ "deliverables": [HEUDeliverable.from_dict(deliv) for deliv in obj.get("deliverables", [])] if obj.get("deliverables") else None,
+ "reportSummaries": [HEUReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None,
+ "topicsList": [HEUTopic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None,
+ "webLinks": [HEUWebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None,
+ "eurosciVoc": [HEUEurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None,
+ "legalBasisList": [HEULegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None,
+
+ # Statistics
+ "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0,
+ "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0,
+ "deliverableCount": len(obj.get("deliverables", [])) if obj.get("deliverables") else 0,
+ })
+ return _obj
+
+ @classmethod
+ def from_project_with_relations(
+ cls,
+ project: HEUProject,
+ organizations: Optional[List[HEUOrganization]] = None,
+ publications: Optional[List[HEUPublication]] = None,
+ deliverables: Optional[List[HEUDeliverable]] = None,
+ report_summaries: Optional[List[HEUReportSummary]] = None,
+ topics_list: Optional[List[HEUTopic]] = None,
+ web_links: Optional[List[HEUWebLink]] = None,
+ eurosci_voc: Optional[List[HEUEurosciVoc]] = None,
+ legal_basis_list: Optional[List[HEULegalBasis]] = None,
+ ) -> Self:
+ """
+ Factory method to create a detailed project from a base project and its relations.
+
+ Args:
+ project: The base HEUProject object
+ organizations: List of organizations participating in the project
+ publications: List of publications related to the project
+ deliverables: List of deliverables of the project
+ report_summaries: List of report summaries
+ topics_list: List of topics associated with the project
+ web_links: List of web links
+ eurosci_voc: List of EuroSciVoc classifications
+ legal_basis_list: List of legal basis information
+
+ Returns:
+ HEUProjectDetailed instance
+ """
+ project_dict = project.to_dict() if project else {}
+
+ return cls(
+ **project_dict,
+ organizations=organizations or [],
+ publications=publications or [],
+ deliverables=deliverables or [],
+ reportSummaries=report_summaries or [],
+ topicsList=topics_list or [],
+ webLinks=web_links or [],
+ eurosciVoc=eurosci_voc or [],
+ legalBasisList=legal_basis_list or [],
+ organizationCount=len(organizations) if organizations else 0,
+ publicationCount=len(publications) if publications else 0,
+ deliverableCount=len(deliverables) if deliverables else 0,
+ )
\ No newline at end of file
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py
new file mode 100644
index 00000000..9d3424df
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py
@@ -0,0 +1,123 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUPublication(BaseModel):
+ """
+ HEUPublication
+ """ # noqa: E501
+ authors: Optional[StrictStr] = None
+ collection: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ doi: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs")
+ journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber")
+ journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle")
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages")
+ published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear")
+ publisher: Optional[StrictStr] = None
+ qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi")
+ rcn: Optional[StrictStr] = None
+ repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl")
+ title: Optional[StrictStr] = None
+ volume: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUPublication from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUPublication from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "authors": obj.get("authors"),
+ "collection": obj.get("collection"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "doi": obj.get("doi"),
+ "id": obj.get("id"),
+ "isPublishedAs": obj.get("isPublishedAs"),
+ "journalNumber": obj.get("journalNumber"),
+ "journalTitle": obj.get("journalTitle"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "publishedPages": obj.get("publishedPages"),
+ "publishedYear": obj.get("publishedYear"),
+ "publisher": obj.get("publisher"),
+ "qaProcessedDoi": obj.get("qaProcessedDoi"),
+ "rcn": obj.get("rcn"),
+ "repositoryUrl": obj.get("repositoryUrl"),
+ "title": obj.get("title"),
+ "volume": obj.get("volume")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py
new file mode 100644
index 00000000..bf5850fc
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUReportSummary(BaseModel):
+ """
+ HEUReportSummary
+ """ # noqa: E501
+ attachments: Optional[StrictStr] = None
+ content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
+ id: Optional[StrictStr] = None
+ project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ rcn: Optional[StrictStr] = None
+ title: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUReportSummary from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUReportSummary from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "attachments": obj.get("attachments"),
+ "contentUpdateDate": obj.get("contentUpdateDate"),
+ "id": obj.get("id"),
+ "projectAcronym": obj.get("projectAcronym"),
+ "projectID": obj.get("projectID"),
+ "rcn": obj.get("rcn"),
+ "title": obj.get("title")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py
new file mode 100644
index 00000000..4aa58787
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUTopic(BaseModel):
+ """
+ HEUTopic
+ """ # noqa: E501
+ id: Optional[StrictStr] = None
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ title: Optional[StrictStr] = None
+ topic: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUTopic from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUTopic from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "projectID": obj.get("projectID"),
+ "title": obj.get("title"),
+ "topic": obj.get("topic")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py
new file mode 100644
index 00000000..50797815
--- /dev/null
+++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+ CORDIS Horizon Europe Multi-Index API
+
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+from pydantic_core import to_jsonable_python
+
+class HEUWebLink(BaseModel):
+ """
+ HEUWebLink
+ """ # noqa: E501
+ archived_date: Optional[datetime] = Field(default=None, alias="archivedDate")
+ available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages")
+ id: Optional[StrictStr] = None
+ link_id: Optional[StrictStr] = Field(default=None, alias="linkId")
+ project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
+ represents: Optional[StrictStr] = None
+ source: Optional[StrictStr] = None
+ status: Optional[StrictStr] = None
+ type: Optional[StrictStr] = None
+ url: Optional[StrictStr] = None
+ __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"]
+
+ model_config = ConfigDict(
+ validate_by_name=True,
+ validate_by_alias=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(to_jsonable_python(self.to_dict()))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HEUWebLink from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ """
+ excluded_fields: Set[str] = set([
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HEUWebLink from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "archivedDate": obj.get("archivedDate"),
+ "availableLanguages": obj.get("availableLanguages"),
+ "id": obj.get("id"),
+ "linkId": obj.get("linkId"),
+ "projectID": obj.get("projectID"),
+ "represents": obj.get("represents"),
+ "source": obj.get("source"),
+ "status": obj.get("status"),
+ "type": obj.get("type"),
+ "url": obj.get("url")
+ })
+ return _obj
+
+
diff --git a/service/src/main/inse/patents/elastic_search_client.py b/service/src/main/inse/patents/elastic_search_client.py
index f10694e6..698e9d84 100644
--- a/service/src/main/inse/patents/elastic_search_client.py
+++ b/service/src/main/inse/patents/elastic_search_client.py
@@ -4,15 +4,13 @@
HTTP client for patent searches in EPO and USPTO Elasticsearch indices.
"""
from typing import Any
-
+from inse.integrations import elasticsearch
+from inse.model import ESCluster, ESIndex
import httpx
-
+import asyncio
from .. import config
from .name_matching import search_name_variants
-EPO_INDEX = "epo_index_1.0"
-USPTO_INDEX = "uspto_patents_3.0"
-
DEFAULT_SEARCH_SIZE = 100
@@ -168,21 +166,117 @@ class PatentSearchClient:
}
async def search_epo(self, payload: dict[str, Any]) -> dict[str, Any]:
- return await self._search(EPO_INDEX, payload)
+ return await self._search(ESIndex.EPO_INDEX, payload)
async def search_uspto(self, payload: dict[str, Any]) -> dict[str, Any]:
- return await self._search(USPTO_INDEX, payload)
+ return await self._search(ESIndex.USPTO_INDEX, payload)
async def _search(self, index: str, payload: dict[str, Any]) -> dict[str, Any]:
- async with httpx.AsyncClient(
- base_url=self.base_url,
- timeout=self.timeout,
- transport=self.transport,
- ) as client:
- response = await client.post(
- f"/{index}/_search",
- headers=self._headers(),
- json=payload,
- )
- response.raise_for_status()
- return response.json()
\ No newline at end of file
+ response = elasticsearch.search(index=index,body=payload,cluster=ESCluster.INSE)
+ return response
+
+ async def get_by_id_or_title(
+ self,
+ patent_id: str,
+ prefix: str,
+ title: str,
+ size: int = 1,
+ ) -> dict[str, Any]:
+ """Search EPO and USPTO by ID; fall back to match_phrase on title if no hits.
+
+ Args:
+ patent_id: The raw document/publication number (e.g. "1234567", "US1234567A").
+ prefix: "EP" routes the title fallback to EPO; "US" routes it to USPTO.
+ Both indices are always queried for the ID lookup.
+ title: Used only when the ID lookup returns zero hits.
+ size: Maximum number of results to return.
+ """
+ epo_id_payload = self._epo_query_by_id(patent_id, size)
+ uspto_id_payload = self._uspto_query_by_id(patent_id, size)
+
+ epo_result, uspto_result = await asyncio.gather(
+ self.search_epo(epo_id_payload),
+ self.search_uspto(uspto_id_payload),
+ )
+
+ epo_hits = epo_result.get("hits", {}).get("total", {}).get("value", 0)
+ uspto_hits = uspto_result.get("hits", {}).get("total", {}).get("value", 0)
+
+ if epo_hits > 0 or uspto_hits > 0:
+ if prefix.upper() == "EP" and epo_hits > 0:
+ return epo_result
+ if prefix.upper() == "US" and uspto_hits > 0:
+ return uspto_result
+ return epo_result if epo_hits > 0 else uspto_result
+
+ if prefix.upper() == "US":
+ payload = self._uspto_query_by_title(title, size)
+ return await self.search_uspto(payload)
+
+ payload = self._epo_query_by_title(title, size)
+ return await self.search_epo(payload)
+ #query builders
+
+ def _epo_query_by_id(self, patent_id: str, size: int) -> dict[str, Any]:
+ """Term query against doc_number; strips a leading 'EP' prefix if present."""
+ raw_id = patent_id.upper().removeprefix("EP")
+ return {
+ "size": size,
+ "_source": [
+ "doc_number", "country", "kind", "date_publication",
+ "date_publication_year", "application_number",
+ "application_filing_date", "title_en", "title_de", "abstract",
+ "inventors_name", "applicants_name", "ipc", "cpc",
+ ],
+ "query": {"term": {"doc_number": raw_id}},
+ }
+
+ def _uspto_query_by_id(self, patent_id: str, size: int) -> dict[str, Any]:
+ """Term query against publication_number; tries the ID as-is."""
+ return {
+ "size": size,
+ "track_total_hits": True,
+ "sort": [{"publication_date": {"order": "desc", "missing": "_last"}}, "_doc"],
+ "_source": [
+ "publication_number", "country", "publication_date",
+ "publication_year", "application_number", "application_date",
+ "application_type", "title", "abstract", "inventors_names",
+ "assignees_orgs", "ipcr", "cpc", "number_of_claims", "status",
+ ],
+ "query": {"term": {"publication_number": patent_id}},
+ }
+
+ def _epo_query_by_title(self, title: str, size: int) -> dict[str, Any]:
+ """match_phrase fallback on title_en (and title_de as a should clause)."""
+ return {
+ "size": size,
+ "_source": [
+ "doc_number", "country", "kind", "date_publication",
+ "date_publication_year", "application_number",
+ "application_filing_date", "title_en", "title_de", "abstract",
+ "inventors_name", "applicants_name", "ipc", "cpc",
+ ],
+ "query": {
+ "bool": {
+ "should": [
+ {"match_phrase": {"title_en": title}},
+ {"match_phrase": {"title_de": title}},
+ {"match_phrase": {"title_fr": title}},
+ ],
+ "minimum_should_match": 1,
+ }
+ },
+ }
+
+ def _uspto_query_by_title(self, title: str, size: int) -> dict[str, Any]:
+ """match_phrase fallback on title."""
+ return {
+ "size": size,
+ "_source": [
+ "publication_number", "country", "publication_date",
+ "publication_year", "application_number", "application_date",
+ "application_type", "title", "abstract", "inventors_names",
+ "assignees_orgs", "ipcr", "cpc", "number_of_claims", "status",
+ ],
+ "query": {"match_phrase": {"title": title}},
+ }
\ No newline at end of file
diff --git a/service/src/main/inse/patents/logic.py b/service/src/main/inse/patents/logic.py
index 76594b9a..d6fe29d5 100644
--- a/service/src/main/inse/patents/logic.py
+++ b/service/src/main/inse/patents/logic.py
@@ -10,6 +10,7 @@ import httpx
from fastapi import HTTPException
from starlette.status import HTTP_502_BAD_GATEWAY
from starlette.status import HTTP_503_SERVICE_UNAVAILABLE
+from starlette.status import HTTP_404_NOT_FOUND
from ..persons import logic as person_logic
from ..models.openalex.author import Author
@@ -24,6 +25,28 @@ from .name_matching import name_matches
logger = logging.getLogger(__name__)
+async def get_patent(
+ patent_id: str,
+ title: str,
+ prefix: str,
+ client: PatentSearchClient | None = None,
+) -> model.PatentEntry:
+ search_client = client or PatentSearchClient()
+
+ data = await search_client.get_by_id_or_title(
+ patent_id=patent_id,
+ prefix=prefix,
+ title=title,
+ )
+
+ parse = _parse_uspto_hits if prefix.upper() == "US" else _parse_epo_hits
+ elements = parse(data)
+
+ if not elements:
+ return None
+ return elements[0]
+
+
async def get_patents_by_author_id(
author_id: str,
client: PatentSearchClient | None = None,
diff --git a/service/src/main/inse/patents/service.py b/service/src/main/inse/patents/service.py
index c2a8eb49..059fe0d8 100644
--- a/service/src/main/inse/patents/service.py
+++ b/service/src/main/inse/patents/service.py
@@ -3,7 +3,9 @@
from fastapi import APIRouter
from . import logic
from . import model
-
+from typing import Annotated, Optional
+from fastapi import Path
+from fastapi import Query
router = APIRouter(prefix="/api/inse-service/authors", tags=["Patents"])
patents_router = APIRouter(prefix="/api/inse-service", tags=["Patents"])
@@ -16,7 +18,26 @@ patents_router = APIRouter(prefix="/api/inse-service", tags=["Patents"])
summary="Get patents matched to an author by name.",
)
async def get_patents_by_author(author_id: str):
- return await logic.get_patents_by_author_id(author_id)
+ return await logic.get_patents_by_author_id(author_id)
+
+@patents_router.get(
+ "/patents/{identifier}",
+ operation_id="getPatentByIdOrTitle",
+ response_model=model.PatentEntry | None,
+ summary="Returns one publication by OpenAlex ID or DOI.",
+)
+async def get_patent_by_identifier(
+ identifier: Annotated[
+ str, Path(description="")
+ ],
+ prefix: Annotated[
+ Optional[str], Query(description="Application Prefix (EP or US)")
+ ] = "",
+ title: Annotated[
+ Optional[str], Query(description="Do we want to fallback to title search if ID and DOI dont work?")
+ ] = "",
+):
+ return await logic.get_patent(patent_id=identifier,prefix=prefix,title=title)
@patents_router.get(
@@ -40,4 +61,4 @@ async def get_all_patents(
source=source,
sort_by=sort_by,
sort_direction=sort_direction,
- )
\ No newline at end of file
+ )
diff --git a/service/src/main/inse/patents/test_elastic_search_client.py b/service/src/main/inse/patents/test_elastic_search_client.py
index 08729ea6..6aea4c7c 100644
--- a/service/src/main/inse/patents/test_elastic_search_client.py
+++ b/service/src/main/inse/patents/test_elastic_search_client.py
@@ -1,11 +1,9 @@
-import httpx
import pytest
-
+from unittest.mock import patch, MagicMock
+from inse.model import ESIndex
from inse.patents.elastic_search_client import (
DEFAULT_SEARCH_SIZE,
- EPO_INDEX,
PatentSearchClient,
- USPTO_INDEX,
)
@@ -28,22 +26,21 @@ def test_epo_query_uses_nested_search_and_name_variants():
def test_uspto_index_is_3_0():
- assert USPTO_INDEX == "uspto_patents_3.0"
- assert EPO_INDEX == "epo_index_1.0"
+ assert ESIndex.USPTO_INDEX == "uspto_patents_3.0"
+ assert ESIndex.EPO_INDEX == "epo_index_1.0"
@pytest.mark.anyio
async def test_search_epo_posts_to_correct_index():
- requests: list[str] = []
+ captured: list[dict] = []
- def handler(request: httpx.Request) -> httpx.Response:
- requests.append(request.url.path)
- return httpx.Response(200, json={"hits": {"hits": []}})
+ def fake_search(index: str, body: dict, cluster=None):
+ captured.append({"index": index, "body": body})
+ return {"hits": {"hits": []}}
- transport = httpx.MockTransport(handler)
- client = PatentSearchClient(api_key="test-key", transport=transport)
+ with patch("inse.integrations.elasticsearch.search", side_effect=fake_search):
+ client = PatentSearchClient(api_key="test-key")
+ await client.search_epo(client.epo_query_by_inventor("Weber", "Christian"))
- await client.search_epo(client.epo_query_by_inventor("Weber", "Christian"))
-
- assert len(requests) == 1
- assert requests[0].endswith(f"/{EPO_INDEX}/_search")
+ assert len(captured) == 1
+ assert captured[0]["index"] == ESIndex.EPO_INDEX
\ No newline at end of file
diff --git a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py
new file mode 100644
index 00000000..5caff70e
--- /dev/null
+++ b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py
@@ -0,0 +1,282 @@
+import logging
+from concurrent.futures import ThreadPoolExecutor, as_completed
+from typing import Any, Dict, List, Optional, Union
+
+from inse.config import get_settings
+from inse.integrations import elasticsearch
+from inse.model import ESCluster, ESIndex
+
+# Import base models
+from inse.models.cordis_eu_project import CordisEuProject
+
+# Import FP7 models
+from inse.models.projects_eu_cordis.fp7.fp7_project import Fp7Project
+from inse.models.projects_eu_cordis.fp7.fp7_organization import Fp7Organization
+from inse.models.projects_eu_cordis.fp7.fp7_publication import Fp7Publication
+from inse.models.projects_eu_cordis.fp7.fp7_project_ipr import Fp7ProjectIPR
+from inse.models.projects_eu_cordis.fp7.fp7_report_summary import Fp7ReportSummary
+from inse.models.projects_eu_cordis.fp7.fp7_topic import Fp7Topic
+from inse.models.projects_eu_cordis.fp7.fp7_web_link import Fp7WebLink
+from inse.models.projects_eu_cordis.fp7.fp7_eurosci_voc import Fp7EurosciVoc
+from inse.models.projects_eu_cordis.fp7.fp7_legal_basis import Fp7LegalBasis
+from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails
+
+# Import H2020 models
+from inse.models.projects_eu_cordis.horizon2020.h2020_project import H2020Project
+from inse.models.projects_eu_cordis.horizon2020.h2020_organization import H2020Organization
+from inse.models.projects_eu_cordis.horizon2020.h2020_publication import H2020Publication
+from inse.models.projects_eu_cordis.horizon2020.h2020_deliverable import H2020Deliverable
+from inse.models.projects_eu_cordis.horizon2020.h2020_report_summary import H2020ReportSummary
+from inse.models.projects_eu_cordis.horizon2020.h2020_topic import H2020Topic
+from inse.models.projects_eu_cordis.horizon2020.h2020_web_link import H2020WebLink
+from inse.models.projects_eu_cordis.horizon2020.h2020_eurosci_voc import H2020EurosciVoc
+from inse.models.projects_eu_cordis.horizon2020.h2020_legal_basis import H2020LegalBasis
+from inse.models.projects_eu_cordis.horizon2020.h2020_erc_pi import H2020ErcPI
+from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails
+
+# Import Horizon Europe models
+from inse.models.projects_eu_cordis.horizon_europe.heu_project import HEUProject
+from inse.models.projects_eu_cordis.horizon_europe.heu_organization import HEUOrganization
+from inse.models.projects_eu_cordis.horizon_europe.heu_publication import HEUPublication
+from inse.models.projects_eu_cordis.horizon_europe.heu_deliverable import HEUDeliverable
+from inse.models.projects_eu_cordis.horizon_europe.heu_report_summary import HEUReportSummary
+from inse.models.projects_eu_cordis.horizon_europe.heu_topic import HEUTopic
+from inse.models.projects_eu_cordis.horizon_europe.heu_web_link import HEUWebLink
+from inse.models.projects_eu_cordis.horizon_europe.heu_eurosci_voc import HEUEurosciVoc
+from inse.models.projects_eu_cordis.horizon_europe.heu_legal_basis import HEULegalBasis
+from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails
+
+settings = get_settings()
+logger = logging.getLogger(__name__)
+logger.setLevel(settings.logging_level)
+
+# Entity config
+_FP7_ENTITY_CONFIGS = [
+ {"key": "organizations", "index_pattern": ESIndex.CORDIS_EU_FP7_ORGANIZATIONS, "model_class": Fp7Organization},
+ {"key": "publications", "index_pattern": ESIndex.CORDIS_EU_FP7_PUBLICATIONS, "model_class": Fp7Publication},
+ {"key": "iprs", "index_pattern": ESIndex.CORDIS_EU_FP7_PROJECT_IPRS, "model_class": Fp7ProjectIPR},
+ {"key": "report_summaries", "index_pattern": ESIndex.CORDIS_EU_FP7_REPORT_SUMMARIES, "model_class": Fp7ReportSummary},
+ {"key": "topics_list", "index_pattern": ESIndex.CORDIS_EU_FP7_TOPICS, "model_class": Fp7Topic},
+ {"key": "web_links", "index_pattern": ESIndex.CORDIS_EU_FP7_WEB_LINKS, "model_class": Fp7WebLink},
+ {"key": "eurosci_voc", "index_pattern": ESIndex.CORDIS_EU_FP7_EUROSCIVOC, "model_class": Fp7EurosciVoc},
+ {"key": "legal_basis_list", "index_pattern": ESIndex.CORDIS_EU_FP7_LEGAL_BASIS, "model_class": Fp7LegalBasis},
+]
+
+_H2020_ENTITY_CONFIGS = [
+ {"key": "organizations", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_ORGANIZATIONS, "model_class": H2020Organization},
+ {"key": "publications", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_PUBLICATIONS, "model_class": H2020Publication},
+ {"key": "deliverables", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_DELIVERABLES, "model_class": H2020Deliverable},
+ {"key": "report_summaries", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_REPORT_SUMMARIES, "model_class": H2020ReportSummary},
+ {"key": "topics_list", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_TOPICS, "model_class": H2020Topic},
+ {"key": "web_links", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_WEB_LINKS, "model_class": H2020WebLink},
+ {"key": "eurosci_voc", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_EUROSCIVOC, "model_class": H2020EurosciVoc},
+ {"key": "legal_basis_list", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_LEGAL_BASIS, "model_class": H2020LegalBasis},
+ {"key": "erc_principal_investigators", "index_pattern": ESIndex.CORDIS_EU_HORIZON_2020_ERC_PIS, "model_class": H2020ErcPI},
+]
+
+_HEU_ENTITY_CONFIGS = [
+ {"key": "organizations", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_ORGANIZATIONS, "model_class": HEUOrganization},
+ {"key": "publications", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_PUBLICATIONS, "model_class": HEUPublication},
+ {"key": "deliverables", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_DELIVERABLES, "model_class": HEUDeliverable},
+ {"key": "report_summaries", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_REPORT_SUMMARIES, "model_class": HEUReportSummary},
+ {"key": "topics_list", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_TOPICS, "model_class": HEUTopic},
+ {"key": "web_links", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_WEB_LINKS, "model_class": HEUWebLink},
+ {"key": "eurosci_voc", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_EUROSCIVOC, "model_class": HEUEurosciVoc},
+ {"key": "legal_basis_list", "index_pattern": ESIndex.CORDIS_EU_HORIZON_EUROPE_LEGAL_BASIS, "model_class": HEULegalBasis},
+]
+
+def get_enriched_cordis_project_by_id(
+ project_id: str,
+) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]:
+ """
+ Fetches and enriches a single Cordis EU project by its ID across all programme types.
+
+ Args:
+ project_id: The project ID to fetch.
+
+ Returns:
+ The enriched detailed project model, or None if not found.
+ """
+ if not project_id:
+ return None
+
+ query = {"bool": {"filter": [{"term": {"id": project_id}}]}}
+
+ response = elasticsearch.search(
+ query=query,
+ index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD,
+ cluster=ESCluster.INSE,
+ size=1,
+ )
+
+ hits = response.get("hits", {}).get("hits", [])
+ if not hits:
+ logger.info(f"No project found with ID: {project_id}")
+ return None
+
+ hit = hits[0]
+ index = hit.get("_index", "")
+ source = hit.get("_source", {})
+
+ program_type = _determine_program_type_from_index(index)
+
+ enrichers = {
+ "fp7": _enrich_fp7_project,
+ "h2020": _enrich_h2020_project,
+ "heu": _enrich_heu_project,
+ }
+
+ enricher = enrichers.get(program_type)
+ if enricher is None:
+ logger.warning(f"Unknown programme type for index: {index}")
+ return CordisEuProject.model_validate(source)
+
+ return enricher(project_id, source)
+
+# helpers
+def _determine_program_type_from_index(index: str) -> str:
+ """Determines the programme type from the Elasticsearch index name."""
+ index_lower = index.lower()
+ if "fp7" in index_lower:
+ return "fp7"
+ if "horizon_2020" in index_lower:
+ return "h2020"
+ if "heu" in index_lower or "horizon_europe" in index_lower:
+ return "heu"
+ return "unknown"
+
+
+def _fetch_related_entities_parallel(
+ project_id: str,
+ entity_configs: List[Dict[str, Any]],
+ max_workers: int = 8,
+) -> Dict[str, List[Any]]:
+ """
+ Fetches all related entity types for a project in parallel.
+
+ Args:
+ project_id: The project ID to fetch entities for.
+ entity_configs: List of dicts with keys 'key', 'index_pattern', 'model_class'.
+ max_workers: Maximum number of concurrent Elasticsearch requests.
+
+ Returns:
+ Dictionary mapping each config 'key' to a list of validated entities.
+ """
+ def _fetch_one(config: Dict[str, Any]):
+ entities = _fetch_related_entities(
+ project_ids=[project_id],
+ index_pattern=config["index_pattern"],
+ model_class=config["model_class"],
+ )
+ return config["key"], entities.get(project_id, [])
+
+ results: Dict[str, List[Any]] = {}
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
+ futures = {executor.submit(_fetch_one, cfg): cfg["key"] for cfg in entity_configs}
+ for future in as_completed(futures):
+ try:
+ key, data = future.result()
+ results[key] = data
+ except Exception as e:
+ key = futures[future]
+ logger.error(f"Parallel fetch failed for '{key}': {e}")
+ results[key] = []
+
+ return results
+
+
+def _fetch_related_entities(
+ project_ids: List[str],
+ index_pattern: str,
+ model_class: Any,
+) -> Dict[str, List[Any]]:
+ """
+ Fetches and groups related entities from Elasticsearch by project ID.
+
+ Args:
+ project_ids: List of project IDs to fetch entities for.
+ index_pattern: The index pattern to search (supports wildcards).
+ model_class: The Pydantic model class to validate against.
+
+ Returns:
+ Dictionary mapping project IDs to lists of validated entities.
+ """
+ query = {"bool": {"filter": [{"terms": {"projectID": project_ids}}]}}
+
+ try:
+ response = elasticsearch.search(
+ query=query,
+ index=index_pattern,
+ cluster=ESCluster.INSE,
+ size=10000,
+ )
+ except Exception as e:
+ logger.warning(f"Failed to fetch from {index_pattern}: {e}")
+ return {}
+
+ grouped: Dict[str, List[Any]] = {}
+
+ for hit in response.get("hits", {}).get("hits", []):
+ source = hit.get("_source", {})
+ project_id = source.get("projectID")
+
+ if not project_id:
+ continue
+
+ grouped.setdefault(project_id, [])
+
+ try:
+ entity = model_class.model_validate(source)
+ grouped[project_id].append(entity)
+ except Exception as e:
+ logger.warning(f"Failed to validate {model_class.__name__} for project {project_id}: {e}")
+
+ return grouped
+
+
+def _enrich_fp7_project(
+ project_id: str,
+ project_source: Dict[str, Any],
+) -> Optional[Fp7ProjectDetails]:
+ """Enriches a single FP7 project with all related data."""
+ try:
+ project = Fp7Project.model_validate(project_source)
+ except Exception as e:
+ logger.error(f"Failed to validate FP7 project {project_id}: {e}")
+ return None
+
+ related = _fetch_related_entities_parallel(project_id, _FP7_ENTITY_CONFIGS)
+
+ return Fp7ProjectDetails.from_project_with_relations(project=project, **related)
+
+
+def _enrich_h2020_project(
+ project_id: str,
+ project_source: Dict[str, Any],
+) -> Optional[H2020ProjectDetails]:
+ """Enriches a single H2020 project with all related data."""
+ try:
+ project = H2020Project.model_validate(project_source)
+ except Exception as e:
+ logger.error(f"Failed to validate H2020 project {project_id}: {e}")
+ return None
+
+ related = _fetch_related_entities_parallel(project_id, _H2020_ENTITY_CONFIGS)
+
+ return H2020ProjectDetails.from_project_with_relations(project=project, **related)
+
+
+def _enrich_heu_project(
+ project_id: str,
+ project_source: Dict[str, Any],
+) -> Optional[HEUProjectDetails]:
+ """Enriches a single Horizon Europe project with all related data."""
+ try:
+ project = HEUProject.model_validate(project_source)
+ except Exception as e:
+ logger.error(f"Failed to validate Horizon Europe project {project_id}: {e}")
+ return None
+
+ related = _fetch_related_entities_parallel(project_id, _HEU_ENTITY_CONFIGS)
+
+ return HEUProjectDetails.from_project_with_relations(project=project, **related)
\ No newline at end of file
diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py
index d0957d4d..c95ada07 100644
--- a/service/src/main/inse/projects/model.py
+++ b/service/src/main/inse/projects/model.py
@@ -9,7 +9,10 @@ from inse.models.bund_project import BundProject
from inse.models.eu_project import EuProject
from inse.models.cordis_eu_project import CordisEuProject
from inse.model import ESIndex
-
+from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails
+from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails
+from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails
+from typing import Union
class ProjectType(StrEnum):
BUND = "bund"
@@ -164,7 +167,25 @@ class CordisEuProjectPage(Page):
default_factory=list, description="The CORDIS EU projects on this page."
)
-
+class EuCordisProjectResponse(BaseModel):
+ """
+ Response model for EU Cordis project endpoints.
+ """
+ success: bool = Field(description="Indicates if the request was successful")
+ project_type: Optional[str] = Field(
+ default=None,
+ description="The type of project: 'fp7', 'h2020', or 'heu'"
+ )
+ eu_project_data: Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]] = Field(
+ default=None,
+ description="The project data"
+ )
+ error: Optional[str] = Field(
+ default=None,
+ description="Error message if the request failed"
+ )
+
+
class FundingProject(BaseModel):
type: ProjectType = Field(
description="The type of the project.",
diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py
index a53c2f1f..4cd2812a 100644
--- a/service/src/main/inse/projects/projects_search_client.py
+++ b/service/src/main/inse/projects/projects_search_client.py
@@ -3,7 +3,7 @@ import logging
from typing import Any, Dict, List, Optional, Set, Tuple
import httpx
-
+import urllib
from inse.config import get_settings
from inse.models.bund_project import BundProject
from inse.projects.model import (
@@ -22,14 +22,16 @@ from inse.projects.model import (
ProjectsSortBy,
SortDirection,
)
-
+from inse.projects.eu_cordis_projects_enrichment_client import get_enriched_cordis_project_by_id
from inse.models.dfg_project_details import DfgProjectDetails
from inse.models.bund_project_details import BundProjectDetails
from inse.models.cordis_eu_project import CordisEuProject
from inse.integrations import elasticsearch
from inse.model import ESCluster, ESIndex
-
-
+from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails
+from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails
+from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails
+from typing import Union
settings = get_settings()
logger = logging.getLogger(__name__)
@@ -193,7 +195,7 @@ def _complete_response_to_bund_project_page(
def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]:
- """Fetches the details of a single Bund project based on its project ID.
+ """Decodes project_id and fetches the details of a single Bund project based on its project ID.
Args:
project_id (str): The ID of the project to fetch.
@@ -201,7 +203,9 @@ def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]:
Returns:
Optional[BundProjectDetails]: The details of the project if found, otherwise None.
"""
- query = {"term": {"Förderkennzeichen.keyword": {"value": project_id}}}
+
+ decoded_id = urllib.parse.unquote(project_id)
+ query = {"term": {"Förderkennzeichen.keyword": {"value": decoded_id}}}
response = elasticsearch.search(
index=ESIndex.PROJECTS_BUND_V1,
@@ -557,6 +561,22 @@ def get_cordis_eu_projects_by_project_ids(
)
+def get_eu_cordis_projects_by_id(
+ project_id: str,
+) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]:
+ """
+ Fetches and enriches a single Cordis EU project by its ID.
+
+ Args:
+ project_id: The project ID to fetch
+
+ Returns:
+ The enriched project details, or None if not found
+ """
+ enriched_project = get_enriched_cordis_project_by_id(
+ project_id=project_id
+ )
+ return enriched_project
# DFG
diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py
index 509f5d8b..32f206e4 100644
--- a/service/src/main/inse/projects/router.py
+++ b/service/src/main/inse/projects/router.py
@@ -15,6 +15,7 @@ from inse.projects.model import (
ProjectsFilteringProperties,
ProjectsSortBy,
SortDirection,
+ EuCordisProjectResponse
)
from inse.models.dfg_project_details import DfgProjectDetails
from inse.models.bund_project_details import BundProjectDetails
@@ -26,6 +27,11 @@ from inse.institutions.institutions_search_client import (
)
from inse.institutions.router import get_institutions_search_client
+from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails
+from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails
+from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails
+from typing import Union
+
logger = logging.getLogger(__name__)
router = APIRouter(prefix="/api/projects", tags=[Tags.PROJECTS])
@@ -131,6 +137,85 @@ def get_single_bund_project(
)
+@router.get(
+ "/eu/{id}",
+ summary="Get a single EU Cordis project.",
+ description="Returns a single EU Cordis project based on its ID.",
+ operation_id="getSingleEuCordisProject",
+ responses={
+ status.HTTP_200_OK: {
+ "description": "Successful Response",
+ "model": EuCordisProjectResponse,
+ },
+ status.HTTP_404_NOT_FOUND: {
+ "description": "Project not found",
+ "model": EuCordisProjectResponse
+ },
+ status.HTTP_500_INTERNAL_SERVER_ERROR: {
+ "description": "Internal server error",
+ "model": EuCordisProjectResponse
+ }
+ },
+)
+
+
+def get_single_eu_cordis_project(
+ id: Annotated[str, Path(description="The ID of the EU Cordis project to retrieve.")],
+) -> EuCordisProjectResponse:
+ """
+ Get a single EU Cordis project by ID.
+ Returns a wrapper response containing the project data or error information.
+ """
+ logger.debug(f"Received request to get single EU Cordis project for id={id}")
+
+ try:
+ # Get the project from the service
+ project = projects_service.get_single_eu_cordis_project(project_id=id)
+
+ # Check if project exists
+ if project is None:
+ logger.warning(f"Project with ID {id} not found")
+ return EuCordisProjectResponse(
+ success=False,
+ project_type=None,
+ eu_project_data=None,
+ error=f"Project with ID {id} not found"
+ )
+
+ # Determine the project type
+ if isinstance(project, Fp7ProjectDetails):
+ project_type = "fp7"
+ elif isinstance(project, H2020ProjectDetails):
+ project_type = "h2020"
+ elif isinstance(project, HEUProjectDetails):
+ project_type = "heu"
+ else:
+ # Unknown project type - maybe it's the base CordisEuProject
+ logger.warning(f"Unknown project type for ID {id}: {type(project)}")
+ return EuCordisProjectResponse(
+ success=False,
+ project_type=None,
+ eu_project_data=None,
+ error=f"Unknown project type for ID {id}"
+ )
+
+ # Return success with the project data
+ return EuCordisProjectResponse(
+ success=True,
+ project_type=project_type,
+ eu_project_data=project,
+ error=None
+ )
+
+ except Exception as e:
+ logger.error(f"Error retrieving project with ID {id}: {str(e)}", exc_info=True)
+ return EuCordisProjectResponse(
+ success=False,
+ project_type=None,
+ data=None,
+ error=f"Internal server error: {str(e)}"
+ )
+
@router.get(
"/institution/bund/funding-over-time",
summary="Get funding over time for bund projects.",
diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py
index 75c72e0e..955d8289 100644
--- a/service/src/main/inse/projects/service.py
+++ b/service/src/main/inse/projects/service.py
@@ -17,6 +17,7 @@ from inse.projects.model import (
ProjectsFilteringProperties,
ProjectsSortBy,
SortDirection,
+ CordisEuProject
)
from inse.models.dfg_project_details import DfgProjectDetails
from inse.models.bund_project_details import BundProjectDetails
@@ -26,7 +27,10 @@ from inse.institutions.institutions_search_client import (
from inse.exceptions import NotFoundException
from inse.persons.logic import get_author_name_by_id
from inse.works.logic import get_publication_dois_of_author
-
+from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails
+from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails
+from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails
+from typing import Union
logger = logging.getLogger(__name__)
@@ -322,6 +326,15 @@ def get_single_bund_project(
raise NotFoundException(f"BUND project with id {project_id} not found")
return project
+def get_single_eu_cordis_project(
+ project_id: str,
+) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]:
+ logger.debug(f"Fetching single EU Cordis project for id={project_id}")
+
+ project = projects_search_client.get_eu_cordis_projects_by_id(project_id)
+ if not project:
+ raise NotFoundException(f"EU project with id {project_id} not found")
+ return project
def search_cordis_eu_projects_for_author_id(
raw_oa_author_id: str,
@@ -347,3 +360,4 @@ def search_cordis_eu_projects_for_author_id(
)
return funding_project_page
+
diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py
index 9d5918cf..7b3ed7a0 100644
--- a/service/src/main/inse/works/logic.py
+++ b/service/src/main/inse/works/logic.py
@@ -197,27 +197,18 @@ def _get_primary_topic_counts_from_es(author_id: str) -> list[dict]:
async def get_work(
work_id: str,
+ title:str,
client: OpenAlexWorksSearchClient | None = None,
-) -> Work:
+) -> Work | None:
search_client = client or OpenAlexWorksSearchClient()
- try:
- data = await search_client.search_work(work_id)
- except MissingApiKeyError as exc:
- raise HTTPException(
- status_code=HTTP_503_SERVICE_UNAVAILABLE,
- detail="OpenAlex works search is not configured.",
- ) from exc
- except httpx.HTTPError as exc:
- raise HTTPException(
- status_code=HTTP_502_BAD_GATEWAY,
- detail="OpenAlex works search request failed.",
- ) from exc
+
+ data = await search_client.search_work(work_id)
elements, _ = _parse_full_work_search_response(data)
+ if (not elements) and title:
+ response_by_title = await search_client.search_for_work_by_title(title=title)
+ elements, _ = _parse_full_work_search_response(response_by_title)
if not elements:
- raise HTTPException(
- status_code=HTTP_404_NOT_FOUND,
- detail="Publication not found.",
- )
+ return None
return elements[0]
diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py
index fe60c665..93188678 100644
--- a/service/src/main/inse/works/search_client.py
+++ b/service/src/main/inse/works/search_client.py
@@ -7,10 +7,10 @@ import logging
from typing import Any
import httpx
-
+import urllib
from .. import config
-
-
+from inse.integrations import elasticsearch
+from inse.model import ESCluster, ESIndex
class MissingApiKeyError(Exception):
pass
@@ -164,23 +164,62 @@ class OpenAlexWorksSearchClient:
response.raise_for_status()
return response.json()
- async def search_work(self, work_id: str) -> dict[str, Any]:
+
+ async def search_work(self, identifier: str) -> dict[str, Any]:
+ if not self.api_key:
+ raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.")
+ decoded_id = urllib.parse.unquote(identifier)
+ body = {
+ "query": {
+ "bool": {
+ "should": [
+ {
+ "term": {
+ "_id": {
+ "value": decoded_id,
+ "boost": 5
+ }
+ }
+ },
+ {
+ "term": {
+ "doi": {
+ "value": "https://doi.org/" + decoded_id.lower(),
+ "boost": 3
+ }
+ }
+ }
+ ],
+ "minimum_should_match": 1
+ }
+ }
+ }
+ print(body)
+ response = elasticsearch.search(index=f'{ESIndex.OPENALEX_WORKS}*',body=body,cluster=ESCluster.NES,size=1)
+ return response
+
+ async def search_for_work_by_title(
+ self,
+ title: str,
+ ) -> dict[str, Any]:
if not self.api_key:
raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.")
- indexed_work_id = f"https://openalex.org/{work_id.strip().split('/')[-1]}"
- async with httpx.AsyncClient(
- base_url=self.base_url,
- timeout=self.timeout,
- transport=self.transport,
- ) as client:
- response = await client.post(
- f"/{self.index}/_search",
- headers={"Authorization": f"ApiKey {self.api_key}"},
- json={
- "size": 1,
- "query": {"term": {"id": indexed_work_id}},
+ query_clauses = [
+ {"match_phrase": {"title": title}},
+ ]
+
+ body = {
+ "query": {
+ "bool": {
+ "must": query_clauses,
},
- )
- response.raise_for_status()
- return response.json()
+ },
+ "sort": [
+ {"publication_year": {"order": "desc", "missing": "_last"}},
+ {"cited_by_count": {"order": "desc", "missing": "_last"}},
+ ],
+ }
+ response = elasticsearch.search(index=f'{ESIndex.OPENALEX_WORKS}*',body=body,cluster=ESCluster.NES,size=1)
+
+ return response
\ No newline at end of file
diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py
index e0d84c57..a474d262 100644
--- a/service/src/main/inse/works/service.py
+++ b/service/src/main/inse/works/service.py
@@ -4,7 +4,7 @@
REST API for publication works.
"""
-from typing import Annotated
+from typing import Annotated, Optional
from fastapi import APIRouter
from fastapi import Depends
@@ -123,17 +123,20 @@ async def get_topics_by_time_by_author(
@router.get(
- "/detail/{work_id}",
+ "/detail/{identifier}",
operation_id="getWork",
- response_model=Work,
- summary="Returns one publication.",
+ response_model=Work | None,
+ summary="Returns one publication by OpenAlex ID or DOI.",
)
-async def get_work(
- work_id: Annotated[
- str, Path(description="The OpenAlex work id, for example W2741809807.")
+async def get_work_by_identifier(
+ identifier: Annotated[
+ str, Path(description="The OpenAlex work id (e.g., W2741809807) or DOI number of the publication.")
],
+ title: Annotated[
+ Optional[str], Query(description="Do we want to fallback to title search if ID and DOI dont work?")
+ ] = "",
principal: security.Principal = Depends(
security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])
),
):
- return await logic.get_work(work_id)
+ return await logic.get_work(identifier,title=title)
\ No newline at end of file
diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES
index 0a468ed3..9a1f5c93 100644
--- a/webapp/src/app/api/.openapi-generator/FILES
+++ b/webapp/src/app/api/.openapi-generator/FILES
@@ -22,6 +22,7 @@ encoder.ts
git_push.sh
index.ts
model/accessGrant.ts
+model/allPatentsResponse.ts
model/authAccount.ts
model/authScope.ts
model/author.ts
@@ -61,16 +62,46 @@ model/dehydratedSource.ts
model/dfgProjectDetails.ts
model/dfgProjectPage.ts
model/dfgProjectSummary.ts
+model/euCordisProjectResponse.ts
model/euOrganizationProjectSummary.ts
model/euOrganizationProjectSummaryPage.ts
+model/euProjectData.ts
model/filterInformation.ts
model/filterProperties.ts
+model/fp7EurosciVoc.ts
+model/fp7LegalBasis.ts
+model/fp7Organization.ts
+model/fp7ProjectDetails.ts
+model/fp7ProjectIPR.ts
+model/fp7Publication.ts
+model/fp7ReportSummary.ts
+model/fp7Topic.ts
+model/fp7WebLink.ts
model/funderByAuthor.ts
model/fundersByAuthorResponse.ts
model/fundingProject.ts
model/fundingProjectPage.ts
model/fwci.ts
model/groupByResult.ts
+model/h2020Deliverable.ts
+model/h2020ErcPI.ts
+model/h2020EurosciVoc.ts
+model/h2020LegalBasis.ts
+model/h2020Organization.ts
+model/h2020ProjectDetails.ts
+model/h2020Publication.ts
+model/h2020ReportSummary.ts
+model/h2020Topic.ts
+model/h2020WebLink.ts
+model/hEUDeliverable.ts
+model/hEUEurosciVoc.ts
+model/hEULegalBasis.ts
+model/hEUOrganization.ts
+model/hEUProjectDetails.ts
+model/hEUPublication.ts
+model/hEUReportSummary.ts
+model/hEUTopic.ts
+model/hEUWebLink.ts
model/hTTPValidationError.ts
model/identityGrant.ts
model/institution.ts
@@ -81,6 +112,7 @@ model/institutionInformation.ts
model/institutionNetworkNode.ts
model/institutionPage.ts
model/institutionsListResponse.ts
+model/ipcClassification.ts
model/item.ts
model/itemCreate.ts
model/itemPage.ts
diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts
index 69026ffa..d08ec699 100644
--- a/webapp/src/app/api/api/patents.service.ts
+++ b/webapp/src/app/api/api/patents.service.ts
@@ -1,166 +1,431 @@
-import { Inject, Injectable, Optional } from '@angular/core';
-import {
- HttpClient,
- HttpHeaders,
- HttpParams,
- HttpResponse,
- HttpEvent,
- HttpContext,
-} from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-import { BaseService } from '../api.base.service';
-import { PatentEntry } from '../model/patentEntry';
-import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse';
-
-
-
-
-
-
-
-export interface AllPatentsResponse {
- total: number;
- page: number;
- size: number;
- patents: PatentEntry[];
-}
-
-type GetPatentsByAuthorOptions = {
- httpHeaderAccept?: 'application/json';
- context?: HttpContext;
- transferCache?: boolean;
-};
-
-@Injectable({
- providedIn: 'root',
-})
-export class PatentsService extends BaseService {
- constructor(
- protected httpClient: HttpClient,
- @Optional() @Inject(BASE_PATH) basePath: string | string[],
- @Optional() configuration?: Configuration,
- ) {
- super(basePath, configuration);
- }
-
- public getPatentsByAuthor(
- authorId: string,
- observe?: 'body',
- reportProgress?: boolean,
- options?: GetPatentsByAuthorOptions,
- ): ObservableAnmelder
Klassifikation (IPC)
Klassifikation (IPC)
Klassifikation (CPC)
Klassifikation (CPC)
-
-
+ {{ + getFrameworkDisplay(euProject.frameworkProgramme) + }} +
+ } +{{ euProject.objective }}
+EU Projekt nicht gefunden.
+| Name | +
+
+ {{
+ org.name || org.shortName || 'Unbekannte Organisation'
+ }}
+
+ |
+ Rolle | ++ @if (org.role) { + {{ org.role }} + } @else { + — + } + | +Stadt | +
+ @if (org.city) {
+
+ {{ org.city }}
+
+ |
+ EU-Beitrag | ++ @if (org.ecContribution) { + {{ + formatCurr(org.ecContribution) + }} + } @else { + — + } + | +Aktivitätstyp | ++ @if (org.activityType) { + {{ org.activityType }} + } @else { + — + } + | +SME | ++ @if (org.sme) { + SME + } @else { + — + } + | +URL | +
+
+ @if (org.organizationURL) {
+
+
+ |
+
|---|
| Titel | +
+
+
+ {{ pub.title || 'Kein Titel' }}
+
+
+ |
+ Autoren | ++ @if (pub.authors) { + @let authorList = parseAuthors(pub.authors); + @if (authorList.length > 0) { + + } @else { + — + } + } @else { + — + } + | +Zeitschrift | ++ @if (pub.journalNumber) { + {{ pub.journalNumber }} + } @else { + — + } + | +Jahr | ++ @if (pub.publishedYear) { + {{ pub.publishedYear }} + } @else { + — + } + | +Verlag | ++ @if (pub.publisher) { + {{ pub.publisher }} + } @else { + — + } + | +Links | +
+
+ @if (pub.doi) {
+
+
+ |
+
|---|