Skip to content

Add ingestion tools with multi-model metadata extraction including geo/spatial and process-aware support - #182

Merged
makr-code merged 8 commits into
developfrom
copilot/add-ingestion-tool-for-themis-db
Jan 1, 2026
Merged

makr-code merged 8 commits into
developfrom
copilot/add-ingestion-tool-for-themis-db

Conversation

Copilot AI commented Jan 1, 2026 •

Copy link
Copy Markdown
Contributor

Implements autonomous ingestion tools for recursive directory scanning with comprehensive metadata extraction for ThemisDB's multi-model architecture (graph, vector, relational, geo/spatial, process). Hash-based deduplication via SQLite prevents reprocessing files.

Implementations

Python (tools/ingest.py)

  • Standalone CLI with argparse, tqdm progress bars, SHA256 hashing
  • SQLite tracking, YAML/JSON config support
  • Processes JSON, YAML, CSV, text files with configurable filters

C# .NET (tools/Themis.IngestionTool/)

  • Integrates Themis.AdminTools.Shared library
  • System.CommandLine CLI, Microsoft.Extensions.Logging
  • System.Data.SQLite tracking, YamlDotNet for YAML
  • Identical functionality to Python version

Metadata Extraction

Both tools generate ThemisDB-compatible metadata for all models:

{
  "themisMetadata": {
    "graph": {
      "entityType": "Document",
      "entityId": "file.json",
      "properties": {"source_file": "...", "file_type": ".json"},
      "relationships": []
    },
    "vector": {
      "objectName": "documents",
      "embeddingRequired": true,
      "textContent": "...",
      "contentLength": 380
    },
    "relational": {
      "tableName": "ingested_documents",
      "schema": {"id": "TEXT PRIMARY KEY", ...},
      "record": {"id": "file.json", ...}
    },
    "geo": {
      "hasGeometry": true,
      "coordinateFields": {
        "latitude": 52.52,
        "longitude": 13.405,
        "srid": 4326
      },
      "addressFields": {
        "address": "Hauptstraße 123",
        "city": "Berlin",
        "postal_code": "10115",
        "country": "Germany"
      },
      "geometryWkt": "POINT(13.405 52.52)",
      "fullAddress": "Hauptstraße 123, 10115, Berlin, Germany",
      "spatialIndexRequired": true,
      "indexType": "R-Tree"
    },
    "process": {
      "isProcessAware": true,
      "processFields": {
        "state": "pending",
        "activity": "Review Order",
        "case_id": "ORDER-12345",
        "timestamp": "2026-01-01T10:00:00Z",
        "resource": "[email protected]",
        "variables": {...}
      },
      "hasState": true,
      "hasVariables": true,
      "isProcessInstance": true,
      "processMiningReady": true,
      "suggestedCollection": "_process_instances"
    }
  }
}

Geo/Spatial Metadata

  • Automatic detection of latitude/longitude coordinates (WGS84, SRID 4326)
  • Address field extraction (street, city, postal code, country)
  • WKT geometry generation (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON)
  • Full address string composition
  • Spatial index hints (R-Tree)

Process-Aware Metadata

  • State/status tracking for workflow instances
  • Activity/task information
  • Case/instance ID identification
  • Process variables and tokens
  • BPMN format automatic detection
  • State machine transition tracking
  • Process mining readiness validation
  • Suggested collection hints (_process_instances, _process_definitions)

Usage

# Python
python3 tools/ingest.py --source /data --output results.json

# C#
cd tools/Themis.IngestionTool
dotnet run -- --source /data --output results.json

Both tools skip already-ingested files via hash comparison, log progress, and support include/exclude patterns for file filtering.

Original prompt

Wir brauchen in .\tools ein Ingestion Werkzeug. Es soll erlauben Verzeichnisse rekursiv nach ingestierbaren Dateien zu durchsuchen (ggf. json / yaml Metadaten mit einzubeziehen) die für Themis DB relevanten Metadaten zu generieren / extraieren (graph, vector,relational). es soll möglichst autonom arbeiten, den vorschritt pro Datei und gesamtvorschritt als Progressbar anzeigen. es soll ein log geschrieben werden und bereits ingestierte Dateien (hash-wert) sollen ausgeschlossen/übersprungen werden.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add ingestion tool for recursive file processing Add ingestion tools for recursive file scanning with hash-based deduplication Jan 1, 2026
Copilot AI requested a review from makr-code January 1, 2026 08:38
@makr-code

Copy link
Copy Markdown
Owner

@copilot Es fehlt der geo/spatial und Prozessbewusste json

Copilot AI commented Jan 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Es fehlt der geo/spatial und Prozessbewusste json

Geo/Spatial und Prozess-Metadaten hinzugefügt in commit 92b77fe.

Geo/Spatial Unterstützung:

  • Latitude/Longitude Koordinaten
  • Adressen (Straße, Stadt, PLZ, Land)
  • WKT Geometrie-Generierung (POINT)
  • Spatial Index Hints (R-Tree, SRID 4326)

Prozessbewusste Metadaten:

  • State/Status Tracking
  • Activity/Task Information
  • Case/Instance IDs
  • Process Variables & Tokens
  • BPMN-Erkennung
  • Process Mining Bereitschaft
  • Vorgeschlagene Collections (_process_instances, _process_definitions)

Beide Tools (Python + C#) unterstützen jetzt alle ThemisDB Multi-Model Metadaten: Graph, Vector, Relational, Geo und Process.

Copilot AI changed the title Add ingestion tools for recursive file scanning with hash-based deduplication Add ingestion tools with multi-model metadata extraction including geo/spatial and process-aware support Jan 1, 2026
@makr-code
makr-code marked this pull request as ready for review January 1, 2026 16:51
@makr-code
makr-code merged commit 8c04e32 into develop Jan 1, 2026
@makr-code makr-code added this to the v1.0.2 milestone Mar 11, 2026
Copilot AI added a commit that referenced this pull request Jul 17, 2026
makr-code added a commit that referenced this pull request Jul 17, 2026
fix(ci): add explicit GITHUB_TOKEN permissions to packaging-release.yml (CodeQL #182)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants