feature/dfg-details #159

Merged
genja merged 46 commits from feature/dfg-details into dev 2026-06-26 01:42:42 +02:00
106 changed files with 9521 additions and 380 deletions
+39 -5
View File
@@ -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"
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"
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,
)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,
)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,
)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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()
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}},
}
+23
View File
@@ -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,
+24 -3
View File
@@ -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,
)
)
@@ -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
@@ -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)
+23 -2
View File
@@ -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.",
@@ -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
+85
View File
@@ -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.",
+15 -1
View File
@@ -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
+8 -17
View File
@@ -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]
+58 -19
View File
@@ -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
+11 -8
View File
@@ -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)
@@ -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
+431 -166
View File
@@ -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,
): Observable<PatentsByAuthorResponse>;
public getPatentsByAuthor(
authorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: GetPatentsByAuthorOptions,
): Observable<HttpResponse<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: GetPatentsByAuthorOptions,
): Observable<HttpEvent<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: GetPatentsByAuthorOptions,
): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error(
'Required parameter authorId was null or undefined when calling getPatentsByAuthor.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam(
{
name: 'authorId',
value: authorId,
in: 'path',
style: 'simple',
explode: false,
dataType: 'string',
dataFormat: undefined,
},
)}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
public getAllPatents(
page: number = 0,
size: number = 10,
search?: string,
source?: string,
sortBy: string = 'date',
sortDirection: string = 'desc',
): Observable<AllPatentsResponse> {
let params = new HttpParams()
.set('page', String(page))
.set('size', String(size))
.set('sort_by', sortBy)
.set('sort_direction', sortDirection);
if (search) params = params.set('search', search);
if (source) params = params.set('source', source);
const localVarHeaders = this.defaultHeaders;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.get<AllPatentsResponse>(
`${basePath}/api/inse-service/patents`,
{
params,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
},
);
}
}
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AllPatentsResponse } from '../model/allPatentsResponse';
// @ts-ignore
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { PatentEntry } from '../model/patentEntry';
// @ts-ignore
import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@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);
}
/**
* Get all patents with pagination and search.
* @endpoint get /api/inse-service/patents
* @param page
* @param size
* @param search
* @param source
* @param sortBy
* @param sortDirection
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<AllPatentsResponse>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<AllPatentsResponse>>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<AllPatentsResponse>>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>page,
'page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>size,
'size',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>search,
'search',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>source,
'source',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortBy,
'sort_by',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortDirection,
'sort_direction',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AllPatentsResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns one publication by OpenAlex ID or DOI.
* @endpoint get /api/inse-service/patents/{identifier}
* @param identifier
* @param prefix Application Prefix (EP or US)
* @param title Do we want to fallback to title search if ID and DOI dont work?
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PatentEntry>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PatentEntry>>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PatentEntry>>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (identifier === null || identifier === undefined) {
throw new Error(
'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>prefix,
'prefix',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>title,
'title',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentEntry>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get patents matched to an author by name.
* @endpoint get /api/inse-service/authors/{author_id}/patents
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentsByAuthor(
authorId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PatentsByAuthorResponse>;
public getPatentsByAuthor(
authorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error(
'Required parameter authorId was null or undefined when calling getPatentsByAuthor.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+105
View File
@@ -33,6 +33,8 @@ import { DfgProjectDetails } from '../model/dfgProjectDetails';
// @ts-ignore
import { DfgProjectPage } from '../model/dfgProjectPage';
// @ts-ignore
import { EuCordisProjectResponse } from '../model/euCordisProjectResponse';
// @ts-ignore
import { EuOrganizationProjectSummaryPage } from '../model/euOrganizationProjectSummaryPage';
// @ts-ignore
import { FundingProjectPage } from '../model/fundingProjectPage';
@@ -758,6 +760,109 @@ export class ProjectsService extends BaseService {
);
}
/**
* Get a single EU Cordis project.
* Returns a single EU Cordis project based on its ID.
* @endpoint get /api/projects/eu/{id}
* @param id The ID of the EU Cordis project to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getSingleEuCordisProject(
id: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<EuCordisProjectResponse>;
public getSingleEuCordisProject(
id: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<EuCordisProjectResponse>>;
public getSingleEuCordisProject(
id: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<EuCordisProjectResponse>>;
public getSingleEuCordisProject(
id: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (id === null || id === undefined) {
throw new Error(
'Required parameter id was null or undefined when calling getSingleEuCordisProject.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/projects/eu/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<EuCordisProjectResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get bund projects.
* Returns a page of bund projects based on the provided pagination parameters and optional institution filter.
+23 -10
View File
@@ -619,14 +619,16 @@ export class WorksService extends BaseService {
}
/**
* Returns one publication.
* @endpoint get /api/works/detail/{work_id}
* @param workId The OpenAlex work id, for example W2741809807.
* Returns one publication by OpenAlex ID or DOI.
* @endpoint get /api/works/detail/{identifier}
* @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication.
* @param title Do we want to fallback to title search if ID and DOI dont work?
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getWork(
workId: string,
identifier: string,
title?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
@@ -636,7 +638,8 @@ export class WorksService extends BaseService {
},
): Observable<Work>;
public getWork(
workId: string,
identifier: string,
title?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
@@ -646,7 +649,8 @@ export class WorksService extends BaseService {
},
): Observable<HttpResponse<Work>>;
public getWork(
workId: string,
identifier: string,
title?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
@@ -656,7 +660,8 @@ export class WorksService extends BaseService {
},
): Observable<HttpEvent<Work>>;
public getWork(
workId: string,
identifier: string,
title?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
@@ -665,12 +670,19 @@ export class WorksService extends BaseService {
transferCache?: boolean;
},
): Observable<any> {
if (workId === null || workId === undefined) {
if (identifier === null || identifier === undefined) {
throw new Error(
'Required parameter workId was null or undefined when calling getWork.',
'Required parameter identifier was null or undefined when calling getWork.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>title,
'title',
);
let localVarHeaders = this.defaultHeaders;
// authentication (bearer) required
@@ -709,10 +721,11 @@ export class WorksService extends BaseService {
}
}
let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'workId', value: workId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Work>('get', `${basePath}${localVarPath}`, {
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
@@ -0,0 +1,19 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { PatentEntry } from './patentEntry';
export interface AllPatentsResponse {
total: number;
page: number;
size: number;
patents: Array<PatentEntry>;
}
@@ -0,0 +1,25 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { EuProjectData } from './euProjectData';
/**
* Response model for EU Cordis project endpoints.
*/
export interface EuCordisProjectResponse {
/**
* Indicates if the request was successful
*/
success: boolean;
project_type?: string | null;
eu_project_data?: EuProjectData | null;
error?: string | null;
}
+71
View File
@@ -0,0 +1,71 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { H2020ProjectDetails } from './h2020ProjectDetails';
import { Fp7ProjectDetails } from './fp7ProjectDetails';
import { HEUOrganization } from './hEUOrganization';
import { HEUPublication } from './hEUPublication';
import { Fp7WebLink } from './fp7WebLink';
import { HEUWebLink } from './hEUWebLink';
import { HEUDeliverable } from './hEUDeliverable';
import { Fp7ProjectIPR } from './fp7ProjectIPR';
import { HEUEurosciVoc } from './hEUEurosciVoc';
import { H2020ErcPI } from './h2020ErcPI';
import { HEULegalBasis } from './hEULegalBasis';
import { HEUTopic } from './hEUTopic';
import { Fp7ReportSummary } from './fp7ReportSummary';
import { HEUReportSummary } from './hEUReportSummary';
import { HEUProjectDetails } from './hEUProjectDetails';
/**
* The project data
*/
export interface EuProjectData {
acronym?: string;
contentUpdateDate?: string;
ecMaxContribution?: number;
ecSignatureDate?: string;
endDate?: string;
frameworkProgramme?: string;
fundingScheme?: string;
grantDoi?: string;
humanValidated?: boolean;
id?: string;
keywords?: string;
legalBasis?: string;
masterCall?: string;
nature?: string;
objective?: string;
rcn?: string;
startDate?: string;
status?: string;
subCall?: string;
title?: string;
topics?: string;
totalCost?: number;
organizations?: Array<HEUOrganization>;
publications?: Array<HEUPublication>;
iprs?: Array<Fp7ProjectIPR>;
report_summaries?: Array<Fp7ReportSummary>;
topicsList?: Array<HEUTopic>;
web_links?: Array<Fp7WebLink>;
eurosciVoc?: Array<HEUEurosciVoc>;
legalBasisList?: Array<HEULegalBasis>;
organizationCount?: number;
publicationCount?: number;
iprCount?: number;
deliverables?: Array<HEUDeliverable>;
reportSummaries?: Array<HEUReportSummary>;
webLinks?: Array<HEUWebLink>;
ercPrincipalInvestigators?: Array<H2020ErcPI>;
deliverableCount?: number;
ercPiCount?: number;
}
+23
View File
@@ -0,0 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7EurosciVoc
*/
export interface Fp7EurosciVoc {
code?: string | null;
description?: string | null;
id?: string | null;
path?: string | null;
projectID?: string | null;
title?: string | null;
}
+22
View File
@@ -0,0 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7LegalBasis
*/
export interface Fp7LegalBasis {
id?: string | null;
legalBasis?: string | null;
projectID?: string | null;
title?: string | null;
uniqueProgrammePart?: string | null;
}
@@ -0,0 +1,43 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7Organization
*/
export interface Fp7Organization {
SME?: boolean | null;
active?: boolean | null;
activityType?: string | null;
city?: string | null;
contactForm?: string | null;
contentUpdateDate?: string | null;
country?: string | null;
ecContribution?: number | null;
endOfParticipation?: boolean | null;
geolocation?: string | null;
id?: string | null;
name?: string | null;
netEcContribution?: number | null;
nutsCode?: string | null;
order?: number | null;
organisationID?: string | null;
organizationURL?: string | null;
postCode?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
role?: string | null;
shortName?: string | null;
street?: string | null;
totalCost?: number | null;
vatNumber?: string | null;
}
@@ -0,0 +1,58 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Fp7EurosciVoc } from './fp7EurosciVoc';
import { Fp7WebLink } from './fp7WebLink';
import { Fp7Publication } from './fp7Publication';
import { Fp7ReportSummary } from './fp7ReportSummary';
import { Fp7Topic } from './fp7Topic';
import { Fp7ProjectIPR } from './fp7ProjectIPR';
import { Fp7Organization } from './fp7Organization';
import { Fp7LegalBasis } from './fp7LegalBasis';
/**
* Comprehensive FP7 Project model combining all related entities. This model extends the base Fp7Project with all associated data.
*/
export interface Fp7ProjectDetails {
acronym?: string | null;
contentUpdateDate?: string | null;
ecMaxContribution?: number | null;
ecSignatureDate?: string | null;
endDate?: string | null;
frameworkProgramme?: string | null;
fundingScheme?: string | null;
grantDoi?: string | null;
humanValidated?: boolean | null;
id?: string | null;
keywords?: string | null;
legalBasis?: string | null;
masterCall?: string | null;
nature?: string | null;
objective?: string | null;
rcn?: string | null;
startDate?: string | null;
status?: string | null;
subCall?: string | null;
title?: string | null;
topics?: string | null;
totalCost?: number | null;
organizations?: Array<Fp7Organization> | null;
publications?: Array<Fp7Publication> | null;
iprs?: Array<Fp7ProjectIPR> | null;
report_summaries?: Array<Fp7ReportSummary> | null;
topicsList?: Array<Fp7Topic> | null;
web_links?: Array<Fp7WebLink> | null;
eurosciVoc?: Array<Fp7EurosciVoc> | null;
legalBasisList?: Array<Fp7LegalBasis> | null;
organizationCount?: number | null;
publicationCount?: number | null;
iprCount?: number | null;
}
+36
View File
@@ -0,0 +1,36 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7ProjectIPR
*/
export interface Fp7ProjectIPR {
applicantName?: string | null;
applicationDate?: string | null;
applicationIdentifier?: string | null;
applicationKind?: string | null;
applicationPrefix?: string | null;
awardDate?: string | null;
awardIdentifier?: string | null;
awardKind?: string | null;
awardPrefix?: string | null;
epoAppUrl?: string | null;
epoPubUrl?: string | null;
id?: string | null;
organisationID?: string | null;
patentFamilyIdentifier?: string | null;
patentType?: string | null;
priorityDate?: string | null;
projectID?: string | null;
title?: string | null;
type?: string | null;
}
@@ -0,0 +1,35 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7Publication
*/
export interface Fp7Publication {
authors?: string | null;
collection?: string | null;
contentUpdateDate?: string | null;
doi?: string | null;
id?: string | null;
isPublishedAs?: string | null;
journalNumber?: string | null;
journalTitle?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
publishedPages?: string | null;
publishedYear?: number | null;
publisher?: string | null;
qaProcessedDoi?: string | null;
rcn?: string | null;
repositoryUrl?: string | null;
title?: string | null;
volume?: string | null;
}
@@ -0,0 +1,24 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7ReportSummary
*/
export interface Fp7ReportSummary {
attachments?: string | null;
contentUpdateDate?: string | null;
id?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
title?: string | null;
}
+21
View File
@@ -0,0 +1,21 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7Topic
*/
export interface Fp7Topic {
id?: string | null;
projectID?: string | null;
title?: string | null;
topic?: string | null;
}
+27
View File
@@ -0,0 +1,27 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Fp7WebLink
*/
export interface Fp7WebLink {
archivedDate?: string | null;
availableLanguages?: string | null;
id?: string | null;
linkId?: string | null;
projectID?: string | null;
represents?: string | null;
source?: string | null;
status?: string | null;
type?: string | null;
url?: string | null;
}
@@ -0,0 +1,25 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020Deliverable
*/
export interface H2020Deliverable {
collection?: string | null;
contentUpdateDate?: string | null;
deliverableType?: string | null;
description?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
url?: string | null;
}
+25
View File
@@ -0,0 +1,25 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020ErcPI
*/
export interface H2020ErcPI {
firstName?: string | null;
fundingScheme?: string | null;
id?: string | null;
lastName?: string | null;
organisationID?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
title?: string | null;
}
@@ -0,0 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020EurosciVoc
*/
export interface H2020EurosciVoc {
code?: string | null;
description?: string | null;
id?: string | null;
path?: string | null;
projectID?: string | null;
title?: string | null;
}
@@ -0,0 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020LegalBasis
*/
export interface H2020LegalBasis {
id?: string | null;
legalBasis?: string | null;
projectID?: string | null;
title?: string | null;
uniqueProgrammePart?: string | null;
}
@@ -0,0 +1,43 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020Organization
*/
export interface H2020Organization {
SME?: boolean | null;
active?: boolean | null;
activityType?: string | null;
city?: string | null;
contactForm?: string | null;
contentUpdateDate?: string | null;
country?: string | null;
ecContribution?: number | null;
endOfParticipation?: boolean | null;
geolocation?: string | null;
id?: string | null;
name?: string | null;
netEcContribution?: number | null;
nutsCode?: string | null;
order?: number | null;
organisationID?: string | null;
organizationURL?: string | null;
postCode?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
role?: string | null;
shortName?: string | null;
street?: string | null;
totalCost?: number | null;
vatNumber?: string | null;
}
@@ -0,0 +1,61 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { H2020LegalBasis } from './h2020LegalBasis';
import { H2020ErcPI } from './h2020ErcPI';
import { H2020Deliverable } from './h2020Deliverable';
import { H2020WebLink } from './h2020WebLink';
import { H2020Publication } from './h2020Publication';
import { H2020ReportSummary } from './h2020ReportSummary';
import { H2020Topic } from './h2020Topic';
import { H2020EurosciVoc } from './h2020EurosciVoc';
import { H2020Organization } from './h2020Organization';
/**
* Comprehensive Horizon 2020 Project model combining all related entities. This model extends the base H2020Project with all associated data.
*/
export interface H2020ProjectDetails {
acronym?: string | null;
contentUpdateDate?: string | null;
ecMaxContribution?: number | null;
ecSignatureDate?: string | null;
endDate?: string | null;
frameworkProgramme?: string | null;
fundingScheme?: string | null;
grantDoi?: string | null;
humanValidated?: boolean | null;
id?: string | null;
keywords?: string | null;
legalBasis?: string | null;
masterCall?: string | null;
nature?: string | null;
objective?: string | null;
rcn?: string | null;
startDate?: string | null;
status?: string | null;
subCall?: string | null;
title?: string | null;
topics?: string | null;
totalCost?: number | null;
organizations?: Array<H2020Organization> | null;
publications?: Array<H2020Publication> | null;
deliverables?: Array<H2020Deliverable> | null;
reportSummaries?: Array<H2020ReportSummary> | null;
topicsList?: Array<H2020Topic> | null;
webLinks?: Array<H2020WebLink> | null;
eurosciVoc?: Array<H2020EurosciVoc> | null;
legalBasisList?: Array<H2020LegalBasis> | null;
ercPrincipalInvestigators?: Array<H2020ErcPI> | null;
organizationCount?: number | null;
publicationCount?: number | null;
deliverableCount?: number | null;
ercPiCount?: number | null;
}
@@ -0,0 +1,35 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020Publication
*/
export interface H2020Publication {
authors?: string | null;
collection?: string | null;
contentUpdateDate?: string | null;
doi?: string | null;
id?: string | null;
isPublishedAs?: string | null;
journalNumber?: string | null;
journalTitle?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
publishedPages?: string | null;
publishedYear?: number | null;
publisher?: string | null;
qaProcessedDoi?: string | null;
rcn?: string | null;
repositoryUrl?: string | null;
title?: string | null;
volume?: string | null;
}
@@ -0,0 +1,24 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020ReportSummary
*/
export interface H2020ReportSummary {
attachments?: string | null;
contentUpdateDate?: string | null;
id?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
title?: string | null;
}
+21
View File
@@ -0,0 +1,21 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020Topic
*/
export interface H2020Topic {
id?: string | null;
projectID?: string | null;
title?: string | null;
topic?: string | null;
}
+27
View File
@@ -0,0 +1,27 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* H2020WebLink
*/
export interface H2020WebLink {
archivedDate?: string | null;
availableLanguages?: string | null;
id?: string | null;
linkId?: string | null;
projectID?: string | null;
represents?: string | null;
source?: string | null;
status?: string | null;
type?: string | null;
url?: string | null;
}
@@ -0,0 +1,25 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUDeliverable
*/
export interface HEUDeliverable {
collection?: string | null;
contentUpdateDate?: string | null;
deliverableType?: string | null;
description?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
url?: string | null;
}
+23
View File
@@ -0,0 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUEurosciVoc
*/
export interface HEUEurosciVoc {
code?: string | null;
description?: string | null;
id?: string | null;
path?: string | null;
projectID?: string | null;
title?: string | null;
}
+22
View File
@@ -0,0 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEULegalBasis
*/
export interface HEULegalBasis {
id?: string | null;
legalBasis?: string | null;
projectID?: string | null;
title?: string | null;
uniqueProgrammePart?: string | null;
}
@@ -0,0 +1,43 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUOrganization
*/
export interface HEUOrganization {
SME?: boolean | null;
active?: boolean | null;
activityType?: string | null;
city?: string | null;
contactForm?: string | null;
contentUpdateDate?: string | null;
country?: string | null;
ecContribution?: number | null;
endOfParticipation?: boolean | null;
geolocation?: string | null;
id?: string | null;
name?: string | null;
netEcContribution?: number | null;
nutsCode?: string | null;
order?: number | null;
organisationID?: string | null;
organizationURL?: string | null;
postCode?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
role?: string | null;
shortName?: string | null;
street?: string | null;
totalCost?: number | null;
vatNumber?: string | null;
}
@@ -0,0 +1,58 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { HEULegalBasis } from './hEULegalBasis';
import { HEUOrganization } from './hEUOrganization';
import { HEUTopic } from './hEUTopic';
import { HEUPublication } from './hEUPublication';
import { HEUWebLink } from './hEUWebLink';
import { HEUReportSummary } from './hEUReportSummary';
import { HEUDeliverable } from './hEUDeliverable';
import { HEUEurosciVoc } from './hEUEurosciVoc';
/**
* Comprehensive Horizon Europe Project model combining all related entities. This model extends the base HEUProject with all associated data.
*/
export interface HEUProjectDetails {
acronym?: string | null;
contentUpdateDate?: string | null;
ecMaxContribution?: number | null;
ecSignatureDate?: string | null;
endDate?: string | null;
frameworkProgramme?: string | null;
fundingScheme?: string | null;
grantDoi?: string | null;
humanValidated?: boolean | null;
id?: string | null;
keywords?: string | null;
legalBasis?: string | null;
masterCall?: string | null;
nature?: string | null;
objective?: string | null;
rcn?: string | null;
startDate?: string | null;
status?: string | null;
subCall?: string | null;
title?: string | null;
topics?: string | null;
totalCost?: number | null;
organizations?: Array<HEUOrganization> | null;
publications?: Array<HEUPublication> | null;
deliverables?: Array<HEUDeliverable> | null;
reportSummaries?: Array<HEUReportSummary> | null;
topicsList?: Array<HEUTopic> | null;
webLinks?: Array<HEUWebLink> | null;
eurosciVoc?: Array<HEUEurosciVoc> | null;
legalBasisList?: Array<HEULegalBasis> | null;
organizationCount?: number | null;
publicationCount?: number | null;
deliverableCount?: number | null;
}
@@ -0,0 +1,35 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUPublication
*/
export interface HEUPublication {
authors?: string | null;
collection?: string | null;
contentUpdateDate?: string | null;
doi?: string | null;
id?: string | null;
isPublishedAs?: string | null;
journalNumber?: string | null;
journalTitle?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
publishedPages?: string | null;
publishedYear?: number | null;
publisher?: string | null;
qaProcessedDoi?: string | null;
rcn?: string | null;
repositoryUrl?: string | null;
title?: string | null;
volume?: string | null;
}
@@ -0,0 +1,24 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUReportSummary
*/
export interface HEUReportSummary {
attachments?: string | null;
contentUpdateDate?: string | null;
id?: string | null;
projectAcronym?: string | null;
projectID?: string | null;
rcn?: string | null;
title?: string | null;
}
+21
View File
@@ -0,0 +1,21 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUTopic
*/
export interface HEUTopic {
id?: string | null;
projectID?: string | null;
title?: string | null;
topic?: string | null;
}
+27
View File
@@ -0,0 +1,27 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* HEUWebLink
*/
export interface HEUWebLink {
archivedDate?: string | null;
availableLanguages?: string | null;
id?: string | null;
linkId?: string | null;
projectID?: string | null;
represents?: string | null;
source?: string | null;
status?: string | null;
type?: string | null;
url?: string | null;
}
@@ -0,0 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface IpcClassification {
symbol: string;
section?: string | null;
'class'?: string | null;
subclass?: string | null;
main_group?: string | null;
subgroup?: string | null;
}
+30
View File
@@ -38,16 +38,45 @@ export * from './dehydratedSource';
export * from './dfgProjectDetails';
export * from './dfgProjectPage';
export * from './dfgProjectSummary';
export * from './euCordisProjectResponse';
export * from './euOrganizationProjectSummary';
export * from './euOrganizationProjectSummaryPage';
export * from './filterInformation';
export * from './filterProperties';
export * from './fp7EurosciVoc';
export * from './fp7LegalBasis';
export * from './fp7Organization';
export * from './fp7ProjectDetails';
export * from './fp7ProjectIPR';
export * from './fp7Publication';
export * from './fp7ReportSummary';
export * from './fp7Topic';
export * from './fp7WebLink';
export * from './funderByAuthor';
export * from './fundersByAuthorResponse';
export * from './fundingProject';
export * from './fundingProjectPage';
export * from './fwci';
export * from './groupByResult';
export * from './h2020Deliverable';
export * from './h2020ErcPI';
export * from './h2020EurosciVoc';
export * from './h2020LegalBasis';
export * from './h2020Organization';
export * from './h2020ProjectDetails';
export * from './h2020Publication';
export * from './h2020ReportSummary';
export * from './h2020Topic';
export * from './h2020WebLink';
export * from './hEUDeliverable';
export * from './hEUEurosciVoc';
export * from './hEULegalBasis';
export * from './hEUOrganization';
export * from './hEUProjectDetails';
export * from './hEUPublication';
export * from './hEUReportSummary';
export * from './hEUTopic';
export * from './hEUWebLink';
export * from './hTTPValidationError';
export * from './identityGrant';
export * from './institution';
@@ -69,6 +98,7 @@ export * from './matchedOfficer';
export * from './mentionedPerson';
export * from './meta';
export * from './model2YrMeanCitedness';
export * from './neteccontribution';
export * from './newsArticle';
export * from './newsArticleDetail';
export * from './newsPage';
@@ -0,0 +1,14 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface Neteccontribution {
}
+1
View File
@@ -28,3 +28,4 @@ export interface PatentEntry {
cpc_descriptions: IpcClassification[];
country: string | null;
}
+20 -3
View File
@@ -14,7 +14,9 @@ import { bundSingleProjectResolver } from './resolvers/bund-single-project-resol
import { cordisEuProjectPageResolver } from './resolvers/cordis-eu-project-page.resolver';
import { cordisEuProjectsFundingResolver } from './resolvers/cordis-eu-projects-funding.resolver';
import { fundingProjectPageResolver } from './resolvers/funding-project-page.resolver';
import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver';
import { euSingleProjectResolver } from './resolvers/eu-single-project-resolver';
import { publicationResolver } from './resolvers/publication-resolver';
export const routes: Routes = [
{
path: '',
@@ -76,13 +78,16 @@ export const routes: Routes = [
import('./modules/publication-detail/publication-detail.component').then(
(mod) => mod.PublicationDetailComponent,
),
resolve: {
publication: publicationResolver,
},
},
{
path: 'projects/dfg/:id',
canActivate: [userGuard],
pathMatch: 'full',
loadComponent: () =>
import('./modules/person-projects/dfg-details/dfg-details.component').then(
import('./modules/projects/dfg-details/dfg-details.component').then(
(mod) => mod.DfgDetailsComponent,
),
resolve: { dfgSingleProject: dfgSingleProjectResolver },
@@ -92,10 +97,22 @@ export const routes: Routes = [
canActivate: [userGuard],
pathMatch: 'full',
loadComponent: () =>
import('./modules/person-projects/bund-details/bund-details.component').then(
import('./modules/projects/bund-details/bund-details.component').then(
(mod) => mod.BundDetailsComponent,
),
resolve: { bundSingleProject: bundSingleProjectResolver },
},
{
path: 'projects/eu/:id',
canActivate: [userGuard],
pathMatch: 'full',
loadComponent: () =>
import('./modules/projects/eu-cordis-details/eu-details.component').then(
(mod) => mod.EuDetailsComponent,
),
resolve: {
euSingleProject: euSingleProjectResolver,
},
},
{
path: 'person/:id',
@@ -53,7 +53,7 @@
</ul>
</div>
@if (selectedPatent.assignees.length > 0) {
@if (selectedPatent.assignees && selectedPatent.assignees.length > 0) {
<div class="detail-section">
<h4>Anmelder</h4>
<ul class="tag-list">
@@ -64,7 +64,7 @@
</div>
}
@if (selectedPatent.ipc_descriptions.length > 0) {
@if (selectedPatent.ipc_descriptions && selectedPatent.ipc_descriptions.length > 0) {
<div class="detail-section classification-section classification-section--ipc">
<h4>Klassifikation (IPC)</h4>
<div class="classification-cards">
@@ -110,7 +110,7 @@
}
</div>
</div>
} @else if (selectedPatent.ipc.length > 0) {
} @else if (selectedPatent.ipc && selectedPatent.ipc.length > 0) {
<div class="detail-section">
<h4>Klassifikation (IPC)</h4>
<ul class="tag-list tag-list--compact">
@@ -121,7 +121,7 @@
</div>
}
@if (selectedPatent.cpc_descriptions.length > 0) {
@if (selectedPatent.cpc_descriptions && selectedPatent.cpc_descriptions.length > 0) {
<div class="detail-section classification-section classification-section--cpc">
<h4>Klassifikation (CPC)</h4>
<div class="classification-cards">
@@ -167,16 +167,7 @@
}
</div>
</div>
} @else if (selectedPatent.cpc.length > 0) {
<div class="detail-section">
<h4>Klassifikation (CPC)</h4>
<ul class="tag-list tag-list--compact">
@for (cpc of selectedPatent.cpc; track cpc) {
<li class="tag">{{ cpc }}</li>
}
</ul>
</div>
}
}
</div>
}
@@ -172,7 +172,7 @@ export class PersonPatentsComponent implements OnInit {
this.updateQueryParams();
}
formatDate(date: string | null): string {
formatDate(date: string | null | undefined): string {
if (!date) return '-';
const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
return new Intl.DateTimeFormat('de-DE').format(new Date(d));
@@ -375,10 +375,16 @@ export class PersonPatentsComponent implements OnInit {
seen.add(normalized);
rows.push({ label, value });
};
if (entry.section){
addRow('Sektion', entry.section);
}
if (entry.class){
addRow('Klasse', entry.class);
}
if (entry.subclass){
addRow('Unterklasse', entry.subclass);
}
addRow('Sektion', entry.section);
addRow('Klasse', entry.class);
addRow('Unterklasse', entry.subclass);
return rows;
}
@@ -26,6 +26,14 @@
</p>
}
<div class="hero-actions">
<div
class="status-badge"
[style.background-color]="
getStatusColor(getStatusDisplay(bundProject.funding_end_date))
">
<mat-icon>circle</mat-icon>
<span>{{ getStatusDisplay(bundProject.funding_end_date) }}</span>
</div>
<!-- @if (bundProject.project_agency) {
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
<mat-icon>account_balance</mat-icon>
@@ -46,14 +54,23 @@
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ getStartDate() || 'N/A' }}</strong>
<span>Startdatum</span>
<span>Förderbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(getEndDate()) }}</strong>
<span>Enddatum</span>
<span>Förderende</span>
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<div class="metric-content">
<strong>{{
getStatusDisplay(bundProject.funding_end_date)
}}</strong>
<span>Status</span>
</div>
</div>
@if (bundProject.funding_amount) {
@@ -77,18 +94,17 @@
</div>
</div>
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
</mat-card>
}
<div class="content-grid">
<main class="main-content">
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
</mat-card>
}
<!-- Beteiligte Personen -->
@if (getAssociatedPersons().length > 0) {
<mat-card appearance="outlined" class="card">
@@ -351,11 +367,11 @@
}
<!-- <div class="detail-row">
<dt>Startdatum</dt>
<dt>Förderbeginn</dt>
<dd>{{ getStartDate() || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Enddatum</dt>
<dt>Förderende</dt>
<dd>{{ getFundingStatus(getEndDate()) }}</dd>
</div> -->
@if (getDuration()) {
@@ -13,7 +13,29 @@
gap: 18px;
margin-bottom: 24px;
}
.status-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border-radius: var(--sg-radius-sm);
color: #fff;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.status-badge:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.status-badge mat-icon {
width: 16px;
height: 16px;
font-size: 16px;
}
.back-link {
display: inline-flex;
align-items: center;
@@ -5,7 +5,7 @@ import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
import { Router } from '@angular/router';
import { formatGermanDate } from '../../../shared/utils/formatters';
@Component({
selector: 'app-bund-details',
standalone: true,
@@ -41,8 +41,8 @@ export class BundDetailsComponent implements OnInit {
const year = parseInt(fundingEndDate, 10);
if (isNaN(year)) return fundingEndDate;
return year >= new Date().getFullYear()
? `${fundingEndDate} (laufend)`
: `${fundingEndDate} (abgeschlossen)`;
? `${fundingEndDate}`
: `${fundingEndDate}`;
}
formatCurrency(amount: number | null | undefined): string {
@@ -104,15 +104,6 @@ export class BundDetailsComponent implements OnInit {
// }
// });
// }
private formatGermanDate(dateString: string): string {
if (!dateString) return '';
return new Intl.DateTimeFormat('de-DE', {
day: 'numeric',
month: 'long',
year: 'numeric',
}).format(new Date(dateString));
}
/**
* All associated persons as a simple list.
*/
@@ -120,11 +111,11 @@ export class BundDetailsComponent implements OnInit {
return this.bundProject?.associated_persons || [];
}
getStartDate(): string {
return this.formatGermanDate(this.bundProject?.funding_start_date ?? '');
return formatGermanDate(this.bundProject?.funding_start_date ?? '');
}
getEndDate(): string {
return this.formatGermanDate(this.bundProject?.funding_end_date ?? '');
return formatGermanDate(this.bundProject?.funding_end_date ?? '');
}
getDuration(): string {
@@ -133,7 +124,7 @@ export class BundDetailsComponent implements OnInit {
if (!start || !end) return '';
return `von ${this.formatGermanDate(start)} bis ${this.formatGermanDate(end)}`;
return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`;
}
/**
* All institutions as a simple list.
@@ -156,7 +147,23 @@ export class BundDetailsComponent implements OnInit {
if (!this.bundProject?.funding_amount) return 'N/A';
return this.formatCurrency(this.bundProject.funding_amount);
}
getStatusDisplay(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'Laufend';
const year = parseInt(fundingEndDate, 10);
return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`;
}
getStatusColor(status: string | null | undefined): string {
if (!status) return '#95a5a6';
const statusUpper = status.toUpperCase();
if (statusUpper.includes('ABGESCHLOSSEN')) {
return '#27ae60';
} else if (statusUpper.includes('LAUFEND')) {
return '#f39c12';
} else {
return '#95a5a6';
}
}
goBack(): void {
window.history.back();
}
@@ -21,6 +21,12 @@
</p>
}
<div class="hero-actions">
<div
class="status-badge"
[style.background-color]="getStatusColor(getStatusDisplay(dfgProject.funding_end_date))">
<mat-icon>circle</mat-icon>
<span>{{ getStatusDisplay(dfgProject.funding_end_date) }}</span>
</div>
@if (dfgProject.link) {
<a [href]="dfgProject.link" target="_blank" class="primary-action">
<mat-icon>open_in_new</mat-icon>
@@ -44,14 +50,21 @@
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.funding_start_date || 'N/A' }}</strong>
<span>Fördersbeginn</span>
<span>Förderbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(dfgProject.funding_end_date) }}</strong>
<span>Fördersende</span>
<span>Förderende</span>
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<div class="metric-content">
<strong>{{ getStatusDisplay(dfgProject.funding_end_date) }}</strong>
<span>Status</span>
</div>
</div>
<!-- @if (dfgProject.subject_area) {
@@ -93,18 +106,17 @@
</div>
</div>
@if (dfgProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ dfgProject.description }}</p>
</mat-card>
}
<div class="content-grid">
<main class="main-content">
@if (dfgProject.description) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ dfgProject.description }}</p>
</mat-card>
}
<!-- Beteiligte Personen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
@@ -198,12 +210,8 @@
<dd>{{ dfgProject.funding_type || 'N/A' }}</dd>
</div> -->
<div class="detail-row">
<dt>Fördersbeginn</dt>
<dd>{{ dfgProject.funding_start_date || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Fördersende</dt>
<dd>{{ getFundingStatus(dfgProject.funding_end_date) }}</dd>
<dt>Laufzeit</dt>
<dd>{{ getDuration() }}</dd>
</div>
@if (dfgProject.subproject_of) {
<div class="detail-row">
@@ -236,7 +236,29 @@ h1 {
font-size: 12px;
font-weight: 500;
}
.status-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border-radius: var(--sg-radius-sm);
color: #fff;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.status-badge:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.status-badge mat-icon {
width: 16px;
height: 16px;
font-size: 16px;
}
.description-text {
padding: 16px 20px 20px;
margin: 0;
@@ -36,13 +36,33 @@ export class DfgDetailsComponent implements OnInit {
getFundingStatus(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'laufend';
if (fundingEndDate === '2999') return 'Laufend';
const year = parseInt(fundingEndDate, 10);
if (isNaN(year)) return fundingEndDate;
return year >= new Date().getFullYear()
? `${fundingEndDate} (laufend)`
: `${fundingEndDate} (abgeschlossen)`;
? `${fundingEndDate}`
: `${fundingEndDate}`;
}
getStatusDisplay(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'Laufend';
const year = parseInt(fundingEndDate, 10);
return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`;
}
getStatusColor(status: string | null | undefined): string {
if (!status) return '#95a5a6';
const statusUpper = status.toUpperCase();
if (statusUpper.includes('ABGESCHLOSSEN')) {
return '#27ae60';
} else if (statusUpper.includes('LAUFEND')) {
return '#f39c12';
} else {
return '#95a5a6';
}
}
searchForPersonName(personName: string): void {
this.router.navigate(['/persons'], {
queryParams: {
@@ -70,7 +90,14 @@ export class DfgDetailsComponent implements OnInit {
getInstitutions(): string[] {
return this.dfgProject?.institutions || [];
}
getDuration(): string {
const start = this.dfgProject?.funding_start_date;
const end = this.dfgProject?.funding_end_date === "2999" ? "Heute" : this.dfgProject?.funding_end_date ;
if (!start || !end) return '';
return `von ${start} bis ${end}`;
}
goBack(): void {
window.history.back();
}
@@ -0,0 +1,590 @@
<div class="detail-page">
<div class="page-header">
<div class="breadcrumb">
<span>EU Projekte</span>
<mat-icon>chevron_right</mat-icon>
<span>Projektdetails</span>
</div>
</div>
@if (euProject) {
<div class="project-hero">
<div class="hero-content">
<div class="eyebrow">
<span class="project-badge">EU Projekt</span>
@if (programType) {
<span
class="program-badge"
[class.fp7]="programType === 'fp7'"
[class.h2020]="programType === 'h2020'"
[class.heu]="programType === 'heu'">
{{
programType === 'fp7'
? 'FP7'
: programType === 'h2020'
? 'H2020'
: programType === 'heu'
? 'Horizon Europe'
: ''
}}
</span>
}
<span class="project-id">ID: {{ euProject.id }}</span>
</div>
<h1>{{ euProject.title || 'Ohne Titel' }}</h1>
@if (euProject.frameworkProgramme) {
<p class="project-framework">
<strong>{{
getFrameworkDisplay(euProject.frameworkProgramme)
}}</strong>
</p>
}
<div class="hero-actions">
@if (euProject.status) {
<div
class="status-badge"
[style.background-color]="getStatusColor(euProject.status)">
<mat-icon>circle</mat-icon>
<span>{{ getStatusDisplay(euProject.status) }}</span>
</div>
}
@if (euProject.fundingScheme) {
<div class="scheme-info">
<mat-icon>assignment</mat-icon>
<span>{{
getFundingSchemeDisplay(euProject.fundingScheme)
}}</span>
</div>
}
@if (euProject.grantDoi) {
<a
[href]="'https://doi.org/' + euProject.grantDoi"
target="_blank"
class="doi-link">
<mat-icon>link</mat-icon>
<span>DOI: {{ euProject.grantDoi }}</span>
</a>
}
</div>
</div>
<div class="metrics-grid">
<div class="metric-item">
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ formatDate(euProject.startDate) || 'N/A' }}</strong>
<span>Förderbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ formatDate(euProject.endDate) || 'N/A' }}</strong>
<span>Förderende</span>
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(euProject.endDate) }}</strong>
<span>Status</span>
</div>
</div>
@if (euProject.ecMaxContribution) {
<div class="metric-item">
<mat-icon>euro_symbol</mat-icon>
<div class="metric-content">
<strong>{{ formatCurr(euProject.ecMaxContribution) }}</strong>
<span>EU-Beitrag</span>
</div>
</div>
}
@if (euProject.totalCost) {
<div class="metric-item">
<mat-icon>attach_money</mat-icon>
<div class="metric-content">
<strong>{{ formatCurr(euProject.totalCost) }}</strong>
<span>Gesamtkosten</span>
</div>
</div>
}
@if (euProject.organizationCount !== undefined) {
<div class="metric-item">
<mat-icon>business</mat-icon>
<div class="metric-content">
<strong>{{ euProject.organizationCount }}</strong>
<span>Organisationen</span>
</div>
</div>
}
@if (euProject.publicationCount !== undefined) {
<div class="metric-item">
<mat-icon>description</mat-icon>
<div class="metric-content">
<strong>{{ euProject.publicationCount }}</strong>
<span>Publikationen</span>
</div>
</div>
}
</div>
</div>
<!-- Tabs Navigation -->
<div class="tabs-container">
<button
class="tab-btn"
[class.active]="activeTab === 'overview'"
(click)="setTab('overview')">
<mat-icon>info</mat-icon>
Übersicht
</button>
<button
class="tab-btn"
[class.active]="activeTab === 'organizations'"
[disabled]="!isTabVisible('organizations')"
(click)="setTab('organizations')">
<mat-icon>business</mat-icon>
Organisationen
<span class="tab-badge">{{
euProject.organizations?.length ?? 0
}}</span>
</button>
<button
class="tab-btn"
[class.active]="activeTab === 'publications'"
[disabled]="!isTabVisible('publications')"
(click)="setTab('publications')">
<mat-icon>description</mat-icon>
Publikationen
<span class="tab-badge">{{ euProject.publications?.length ?? 0 }}</span>
</button>
<button
class="tab-btn"
[class.active]="activeTab === 'iprs'"
[disabled]="!isTabVisible('iprs')"
(click)="setTab('iprs')">
<mat-icon>gavel</mat-icon>
IPRs
<span class="tab-badge">{{ euProject.iprs?.length ?? 0 }}</span>
</button>
<button
class="tab-btn"
[class.active]="activeTab === 'deliverables'"
[disabled]="!isTabVisible('deliverables')"
(click)="setTab('deliverables')">
<mat-icon>assignment</mat-icon>
Deliverables
<span class="tab-badge">{{ euProject.deliverables?.length ?? 0 }}</span>
</button>
</div>
<!-- Tab Content -->
<div class="tab-content">
<!-- Overview Tab -->
@if (activeTab === 'overview') {
<div class="overview-content">
<div class="content-grid">
<main class="main-content">
@if (euProject.objective) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Projektziel</h2>
</div>
<p class="description-text">{{ euProject.objective }}</p>
</mat-card>
}
<!-- Topics -->
@if (getFormattedTopics(euProject.topics).length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>topic</mat-icon>
<h2>Themen</h2>
<span class="count-badge">{{
getFormattedTopics(euProject.topics).length
}}</span>
</div>
<div class="topics-grid">
@for (
topic of getFormattedTopics(euProject.topics);
track topic
) {
<div class="topic-item">
<span class="topic-value">{{ topic }}</span>
</div>
}
</div>
</mat-card>
}
@if (getKeywordChips().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>tag</mat-icon>
<h2>Schlüsselwörter</h2>
<span class="count-badge">{{
getKeywordChips().length
}}</span>
</div>
<div class="interest-tags">
@for (
keyword of getKeywordChips();
track keyword.id || keyword.label
) {
<app-topic-chip
[label]="keyword.label"
[count]="keyword.count"
[subfieldName]="keyword.subfieldName"
[fieldName]="keyword.fieldName"
[domainName]="keyword.domainName"
[color]="keyword.color || '#d9e2f0'"
[disabled]="!keyword.id">
</app-topic-chip>
}
</div>
</mat-card>
}
<!-- EuroSciVoc -->
@if (euProject.eurosciVoc && euProject.eurosciVoc.length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>science</mat-icon>
<h2>EuroSciVoc</h2>
<span class="count-badge">{{
euProject.eurosciVoc.length
}}</span>
</div>
<div class="eurosci-voc-grid">
@for (voc of euProject.eurosciVoc; track voc.id) {
<div
class="eurosci-voc-item"
[class.clickable]="voc.path">
<div class="voc-path">
@if (voc.path) {
@for (
segment of getPathSegments(voc.path);
track segment
) {
<span class="path-segment">{{ segment }}</span>
@if (!$last) {
<mat-icon class="path-separator"
>chevron_right</mat-icon
>
}
}
} @else {
<span class="path-segment">{{
voc.code || 'N/A'
}}</span>
}
</div>
@if (voc.code) {
<span class="voc-code">{{ voc.code }}</span>
}
@if (voc.description) {
<span class="voc-description">{{
voc.description
}}</span>
}
@if (voc.path) {
<mat-icon class="search-icon">search</mat-icon>
}
</div>
}
</div>
</mat-card>
}
</main>
<aside class="sidebar">
<!-- Projektdetails -->
<mat-card appearance="outlined" class="card details-card">
<div class="section-header">
<mat-icon>info</mat-icon>
<h2>Projektdetails</h2>
</div>
<dl class="details-list">
<div class="detail-row">
<dt>Projekt ID</dt>
<dd>{{ euProject.id || 'N/A' }}</dd>
</div>
@if (euProject.rcn) {
<div class="detail-row">
<dt>RCN</dt>
<dd>{{ euProject.rcn }}</dd>
</div>
}
@if (euProject.acronym) {
<div class="detail-row">
<dt>Akronym</dt>
<dd>{{ euProject.acronym }}</dd>
</div>
}
@if (euProject.frameworkProgramme) {
<div class="detail-row">
<dt>Rahmenprogramm</dt>
<dd>
{{ getFrameworkDisplay(euProject.frameworkProgramme) }}
</dd>
</div>
}
@if (euProject.fundingScheme) {
<div class="detail-row">
<dt>Förderprogramm</dt>
<dd>
{{ getFundingSchemeDisplay(euProject.fundingScheme) }}
</dd>
</div>
}
@if (euProject.masterCall) {
<div class="detail-row">
<dt>Master Call</dt>
<dd>{{ euProject.masterCall }}</dd>
</div>
}
@if (euProject.subCall) {
<div class="detail-row">
<dt>Sub Call</dt>
<dd>{{ euProject.subCall }}</dd>
</div>
}
@if (euProject.status) {
<div class="detail-row">
<dt>Status</dt>
<dd>
<span
class="status-indicator"
[style.background-color]="
getStatusColor(euProject.status)
">
{{ getStatusDisplay(euProject.status) }}
</span>
</dd>
</div>
}
@if (euProject.ecMaxContribution) {
<div class="detail-row">
<dt>Max. EU-Beitrag</dt>
<dd>{{ formatCurr(euProject.ecMaxContribution) }}</dd>
</div>
}
@if (euProject.totalCost) {
<div class="detail-row">
<dt>Gesamtkosten</dt>
<dd>{{ formatCurr(euProject.totalCost) }}</dd>
</div>
}
@if (euProject.ecSignatureDate) {
<div class="detail-row">
<dt>EU-Unterzeichnung</dt>
<dd>{{ formatDate(euProject.ecSignatureDate) }}</dd>
</div>
}
@if (euProject.nature) {
<div class="detail-row">
<dt>Art</dt>
<dd>{{ euProject.nature }}</dd>
</div>
}
</dl>
</mat-card>
<!-- Zeitliche Informationen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>schedule</mat-icon>
<h2>Zeitliche Übersicht</h2>
</div>
<dl class="details-list">
<div class="detail-row">
<dt>Laufzeit</dt>
<dd>
{{
getDuration(euProject.startDate, euProject.endDate) ||
'N/A'
}}
</dd>
</div>
@if (euProject.ecSignatureDate) {
<div class="detail-row">
<dt>EU-Unterzeichnung</dt>
<dd>{{ formatDate(euProject.ecSignatureDate) }}</dd>
</div>
}
@if (euProject.contentUpdateDate) {
<div class="detail-row">
<dt>Letzte Aktualisierung</dt>
<dd>{{ formatDate(euProject.contentUpdateDate) }}</dd>
</div>
}
@if (euProject.grantDoi) {
<div class="detail-row">
<dt>Grant DOI</dt>
<dd>
<a
[href]="'https://doi.org/' + euProject.grantDoi"
target="_blank"
class="external-link">
{{ euProject.grantDoi }}
<mat-icon class="external-icon">open_in_new</mat-icon>
</a>
</dd>
</div>
}
</dl>
</mat-card>
<!-- Program-Specific Info -->
@if (
programType === 'h2020' &&
euProject.ercPrincipalInvestigators &&
euProject.ercPrincipalInvestigators.length > 0
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>person</mat-icon>
<h2>ERC Principal Investigators</h2>
<span class="count-badge">{{
euProject.ercPrincipalInvestigators.length
}}</span>
</div>
<div class="erc-pi-list">
@for (
pi of euProject.ercPrincipalInvestigators;
track pi.organisationID
) {
<div class="erc-pi-item">
<span class="pi-name"
>{{ pi.firstName }} {{ pi.lastName }}</span
>
@if (pi.title) {
<span class="pi-title">{{ pi.title }}</span>
}
</div>
}
</div>
</mat-card>
}
</aside>
</div>
</div>
}
<!-- Organizations Tab -->
@if (activeTab === 'organizations' && euProject.organizations) {
<app-organizations-table [orgs]="euProject.organizations"/>
}
@if (activeTab === 'publications' && euProject.publications) {
<app-publications-table [publications]="euProject.publications"/>
}
<!-- IPRs Tab -->
@if (activeTab === 'iprs' && euProject.iprs) {
<div class="iprs-tab">
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>gavel</mat-icon>
<h2>Intellectual Property Rights ({{ euProject.iprs.length }})</h2>
</div>
<div class="iprs-list">
@for (ipr of euProject.iprs; track ipr.title) {
<div class="ipr-item" (click)="searchForPatent(ipr)">
<div class="ipr-icon">
@if (ipr.type === 'PATENT') {
<mat-icon>emoji_events</mat-icon>
} @else {
<mat-icon>copyright</mat-icon>
}
</div>
<div class="ipr-info">
<div class="ipr-title">{{ ipr.title || 'Ohne Titel' }}</div>
<div class="ipr-details">
@if (ipr.type) {
<span class="ipr-type">{{ ipr.type }}</span>
}
@if (ipr.patentType) {
<span class="ipr-patent-type">{{
ipr.patentType
}}</span>
}
@if (ipr.applicantName) {
<span class="ipr-applicant"
>Applicant: {{ ipr.applicantName }}</span
>
}
</div>
<div class="ipr-identifiers">
@if (ipr.applicationIdentifier) {
<span class="ipr-app-id"
>App: {{ ipr.applicationIdentifier }}</span
>
}
@if (ipr.awardIdentifier) {
<span class="ipr-award-id"
>Award: {{ ipr.awardIdentifier }}</span
>
}
</div>
</div>
</div>
}
</div>
</mat-card>
</div>
}
<!-- Deliverables Tab -->
@if (activeTab === 'deliverables' && notEmpty(euProject.deliverables)) {
<div class="deliverables-tab">
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>assignment</mat-icon>
<h2>Deliverables ({{ euProject.deliverables?.length }})</h2>
</div>
<div class="deliverables-list">
@for (deliv of euProject.deliverables; track deliv.url) {
<div class="deliverable-item">
<div class="deliv-icon">
<mat-icon>file_present</mat-icon>
</div>
<div class="deliv-info">
<div class="deliv-description">
{{ deliv.description || 'Ohne Beschreibung' }}
</div>
<div class="deliv-meta">
@if (deliv.deliverableType) {
<span class="deliv-type">{{
deliv.deliverableType
}}</span>
}
@if (deliv.url) {
<a
[href]="deliv.url"
target="_blank"
class="deliv-link">
<mat-icon>open_in_new</mat-icon>
<span>Zum Deliverable</span>
</a>
}
</div>
</div>
</div>
}
</div>
</mat-card>
</div>
}
</div>
} @else {
<div class="error-container">
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<p>EU Projekt nicht gefunden.</p>
</div>
</div>
}
</div>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,499 @@
// eu-details.component.ts (refactored)
import { Component, OnInit, inject, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatChipsModule } from '@angular/material/chips';
import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { MatTooltipModule } from '@angular/material/tooltip';
import { Subscription } from 'rxjs';
import {
formatGermanDate,
formatCurrency,
} from '../../../shared/utils/formatters';
import { EuProjectData } from '../../../api/model/euProjectData';
import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component';
import { OrganizationsTableComponent } from './organizations-table/organizations-table/organizations-table.component';
import { Fp7ProjectIPR } from '../../../api';
import { PublicationsTableComponent } from './publications-table/publications-table.component';
export type TabType =
| 'overview'
| 'organizations'
| 'publications'
| 'iprs'
| 'deliverables';
@Component({
selector: 'app-eu-details',
standalone: true,
imports: [
CommonModule,
MatCardModule,
MatIconModule,
MatChipsModule,
MatButtonModule,
MatDividerModule,
MatTooltipModule,
TopicChipComponent,
OrganizationsTableComponent,
PublicationsTableComponent,
],
templateUrl: './eu-details.component.html',
styleUrl: './eu-details.component.scss',
})
export class EuDetailsComponent implements OnInit, OnDestroy {
private route = inject(ActivatedRoute);
private router = inject(Router);
// Data
euProject: EuProjectData | undefined;
programType: string = '';
// UI State
activeTab: TabType = 'overview';
isLoading = true;
// Tab content flags
hasOrganizations = false;
hasPublications = false;
hasIprs = false;
hasDeliverables = false;
// Subscriptions
private subscriptions: Subscription = new Subscription();
// Tab configuration
private readonly tabConfig: Record<
TabType,
{ label: string; icon: string; order: number }
> = {
overview: { label: 'Übersicht', icon: 'info', order: 0 },
organizations: { label: 'Organisationen', icon: 'business', order: 1 },
publications: { label: 'Publikationen', icon: 'article', order: 2 },
iprs: { label: 'IPRs', icon: 'gavel', order: 3 },
deliverables: { label: 'Ergebnisse', icon: 'assignment', order: 4 },
};
ngOnInit(): void {
// Subscribe to route data
this.subscriptions.add(
this.route.data.subscribe(({ euSingleProject }) => {
console.log('EU Project:', euSingleProject);
this.euProject = euSingleProject.eu_project_data;
this.isLoading = false;
if (this.euProject) {
this.determineProgramType(euSingleProject);
this.updateTabContentFlags();
this.handleTabFromQueryParams();
}
}),
);
// Subscribe to query params changes
this.subscriptions.add(
this.route.queryParams.subscribe((params) => {
// Only handle if data is already loaded
if (this.euProject) {
this.handleTabFromQueryParams(params);
}
}),
);
}
ngOnDestroy(): void {
this.subscriptions.unsubscribe();
}
// ============= PRIVATE METHODS =============
/**
* Determine program type based on available data
*/
private determineProgramType(euSingleProject: any): void {
if (euSingleProject.iprs !== undefined) {
this.programType = 'fp7';
} else if (euSingleProject.ercPrincipalInvestigators !== undefined) {
this.programType = 'h2020';
} else if (euSingleProject.deliverables !== undefined) {
this.programType = 'heu';
}
}
/**
* Update flags for which tabs have content
*/
private updateTabContentFlags(): void {
this.hasOrganizations =
(this.euProject?.organizations &&
this.euProject.organizations.length > 0) ||
false;
this.hasPublications =
(this.euProject?.publications &&
this.euProject.publications.length > 0) ||
false;
this.hasIprs =
(this.euProject?.iprs && this.euProject.iprs.length > 0) || false;
this.hasDeliverables =
(this.euProject?.deliverables &&
this.euProject.deliverables.length > 0) ||
false;
}
/**
* Handle tab selection from query params
*/
private handleTabFromQueryParams(params?: any): void {
const queryParams = params || this.route.snapshot.queryParams;
const tabParam = queryParams['tab'] as TabType;
if (!tabParam) {
this.activeTab = 'overview'; // silent default, no navigation
return;
}
if (this.isValidTab(tabParam) && this.tabHasContent(tabParam)) {
this.activeTab = tabParam;
} else {
// tab param exists but is invalid/empty — correct it
this.activeTab = 'overview';
this.updateTabQueryParam('overview');
}
}
/**
* Check if a tab value is valid
*/
private isValidTab(tab: string): tab is TabType {
return [
'overview',
'organizations',
'publications',
'iprs',
'deliverables',
].includes(tab);
}
/**
* Check if a tab has content to display
*/
private tabHasContent(tab: TabType): boolean {
switch (tab) {
case 'overview':
return true;
case 'organizations':
return this.hasOrganizations;
case 'publications':
return this.hasPublications;
case 'iprs':
return this.hasIprs;
case 'deliverables':
return this.hasDeliverables;
default:
return false;
}
}
/**
* Update URL query param for tab
*/
private updateTabQueryParam(tab: TabType): void {
const currentTab = this.route.snapshot.queryParams['tab'];
if (currentTab === tab) return;
this.router
.navigate([], {
relativeTo: this.route,
queryParams: { tab },
queryParamsHandling: 'merge',
replaceUrl: true,
})
.catch((err) => console.error('Tab navigation failed:', err));
}
/**
* Get color for keyword based on index
*/
private getKeywordColor(index: number): string {
const colors = [
'#3498db', // Blue
'#e67e22', // Orange
'#27ae60', // Green
'#8e44ad', // Purple
'#e74c3c', // Red
'#1abc9c', // Teal
'#f39c12', // Gold
'#2c3e50', // Navy
];
return colors[index % colors.length];
}
// ============= PUBLIC METHODS =============
/**
* Set active tab and update URL
*/
setTab(tab: TabType): void {
if (this.activeTab === tab) return;
// Check if tab has content
if (!this.tabHasContent(tab)) {
return;
}
this.activeTab = tab;
this.updateTabQueryParam(tab);
}
/**
* Check if a tab is active
*/
isTabActive(tab: TabType): boolean {
return this.activeTab === tab;
}
/**
* Check if tab is visible (has content)
*/
isTabVisible(tab: TabType): boolean {
return this.tabHasContent(tab);
}
/**
* Get tab label with count
*/
getTabLabel(tab: TabType): string {
return this.tabConfig[tab].label;
}
/**
* Get tab icon
*/
getTabIcon(tab: TabType): string {
return this.tabConfig[tab].icon;
}
/**
* Get tab count badge
*/
getTabCount(tab: TabType): number | null {
switch (tab) {
case 'organizations':
return this.euProject?.organizations?.length || null;
case 'publications':
return this.euProject?.publications?.length || null;
case 'iprs':
return this.euProject?.iprs?.length || null;
case 'deliverables':
return this.euProject?.deliverables?.length || null;
default:
return null;
}
}
/**
* Get sorted tabs that have content
*/
getVisibleTabs(): TabType[] {
return (
[
'overview',
'organizations',
'publications',
'iprs',
'deliverables',
] as TabType[]
)
.filter((tab) => this.tabHasContent(tab))
.sort((a, b) => this.tabConfig[a].order - this.tabConfig[b].order);
}
// ============= FORMATTING METHODS =============
getFundingStatus(endDate: string | null | undefined): string {
if (!endDate) return 'N/A';
const end = new Date(endDate);
const now = new Date();
if (isNaN(end.getTime())) return endDate;
return end >= now ? 'Laufend' : 'Abgeschlossen';
}
getDuration(start: string | undefined, end: string | undefined): string {
if (!start || !end) return '';
return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`;
}
formatDate(date: string | undefined): string | undefined {
if (date) {
return formatGermanDate(date);
}
return date;
}
formatCurr(value: number | undefined | null): string | null | undefined {
if (value) {
return formatCurrency(value);
}
return String(value);
}
getStatusColor(status: string | null | undefined): string {
if (!status) return '#95a5a6';
const statusUpper = status.toUpperCase();
if (statusUpper.includes('CLOSED') || statusUpper.includes('COMPLETED')) {
return '#27ae60';
} else if (
statusUpper.includes('ONGOING') ||
statusUpper.includes('ACTIVE')
) {
return '#f39c12';
} else if (statusUpper.includes('SIGNED')) {
return '#3498db';
} else if (statusUpper.includes('CANCELLED')) {
return '#e74c3c';
} else {
return '#95a5a6';
}
}
getStatusDisplay(status: string | null | undefined): string {
if (!status) return 'N/A';
const statusMap: { [key: string]: string } = {
CLOSED: 'Abgeschlossen',
COMPLETED: 'Abgeschlossen',
ONGOING: 'Laufend',
ACTIVE: 'Aktiv',
SIGNED: 'Unterzeichnet',
CANCELLED: 'Abgebrochen',
SUSPENDED: 'Unterbrochen',
};
const statusUpper = status.toUpperCase();
return statusMap[statusUpper] || status;
}
getFrameworkDisplay(framework: string | null | undefined): string {
if (!framework) return 'N/A';
const frameworkMap: { [key: string]: string } = {
HORIZON: ' Horizon Europe',
H2020: 'Horizon 2020',
FP7: '7. Rahmenprogramm',
FP6: '6. Rahmenprogramm',
HE: 'Horizon Europe',
};
return frameworkMap[framework] || framework;
}
getFundingSchemeDisplay(scheme: string | null | undefined): string {
if (!scheme) return 'N/A';
const schemeMap: { [key: string]: string } = {
'MSCA-IF-EF-SE':
'MSCA Individual Fellowship - European Fellowship - Standard',
'MSCA-IF-EF': 'MSCA Individual Fellowship - European Fellowship',
'MSCA-IF-GF': 'MSCA Individual Fellowship - Global Fellowship',
'MSCA-IF': 'MSCA Individual Fellowship',
'MSCA-ITN': 'MSCA Innovative Training Networks',
'MSCA-RISE': 'MSCA Research and Innovation Staff Exchange',
'MSCA-COFUND':
'MSCA Co-funding of Regional, National and International Programmes',
};
return schemeMap[scheme] || scheme;
}
notEmpty(array: any): boolean {
if (array === undefined) return false;
return Array.isArray(array) && array.length > 0;
}
getFormattedTopics(topics: string | null | undefined): string[] {
if (!topics) return [];
return topics
.split(',')
.map((t) => t.trim())
.filter((t) => t);
}
getKeywords(keywords: string | null | undefined): string[] {
if (!keywords) return [];
if (keywords === 'false') return [];
if (typeof keywords === 'string') {
return keywords
.split(',')
.map((k) => k.trim())
.filter((k) => k && k !== 'false');
}
return [];
}
/**
* Get keywords mapped to topic chip format
*/
getKeywordChips(): {
label: string;
count?: number;
description?: string;
subfieldName?: string;
fieldName?: string;
domainName?: string;
color?: string;
id?: string;
}[] {
const keywords = this.getKeywords(this.euProject?.keywords);
if (keywords.length === 0) return [];
return keywords.map((keyword, index) => ({
label: keyword,
count: 1,
description: `Schlüsselwort: ${keyword}`,
subfieldName: '',
fieldName: '',
domainName: '',
color: this.getKeywordColor(index),
id: keyword,
}));
}
/**
* Get path segments from a path string
*/
getPathSegments(path: string | undefined): string[] {
if (!path) return [];
return path.split('/').filter((segment) => segment.trim());
}
getTotalEcContribution(): number {
if (!this.euProject?.organizations) return 0;
return this.euProject.organizations
.filter((org) => org.ecContribution !== undefined)
.reduce((sum, org) => sum + (org.ecContribution || 0), 0);
}
getOrganizationCountries(): string[] {
if (!this.euProject?.organizations) return [];
const countries = new Set(
this.euProject.organizations
.filter((org) => org.country)
.map((org) => org.country as string),
);
return Array.from(countries);
}
// ============= SEARCH / NAVIGATION METHODS =============
searchForPatent(patent: Fp7ProjectIPR): void {
this.router.navigate(['/patents'], {
queryParams: {
search: patent.title,
},
});
}
}
@@ -0,0 +1,121 @@
<div class="organizations-tab">
<mat-card appearance="outlined">
<div class="section-header">
<mat-icon>business</mat-icon>
<h2>Organisationen ({{ orgs.length || 0 }})</h2>
</div>
<div class="organizations-table-wrapper">
<table mat-table [dataSource]="orgs" class="mat-elevation-z2">
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>Name</th>
<td mat-cell *matCellDef="let org">
<div
class="org-name-cell"
(click)="searchForInstitutionName(org.name || '')">
<span class="org-name-text">{{
org.name || org.shortName || 'Unbekannte Organisation'
}}</span>
</div>
</td>
</ng-container>
<!-- Role Column -->
<ng-container matColumnDef="role">
<th mat-header-cell *matHeaderCellDef>Rolle</th>
<td mat-cell *matCellDef="let org">
@if (org.role) {
<span class="role-chip">{{ org.role }}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Country Column -->
<ng-container matColumnDef="country">
<th mat-header-cell *matHeaderCellDef>Stadt</th>
<td mat-cell *matCellDef="let org">
@if (org.city) {
<span class="country-chip">
{{ org.city }}
<img
alt=""
class="country-flag"
[src]="`https://flagcdn.io/${getSvgByCountryCode(org.country)}.svg`"
height="10" />
</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- EU Contribution Column -->
<ng-container matColumnDef="ecContribution">
<th mat-header-cell *matHeaderCellDef>EU-Beitrag</th>
<td mat-cell *matCellDef="let org">
@if (org.ecContribution) {
<span class="currency-value">{{
formatCurr(org.ecContribution)
}}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Activity Type Column -->
<ng-container matColumnDef="activityType">
<th mat-header-cell *matHeaderCellDef>Aktivitätstyp</th>
<td mat-cell *matCellDef="let org">
@if (org.activityType) {
<span class="activity-chip">{{ org.activityType }}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- SME Badge Column -->
<ng-container matColumnDef="sme">
<th mat-header-cell *matHeaderCellDef>SME</th>
<td mat-cell *matCellDef="let org">
@if (org.sme) {
<span class="sme-badge">SME</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- URL Badge Column -->
<ng-container matColumnDef="organizationURL">
<th mat-header-cell *matHeaderCellDef>URL</th>
<td mat-cell *matCellDef="let org">
<div class="links-container">
@if (org.organizationURL) {
<a
[href]="org.organizationURL"
target="_blank"
class="link-button"
matTooltip="Website öffnen">
<mat-icon class="link-icon">open_in_new</mat-icon>
<span class="link-label">Web</span>
</a>
} @else {
<span class="empty-value">—</span>
}
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="organizationDisplayedColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: organizationDisplayedColumns"></tr>
</table>
</div>
</mat-card>
</div>
@@ -0,0 +1,266 @@
// Organizations
.organizations-tab {
.card {
margin-bottom: 24px;
}
.section-header {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px;
border-bottom: 1px solid #e6e9ed;
mat-icon {
color: #6b7a8a;
font-size: 24px;
width: 24px;
height: 24px;
}
h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
}
}
.organizations-table-wrapper {
table {
width: 100%;
border-radius: 8px;
overflow: hidden;
}
.mat-mdc-header-cell {
font-weight: 600;
color: #6b7a8a;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
background: #f8fafc;
border-bottom: 2px solid #e6e9ed;
padding: 12px 16px;
}
.mat-mdc-cell {
padding: 12px 16px;
border-bottom: 1px solid #f0f2f5;
font-size: 13px;
}
.mat-mdc-row {
transition: background 0.2s ease;
}
.mat-mdc-row:hover {
background: #f8fafc;
}
}
.org-name-cell {
display: flex;
align-items: center;
gap: 24px;
cursor: pointer;
}
.org-name-text {
font-weight: 500;
color: #1a1a1a;
}
.org-name-cell:hover .org-name-text {
color: #005a9c;
text-decoration: underline;
}
.role-chip {
display: inline-block;
padding: 2px 10px;
background: #e8edf5;
border-radius: 12px;
font-size: 12px;
color: #6b7a8a;
}
.country-chip {
display: inline-flex;
align-items: center;
gap: 10px;
font-size: 13px;
}
.country-flag {
width: auto;
height: 10px;
}
.currency-value {
font-weight: 500;
color: #1a1a1a;
}
.empty-value {
color: #6b7a8a;
}
.activity-chip {
display: inline-block;
padding: 2px 10px;
background: #f0f3f7;
border-radius: 12px;
font-size: 12px;
color: #6b7a8a;
}
.sme-badge {
display: inline-block;
padding: 2px 8px;
background: #e8f5e9;
color: #2e7d32;
border-radius: 4px;
font-weight: 500;
font-size: 12px;
}
.links-container {
display: inline-flex;
align-items: center;
gap: 8px;
}
.link-button {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
background: #f0f3f7;
border-radius: 4px;
color: #4a5a6a;
text-decoration: none;
font-size: 12px;
transition: all 0.2s ease;
&:hover {
background: #e8edf5;
color: #005a9c;
}
.link-icon {
font-size: 16px;
width: 16px;
height: 16px;
color: #6b7a8a;
}
.link-label {
font-size: 11px;
font-weight: 500;
}
}
}
@media (max-width: 768px) {
.organizations-tab {
.section-header {
padding: 12px 16px;
h2 {
font-size: 16px;
}
}
.organizations-table-wrapper {
padding: 0 12px 12px;
}
.mat-mdc-header-cell,
.mat-mdc-cell {
padding: 8px 10px;
font-size: 12px;
}
.country-flag {
height: 8px;
}
.role-chip,
.activity-chip {
font-size: 11px;
padding: 2px 8px;
}
.sme-badge {
font-size: 11px;
padding: 2px 6px;
}
.link-button {
padding: 2px 6px;
font-size: 11px;
.link-label {
font-size: 10px;
}
.link-icon {
font-size: 14px;
width: 14px;
height: 14px;
}
}
.org-name-text {
font-size: 13px;
}
}
}
@media (max-width: 480px) {
.organizations-tab {
.mat-column-role {
display: none;
}
.mat-column-activityType {
display: none;
}
.mat-mdc-cell {
padding: 6px 8px;
font-size: 11px;
}
.country-chip {
font-size: 11px;
gap: 6px;
}
.currency-value {
font-size: 12px;
}
.links-container {
gap: 4px;
}
.link-button {
padding: 2px 4px;
font-size: 10px;
.link-label {
display: none;
}
.link-icon {
font-size: 16px;
width: 16px;
height: 16px;
}
}
}
}
@@ -0,0 +1,55 @@
import { Component, inject,Input } from '@angular/core';
import { MatTableModule } from '@angular/material/table';
import { Router } from '@angular/router';
import { formatCurrency } from '../../../../../shared/utils/formatters';
import { MatIcon } from '@angular/material/icon';
import { MatCard } from '@angular/material/card';
import { HEUOrganization } from '../../../../../api';
@Component({
selector: 'app-organizations-table',
imports: [MatTableModule,MatIcon,MatCard],
templateUrl: './organizations-table.component.html',
styleUrl: './organizations-table.component.scss',
})
export class OrganizationsTableComponent {
private router = inject(Router);
@Input() orgs!: HEUOrganization[];
@Input() showHeader: boolean = true;
@Input() headerTitle: string = 'Organizationen';
// Displayed columns for the organizations table
organizationDisplayedColumns: string[] = [
'name',
'role',
'country',
'ecContribution',
'activityType',
'sme',
'organizationURL',
];
searchForInstitutionName(institutionName: string): void {
this.router.navigate(['/institutions'], {
queryParams: {
search: institutionName,
},
});
}
getSvgByCountryCode(code: string) {
const codeLower = code.toLowerCase();
if (codeLower === 'uk') {
return 'gb';
}
return codeLower;
}
getOrgsCount(): number {
return this.orgs?.length || 0;
}
formatCurr(value: number | undefined | null) {
if (value) {
return formatCurrency(value);
}
return value;
}
}
@@ -0,0 +1,141 @@
<div class="publications-tab">
<mat-card appearance="outlined" class="card">
@if (showHeader) {
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>{{ headerTitle }} ({{ getPublicationCount() }})</h2>
</div>
}
<div>
<table mat-table [dataSource]="publications" class="mat-elevation-z2">
<!-- Title Column -->
<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef>Titel</th>
<td mat-cell *matCellDef="let pub">
<div
class="pub-title-cell"
(click)="searchForPublication(pub)">
<span class="pub-title-text">
{{ pub.title || 'Kein Titel' }}
</span>
</div>
</td>
</ng-container>
<!-- Authors Column -->
<ng-container matColumnDef="authors">
<th mat-header-cell *matHeaderCellDef>Autoren</th>
<td mat-cell *matCellDef="let pub">
@if (pub.authors) {
@let authorList = parseAuthors(pub.authors);
@if (authorList.length > 0) {
<div class="authors-container">
@for (author of authorList; track author; let last = $last) {
<span class="author-wrapper">
<span
class="author-name"
(click)="searchForPersonName(author); $event.stopPropagation()">
{{ author }}
</span>
@if (!last) {
<span class="author-separator">, </span>
}
</span>
}
</div>
} @else {
<span class="empty-value">—</span>
}
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Journal Column -->
<ng-container matColumnDef="journal">
<th mat-header-cell *matHeaderCellDef>Zeitschrift</th>
<td mat-cell *matCellDef="let pub">
@if (pub.journalNumber) {
<span class="journal-chip" [matTooltip]="pub.journalNumber">{{ pub.journalNumber }}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Year Column -->
<ng-container matColumnDef="year">
<th mat-header-cell *matHeaderCellDef>Jahr</th>
<td mat-cell *matCellDef="let pub">
@if (pub.publishedYear) {
<span class="year-value">{{ pub.publishedYear }}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Publisher Column -->
<ng-container matColumnDef="publisher">
<th mat-header-cell *matHeaderCellDef>Verlag</th>
<td mat-cell *matCellDef="let pub">
@if (pub.publisher) {
<span class="publisher-text">{{ pub.publisher }}</span>
} @else {
<span class="empty-value">—</span>
}
</td>
</ng-container>
<!-- Links Column -->
<ng-container matColumnDef="links">
<th mat-header-cell *matHeaderCellDef>Links</th>
<td mat-cell *matCellDef="let pub">
<div class="links-container">
@if (pub.doi) {
<a
[href]="'https://doi.org/' + pub.doi"
target="_blank"
class="link-button"
matTooltip="DOI öffnen">
<mat-icon class="link-icon">open_in_new</mat-icon>
<span class="link-label">DOI</span>
</a>
}
@if (pub.repositoryUrl) {
<a
[href]="pub.repositoryUrl"
target="_blank"
class="link-button"
matTooltip="Repository öffnen">
<mat-icon class="link-icon">folder_open</mat-icon>
<span class="link-label">Repo</span>
</a>
}
@if (pub.publicationUrl) {
<a
[href]="pub.publicationUrl"
target="_blank"
class="link-button"
matTooltip="Publikation öffnen">
<mat-icon class="link-icon">article</mat-icon>
<span class="link-label">Link</span>
</a>
}
@if (!pub.doi && !pub.repositoryUrl && !pub.publicationUrl) {
<span class="empty-value">—</span>
}
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="publicationDisplayedColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: publicationDisplayedColumns"
class="publication-row"></tr>
</table>
</div>
</mat-card>
</div>
@@ -0,0 +1,233 @@
// Publications Table
.publications-tab {
.card {
margin-bottom: 24px;
}
.section-header {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px;
border-bottom: 1px solid #e6e9ed;
mat-icon {
color: #6b7a8a;
font-size: 24px;
width: 24px;
height: 24px;
}
h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
}
}
table {
width: 100%;
border-radius: 8px;
overflow: hidden;
}
.mat-mdc-header-cell {
font-weight: 600;
color: #6b7a8a;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
background: #f8fafc;
border-bottom: 2px solid #e6e9ed;
padding: 12px 16px;
}
.mat-mdc-cell {
padding: 12px 16px;
border-bottom: 1px solid #f0f2f5;
font-size: 13px;
}
.mat-mdc-row {
transition: background 0.2s ease;
cursor: pointer;
}
.mat-mdc-row:hover {
background: #f8fafc;
}
.pub-title-cell {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.pub-title-text {
font-weight: 500;
color: #1a1a1a;
line-height: 1.4;
}
.pub-title-cell:hover .pub-title-text {
color: #005a9c;
text-decoration: underline;
}
.authors-text {
color: #4a5a6a;
font-size: 13px;
color: #1a1a1a;
line-height: 1.4;
}
.author-name:hover {
color: #005a9c;
text-decoration: underline;
}
.journal-chip {
display: inline-block;
padding: 2px 10px;
background: #e8edf5;
border-radius: 12px;
font-size: 12px;
color: #6b7a8a;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.year-value {
font-weight: 500;
color: #1a1a1a;
}
.publisher-text {
color: #4a5a6a;
font-size: 13px;
}
.empty-value {
color: #6b7a8a;
font-size: 13px;
}
.links-container {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.link-button {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
background: #f0f3f7;
border-radius: 12px;
color: #4a5a6a;
text-decoration: none;
font-size: 11px;
font-weight: 500;
transition: all 0.2s ease;
&:hover {
background: #e8edf5;
color: #005a9c;
transform: translateY(-1px);
}
.link-icon {
font-size: 14px;
width: 14px;
height: 14px;
color: #6b7a8a;
}
.link-label {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.3px;
}
}
// Responsive styles
@media (max-width: 768px) {
.section-header {
padding: 12px 16px;
h2 {
font-size: 16px;
}
}
.mat-mdc-header-cell,
.mat-mdc-cell {
padding: 8px 10px;
font-size: 12px;
}
.publicationDisplayedColumns {
// Hide less important columns on mobile
.mat-column-publisher {
display: none;
}
}
.journal-chip {
max-width: 120px;
font-size: 11px;
}
.link-button {
padding: 2px 8px;
font-size: 10px;
.link-label {
display: none;
}
}
.pub-title-text {
font-size: 13px;
}
}
@media (max-width: 480px) {
.mat-column-journal {
display: none;
}
.mat-column-publisher {
display: none;
}
.mat-mdc-cell {
padding: 6px 8px;
font-size: 11px;
}
.authors-text {
font-size: 11px;
max-width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
.links-container {
gap: 4px;
}
.link-button {
padding: 2px 6px;
font-size: 9px;
}
}
}

Some files were not shown because too many files have changed in this diff Show More