Skip to content

adorsys/devland2026-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo – Let your data write the code

Dieses Verzeichnis enthält die lauffähige Demo zum Vortrag „Let your data write the code – Was semantische Daten mit KI möglich machen" (DevLand 2026 / Europapark, Track Data Dock).

Was die Demo zeigt

Zwei Ontologien (ShopProductCatalogItem) werden einem LLM übergeben. Das LLM generiert einen Mapping-Vorschlag mit Confidence-Levels, der Fachbereich korrigiert eine offene Stelle (promotionScore), und aus dem validierten Mapping entsteht lauffähiger Python-Code und SQL – vollautomatisch.

Voraussetzungen

# Python 3.10+
pip install -r requirements.txt

# Anthropic API Key
export ANTHROPIC_API_KEY=sk-ant-...

Demo-Reset (vor dem Vortrag)

# Aus dem Repo-Root:
bash setup_demo.sh

Entfernt alle generierten Dateien (mapping_proposal.yaml, map_python.py, map_sql.sql, catalog_items.csv) für einen sauberen Start.

Demo-Ablauf

Step 0 – Ontologien in Metaphactory (Video)

ontologies/shop_product.ttl und ontologies/catalog_item.ttl sind in Metaphactory importiert. promotionScore hat den Comment „Calculation TBD" – sichtbar als offene Stelle.

Step 1 – LLM generiert Mapping-Vorschlag

python -m src.generate_mapping

Liest beide .ttl-Dateien via rdflib, baut System- und User-Prompt, ruft die Claude API auf, schreibt mappings/mapping_proposal.yaml.

Erwartetes Ergebnis: promotionScore mit confidence: none und note: "No source field found. Calculation TBD per ontology comment.".

Step 2 – Fachbereich korrigiert (Video / manuell)

mappings/mapping_v1.yaml liegt vor (manuell erstellt / in Metaphactory bestätigt). Enthält die promotionScore-Formel mit confidence: high.

Step 3 – Code generieren

python -m src.generate_code

Liest mappings/mapping_v1.yaml, ruft die Claude API auf, schreibt:

  • output/map_python.py – Python-Transformationsfunktion map_product()
  • output/map_sql.sql – äquivalentes SQL

Step 4 – Mapping auf Daten anwenden

python -m src.apply_mapping

Lädt output/map_python.py, wendet map_product() auf jede Zeile in data/sample_products.csv an, schreibt output/catalog_items.csv.

Verzeichnisstruktur

demo/
  ontologies/              # shop_product.ttl, catalog_item.ttl  (Quell-Ontologien)
  mappings/                # mapping_proposal.yaml (LLM), mapping_v1.yaml (validiert)
  data/                    # sample_products.csv
  output/                  # map_python.py, map_sql.sql, catalog_items.csv  (generiert)
  src/
    extract_schema.py      # rdflib: TTL → Property-Liste
    generate_mapping.py    # Step 1: Ontologien → Mapping-YAML via LLM
    generate_code.py       # Step 3: Mapping-YAML → Python + SQL via LLM
    apply_mapping.py       # Step 4: map_product() auf CSV anwenden
  tests/                   # pytest-Suite (unit + end-to-end)
  metaphactory_ontologies/ # Exports aus Metaphactory (Referenz, nicht für den Run)
  prompts/                 # Gespeicherte Prompts (werden bei Step 1+3 erzeugt)
  requirements.txt

Tests

# Unit-Tests (kein API-Key nötig)
pytest tests/test_extract_schema.py tests/test_generate_code.py -v

# End-to-End (benötigt ANTHROPIC_API_KEY)
pytest tests/test_end_to_end.py -v

About

Let your data write the code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%