From 1bf595915d48aec2e9d80df12d7cb2a275b4e5ba Mon Sep 17 00:00:00 2001 From: Khuder Khalti Date: Sat, 20 Jun 2026 11:07:40 +0200 Subject: [PATCH] feat(patents): extend patent details with CPC, application info, claims and status --- .../inse/patents/elastic_search_client.py | 14 ++- service/src/main/inse/patents/logic.py | 12 +++ service/src/main/inse/patents/model.py | 10 ++- webapp/src/app/api/api/patents.service.ts | 9 +- .../person-patents.component.html | 88 +++++++++++++++---- .../person-patents.component.scss | 77 +++++++++++----- 6 files changed, 165 insertions(+), 45 deletions(-) diff --git a/service/src/main/inse/patents/elastic_search_client.py b/service/src/main/inse/patents/elastic_search_client.py index 64d5865e..f10694e6 100644 --- a/service/src/main/inse/patents/elastic_search_client.py +++ b/service/src/main/inse/patents/elastic_search_client.py @@ -97,13 +97,15 @@ class PatentSearchClient: "kind", "date_publication", "date_publication_year", + "application_number", + "application_filing_date", "title_en", "title_de", "abstract", "inventors_name", "applicants_name", "ipc", - "ipc_text", + "cpc", ], "query": query, } @@ -150,13 +152,17 @@ class PatentSearchClient: "country", "publication_date", "publication_year", + "application_number", + "application_date", + "application_type", "title", "abstract", "inventors_names", - "inventors_names_text", "assignees_orgs", "ipcr", - "ipcr_text", + "cpc", + "number_of_claims", + "status", ], "query": query, } @@ -179,4 +185,4 @@ class PatentSearchClient: json=payload, ) response.raise_for_status() - return response.json() + return response.json() \ No newline at end of file diff --git a/service/src/main/inse/patents/logic.py b/service/src/main/inse/patents/logic.py index 7e82cc31..d5227bcc 100644 --- a/service/src/main/inse/patents/logic.py +++ b/service/src/main/inse/patents/logic.py @@ -87,6 +87,7 @@ def _parse_epo_hits(data: dict) -> list[model.PatentEntry]: inventors = src.get("inventors_name") or [] applicants = src.get("applicants_name") or [] ipc = src.get("ipc") or [] + cpc = src.get("cpc") or [] patents.append(model.PatentEntry( patent_id=f"EP{src.get('doc_number', hit.get('_id', ''))}", source="EPO", @@ -94,9 +95,13 @@ def _parse_epo_hits(data: dict) -> list[model.PatentEntry]: abstract=src.get("abstract"), publication_date=str(src.get("date_publication")) if src.get("date_publication") else None, publication_year=str(src.get("date_publication_year")) if src.get("date_publication_year") else None, + application_number=src.get("application_number"), + application_date=src.get("application_filing_date"), + kind=src.get("kind"), inventors=inventors if isinstance(inventors, list) else [inventors], assignees=applicants if isinstance(applicants, list) else [applicants], ipc=ipc if isinstance(ipc, list) else [ipc], + cpc=cpc if isinstance(cpc, list) else [cpc], country=src.get("country", "EP"), )) return patents @@ -109,6 +114,7 @@ def _parse_uspto_hits(data: dict) -> list[model.PatentEntry]: inventors = src.get("inventors_names") or [] assignees = src.get("assignees_orgs") or [] ipc = src.get("ipcr") or [] + cpc = src.get("cpc") or [] patents.append(model.PatentEntry( patent_id=f"US{src.get('publication_number', hit.get('_id', ''))}", source="USPTO", @@ -116,9 +122,15 @@ def _parse_uspto_hits(data: dict) -> list[model.PatentEntry]: abstract=src.get("abstract"), publication_date=str(src.get("publication_date")) if src.get("publication_date") else None, publication_year=str(src.get("publication_year")) if src.get("publication_year") else None, + application_number=src.get("application_number"), + application_date=str(src.get("application_date")) if src.get("application_date") else None, + application_type=src.get("application_type"), + number_of_claims=src.get("number_of_claims"), + status=src.get("status"), inventors=inventors if isinstance(inventors, list) else [inventors], assignees=assignees if isinstance(assignees, list) else [assignees], ipc=ipc if isinstance(ipc, list) else [ipc], + cpc=cpc if isinstance(cpc, list) else [cpc], country=src.get("country", "US"), )) return patents diff --git a/service/src/main/inse/patents/model.py b/service/src/main/inse/patents/model.py index 31ebc18c..dd622b70 100644 --- a/service/src/main/inse/patents/model.py +++ b/service/src/main/inse/patents/model.py @@ -8,13 +8,21 @@ class PatentEntry(BaseModel): abstract: str | None = None publication_date: str | None = None publication_year: str | None = None + application_number: str | None = None + application_date: str | None = None + kind: str | None = None # EPO only + application_type: str | None = None # USPTO only + number_of_claims: int | None = None # USPTO only + status: str | None = None # USPTO only inventors: list[str] = Field(default_factory=list) assignees: list[str] = Field(default_factory=list) ipc: list[str] = Field(default_factory=list) + cpc: list[str] = Field(default_factory=list) country: str | None = None + class PatentsByAuthorResponse(BaseModel): author_id: str author_name: str | None = None patent_count: int - patents: list[PatentEntry] + patents: list[PatentEntry] \ No newline at end of file diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index 6a0e0b8a..33d7412b 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -28,12 +28,17 @@ export interface PatentEntry { abstract: string | null; publication_date: string | null; publication_year: string | null; + application_number: string | null; + application_date: string | null; + kind: string | null; + application_type: string | null; + number_of_claims: number | null; + status: string | null; inventors: string[]; assignees: string[]; ipc: string[]; + cpc: string[]; country: string | null; - confidence_score: number; - } export interface PatentsByAuthorResponse { diff --git a/webapp/src/app/modules/person-patents/person-patents.component.html b/webapp/src/app/modules/person-patents/person-patents.component.html index 559aa284..db0c6bbb 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.html +++ b/webapp/src/app/modules/person-patents/person-patents.component.html @@ -6,20 +6,6 @@

Keine Patente gefunden.

} @else {
-
-

- {{ filteredPatents.length }} - Patente -

-

- {{ getEpoCount() }} - EPO -

-

- {{ getUsptoCount() }} - USPTO -

-
@if (showDetail && selectedPatent) {
} + + @if (selectedPatent.cpc.length > 0) { +
+

Klassifikation (CPC)

+ +
+ } + + @if (selectedPatent.application_number) { +
+

Anmeldungsnummer

+

{{ selectedPatent.application_number }}

+
+ } + + @if (selectedPatent.application_date) { +
+

Anmeldedatum

+

{{ formatDate(selectedPatent.application_date) }}

+
+ } + + @if (selectedPatent.kind) { +
+

Patentart

+

{{ selectedPatent.kind }}

+
+ } + + @if (selectedPatent.application_type) { +
+

Anmeldungstyp

+

{{ selectedPatent.application_type }}

+
+ } + + @if (selectedPatent.number_of_claims) { +
+

Anzahl Ansprüche

+

{{ selectedPatent.number_of_claims }}

+
+ } + + @if (selectedPatent.status) { +
+

Status

+

{{ selectedPatent.status }}

+
+ } + } @@ -148,8 +188,24 @@ } @else { -
-

Klicke auf ein Patent für Details.

+
+

Patentübersicht

+

Alle Patente dieser Person im Überblick.

+
+
+ {{ patents.length }} + Patente +
+
+ {{ getEpoCount() }} + EPO +
+
+ {{ getUsptoCount() }} + USPTO +
+
+

Wähle links ein Patent aus, um die Details zu sehen.

}
diff --git a/webapp/src/app/modules/person-patents/person-patents.component.scss b/webapp/src/app/modules/person-patents/person-patents.component.scss index df70826d..befd90ad 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.scss +++ b/webapp/src/app/modules/person-patents/person-patents.component.scss @@ -10,27 +10,6 @@ gap: 16px; } -.patents-summary { - margin-bottom: 8px; - display: flex; - gap: 24px; - - .summary-line { - margin: 0; - font-size: 14px; - color: #333; - } - - .summary-label { - color: #333; - } - - .summary-value { - font-weight: 600; - color: #333; - } -} - .sort-control { display: inline-flex; align-items: center; @@ -154,6 +133,60 @@ min-height: 200px; } + &.overview { + display: flex; + flex-direction: column; + gap: 12px; + + .overview-title { + font-size: 15px; + font-weight: 600; + color: #333; + margin: 0; + } + + .overview-subtitle { + font-size: 13px; + color: #888; + margin: 0; + } + + .overview-stats { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 10px; + margin-top: 4px; + } + + .overview-stat { + background: white; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 12px 8px; + text-align: center; + + .overview-value { + display: block; + font-size: 22px; + font-weight: 700; + color: #333; + } + + .overview-label { + display: block; + font-size: 12px; + color: #888; + margin-top: 4px; + } + } + + .overview-hint { + font-size: 12px; + color: #aaa; + margin: 0; + } + } + h3 { margin: 0 0 16px 0; font-size: 16px; @@ -239,7 +272,7 @@ font-size: 14px; font-weight: 400; padding: 0; - align-self: flex-start; // NEU + align-self: flex-start; &:hover { text-decoration: underline;