Prismatic Czech Courts

Prismatic Czech Courts

10 files OSINT

Overview

Prismatic Czech Courts is an OSINT component of the Prismatic Platform's umbrella architecture. It extracts and structures data from Czech judicial sources including court decisions, insolvency proceedings, and enforcement records for intelligence analysis and compliance screening. The application connects to public judicial data sources through configurable provider adapters with rate limiting, caching, and error recovery built in.

Czech courts publish a substantial volume of structured and semi-structured data through public portals. This application transforms that raw judicial data into normalized, searchable intelligence that feeds into the platform's broader intelligence synthesis pipeline. Every extracted record carries full provenance metadata, enabling traceability from any intelligence product back to its original judicial source.

The module implements NLP extraction for unstructured court documents, identifying parties, dates, amounts, legal references, and outcome classifications with high accuracy. An entity resolution engine links court party references to canonical entity records across all Czech legal sources. The ISIR (Insolvency Register) monitoring subsystem provides continuous monitoring with configurable alert policies for new filings, status changes, creditor deadlines, and cross-entity proceedings detection.

Architecture

Source Portal --> HTTP Client --> HTML Parser --> Entity Extractor --> Normalizer --> Storage
      |               |              |                |                  |            |
   Public URL     Rate-limited    Floki/HTML5     Regex + NLP       Schema       Ecto +
   + Params       + Cached        Parsing         Extraction        Mapping       ETS

The ISIR monitoring architecture uses a polling worker with change detection:

ISIR API --> Polling Worker --> Change Detector --> Alert Engine --> Notification
    |             |                  |                  |               |
 REST API    Configurable        Diff against        Policy-based   PubSub +
 + RSS       interval (5min)    last known state    evaluation      webhook

Each source has a dedicated adapter implementing the OSINT provider protocol, ensuring consistent behavior across all judicial data sources. The OTP supervision tree manages court crawlers, ISIR monitors, and entity linkers as independent supervised processes.

Key Modules

ModuleResponsibility
PrismaticCzechCourtsPublic facade: extract_decision/1, resolve_party/1, monitor_isir/1
PrismaticCzechCourts.ApplicationOTP application entry point
PrismaticCzechCourts.NlpExtractorNamed entity recognition and legal reference parsing
PrismaticCzechCourts.EntityLinkerCross-registry entity resolution for court parties
PrismaticCzechCourts.IsirMonitorContinuous insolvency register polling and change detection
PrismaticCzechCourts.AlertEnginePolicy-based alert generation from monitored events

Data Sources

Data SourceURLData TypeUpdate Frequency
Justice.czjustice.czCommercial register filingsDaily
ISIRisir.justice.czInsolvency proceedingsReal-time
InfoSoudinfosoud.justice.czCourt hearings and decisionsDaily
InfoJednaniinfojednani.justice.czCourt session schedulesDaily
eJusticeejustice.czElectronic court submissionsPer submission

Each data source presents unique parsing challenges. Justice.cz serves semi-structured HTML with inconsistent formatting across court districts. ISIR provides a REST API with XML responses that follow a well-defined schema. InfoSoud combines tabular HTML with embedded PDF documents that require OCR extraction for older decisions. The adapter layer abstracts these differences, presenting a uniform data model to downstream consumers.

NLP Extraction Pipeline

The NLP extraction pipeline processes unstructured Czech legal text into structured intelligence records. Given the specialized vocabulary and citation patterns of Czech legal documents, the pipeline uses domain-specific models trained on annotated court decision corpora rather than general-purpose NLP tools.

NLP TaskTechniqueAccuracy
Party IdentificationNamed entity recognition with Czech morphology> 95%
Date ExtractionTemporal expression parsing (Czech date formats)> 98%
Amount ExtractionCurrency pattern matching (CZK, EUR, USD)> 97%
Legal ReferenceCzech citation parsing (Sb., Coll., EU directives)> 92%
Outcome ClassificationText classification (granted, dismissed, settled)> 90%
# NLP extraction from court decision text
defmodule PrismaticCzechCourts.NlpExtractor do
  @spec extract(String.t(), keyword()) :: {:ok, map()} | {:error, term()}
  def extract(court_text, opts \\ []) do
    with {:ok, parties} <- extract_parties(court_text),
         {:ok, dates} <- extract_dates(court_text),
         {:ok, amounts} <- extract_amounts(court_text),
         {:ok, references} <- extract_legal_references(court_text),
         {:ok, outcome} <- classify_outcome(court_text) do
      {:ok, %{
        parties: parties,
        dates: dates,
        amounts: amounts,
        legal_references: references,
        outcome: outcome,
        confidence: compute_aggregate_confidence(parties, dates, amounts)
      }}
    end
  end
end

ISIR Monitoring System

The Insolvency Register monitoring system is one of the most operationally critical components of Czech Courts. Insolvency proceedings in the Czech Republic follow strict deadlines -- creditors must file claims within specified periods, and missing these deadlines results in permanent loss of claim rights. The monitoring system tracks these deadlines and generates proactive alerts.

The system maintains a watchlist of monitored entities (identified by ICO or name) and polls ISIR at configurable intervals. When a new insolvency proceeding is filed against a monitored entity, or when an existing proceeding transitions to a new stage, the alert engine evaluates configured policies and generates notifications through PubSub and webhook channels.

# ISIR monitoring configuration
{:ok, monitor} = PrismaticCzechCourts.monitor_isir(
  ico: "12345678",
  alerts: [:new_filing, :status_change, :creditor_deadline, :asset_sale],
  notification_channels: [:pubsub, :webhook],
  polling_interval: :timer.minutes(5)
)

Configuration

config :prismatic_czech_courts,
  sources: [:justice_cz, :isir, :infosoud, :infojednani, :ejustice],
  isir_polling_interval: :timer.minutes(5),
  rate_limit_per_source: {1, :second},
  entity_resolution_enabled: true,
  nlp_extraction_enabled: true,
  watchlist_matching: true,
  max_concurrent_extractions: 10,
  ocr_enabled: true

API Reference

# Extract court decision with full provenance
{:ok, decision} = PrismaticCzechCourts.extract_decision(%{
  court: "Mestsky soud v Praze",
  case_number: "25 Cm 42/2024",
  include_parties: true,
  include_related: true
})

# Resolve court party to canonical entity
{:ok, entity} = PrismaticCzechCourts.resolve_party(%{
  name: "FIRMA, s.r.o.",
  ico: "12345678",
  role: :defendant
})
# => %{canonical_id: "CZ-ICO-12345678", confidence: 0.98}

# Set up ISIR monitoring for entity
{:ok, monitor} = PrismaticCzechCourts.monitor_isir(ico: "12345678",
  alerts: [:new_filing, :status_change, :creditor_deadline])

# Search court decisions by entity
{:ok, decisions} = PrismaticCzechCourts.search_decisions(
  party_ico: "12345678",
  from: ~D[2024-01-01],
  courts: [:mestsky_soud_praha, :krajsky_soud_brno]
)

Entity Resolution Across Court Sources

The entity linker resolves court party references to canonical entity records using a multi-strategy approach. Czech court documents reference entities through varying name formats, ICO numbers, and sometimes only partial identifying information. The linker applies progressively relaxed matching strategies until a resolution is achieved or the entity is flagged as unresolvable:

defmodule PrismaticCzechCourts.EntityLinker do
  @spec resolve(map()) :: {:ok, CanonicalEntity.t()} | {:error, :unresolvable}
  def resolve(%{ico: ico} = party) when is_binary(ico) do
    case lookup_by_ico(ico) do
      {:ok, entity} -> {:ok, entity}
      {:error, _} -> resolve_by_name(party)
    end
  end

  def resolve(party), do: resolve_by_name(party)

  defp resolve_by_name(%{name: name}) do
    candidates = fuzzy_search(name, threshold: 0.85)
    case candidates do
      [single] -> {:ok, single}
      multiple when length(multiple) > 1 -> {:ok, best_match(multiple, name)}
      [] -> {:error, :unresolvable}
    end
  end
end

Testing

Source adapter tests use HTML fixtures captured from actual Czech court portals. NLP extraction tests verify party identification, date extraction, and amount parsing against annotated court document samples. Entity resolution tests verify cross-registry linking using known entity relationships.

Integration tests exercise the full pipeline from source portal through extraction, NLP processing, entity resolution, and storage. ISIR monitoring tests verify change detection and alert generation using simulated insolvency proceeding state transitions. Property-based tests generate synthetic court documents to verify extraction robustness across formatting variations.

Integration Points

ApplicationRelationship
Prismatic OSINT CoreCore OSINT framework protocols and provider abstractions
Prismatic OSINT Czech LegalCzech legal registry integration for cross-source correlation
Prismatic Storage CorePersistent storage for court records and monitoring state
Prismatic NablaConfidence scoring for entity resolution and risk assessment
PrismaticInvestigation workflow integration for legal intelligence
Prismatic Czech AutocrawlerCross-referencing court data with business registry records

NABLA Compliance

NABLA AxiomCzech Courts EnforcementImplementation
Provenance MandatoryEvery extracted record carries source URL, timestamp, and hashFull judicial source provenance on all intelligence products
Signal PluralityCross-source correlation across multiple court portalsISIR, InfoSoud, Justice.cz provide independent signals
Time DecayInsolvency stage tracking with temporal metadataProceeding status timestamps enable temporal analysis
Contradiction PreservationConflicting court data across sources preservedCross-registry discrepancies flagged for review
Unknown ValidLow-confidence entity resolutions explicitly markedConfidence scores on all entity resolution results

Performance

OperationLatencyNotes
Decision extraction1-5sDepends on source portal response
Entity resolution< 100msAgainst cached canonical records
ISIR change detection< 500msDiff against stored state
NLP extraction200ms-2sDepends on document length
Watchlist evaluation< 50msETS-backed watchlist lookup
Full court search2-10sDepends on query scope and portal response

Telemetry events: [:prismatic, :czech_courts, :extraction], [:prismatic, :czech_courts, :isir_alert], [:prismatic, :czech_courts, :entity_resolved].


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL