{
"tool_response": {
"type": "update",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/semantic-explorer\/semantik.php",
"content": "<?php ob_start(); ?>\n\n<nav class=\"breadcrumb\">\n <a href=\"\/\">Home<\/a> » <a href=\"\/explorer\">Explorer<\/a> » <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> » Semantik\n<\/nav>\n\n<h1>Semantik<\/h1>\n<p>Begriffe und ihre Bedeutungen aus den verarbeiteten Dokumenten.<\/p>\n\n<div class=\"stats-grid\">\n <div class=\"stat-card\">\n <span class=\"stat-card__value\"><?= $stats['total'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Begriffe<\/span>\n <\/div>\n <div class=\"stat-card\">\n <span class=\"stat-card__value\"><?= $stats['types'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Typen<\/span>\n <\/div>\n <div class=\"stat-card\">\n <span class=\"stat-card__value\"><?= $stats['linked_chunks'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Chunks<\/span>\n <\/div>\n <div class=\"stat-card\">\n <span class=\"stat-card__value\"><?= $stats['linked_docs'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Dokumente<\/span>\n <\/div>\n<\/div>\n\n<div class=\"filters\">\n <input type=\"search\" id=\"semantics-search\" class=\"form-input\" placeholder=\"Begriff suchen...\" value=\"<?= htmlspecialchars($currentSearch ?? '') ?>\">\n <select id=\"filter-type\" class=\"form-select\">\n <option value=\"\">Alle Typen<\/option>\n <?php foreach ($entityTypes ?? [] as $t): ?>\n <option value=\"<?= htmlspecialchars($t['type']) ?>\" <?= ($currentType ?? '') === $t['type'] ? 'selected' : '' ?>>\n <?= htmlspecialchars($t['type']) ?> (<?= $t['count'] ?>)\n <\/option>\n <?php endforeach; ?>\n <\/select>\n<\/div>\n\n<?php if (!empty($semantics)): ?>\n<table id=\"semantics-table\" data-sortable>\n <thead>\n <tr>\n <th data-sort=\"name\">Begriff<\/th>\n <th data-sort=\"type\">Art<\/th>\n <th data-sort=\"description\">Bedeutung<\/th>\n <th>Sprache<\/th>\n <th data-sort=\"chunk_count\">Chunks<\/th>\n <th data-sort=\"document_count\">Dokumente<\/th>\n <th>Status<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <?php foreach ($semantics as $s): ?>\n <tr>\n <td>\n <a href=\"\/semantic-explorer\/entitaeten\/<?= $s['id'] ?>\"><?= htmlspecialchars($s['name']) ?><\/a>\n <\/td>\n <td><?= htmlspecialchars($s['type']) ?><\/td>\n <td><?= htmlspecialchars($s['description'] ?? '-') ?><\/td>\n <td>de<\/td>\n <td><?= $s['chunk_count'] ?><\/td>\n <td><?= $s['document_count'] ?><\/td>\n <td><?= ($s['status'] ?? '') === 'normalized' ? 'normalisiert' : htmlspecialchars($s['status'] ?? 'roh') ?><\/td>\n <\/tr>\n <?php endforeach; ?>\n <\/tbody>\n<\/table>\n\n<?php if (($totalPages ?? 1) > 1): ?>\n<div class=\"pagination\">\n <?php for ($i = 1; $i <= min($totalPages, 10); $i++): ?>\n <a href=\"?page=<?= $i ?>&search=<?= urlencode($currentSearch ?? '') ?>&type=<?= urlencode($currentType ?? '') ?>\"\n class=\"<?= $i === ($currentPage ?? 1) ? 'active' : '' ?>\"><?= $i ?><\/a>\n <?php endfor; ?>\n<\/div>\n<?php endif; ?>\n\n<?php else: ?>\n<p class=\"empty-state\">Keine Begriffe gefunden. Verarbeiten Sie Dokumente mit der Pipeline.<\/p>\n<?php endif; ?>\n\n<p class=\"links-bar\">\n <a href=\"\/semantic-explorer\">Zurueck zum Explorer<\/a> |\n <a href=\"\/semantic-explorer\/entitaeten\">Entitaeten<\/a>\n<\/p>\n\n<script type=\"module\">\nimport { init } from '\/js\/components\/data-table.js';\n\nconst dataTable = init({\n clock: { now_epoch_ms_utc: () => Date.now() },\n logger: console,\n ui: {\n showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },\n disableFeature: (key) => { console.warn('Feature disabled: ' + key); },\n offerRetry: () => Promise.resolve(false)\n },\n runId: crypto.randomUUID()\n});\n\ndataTable.create('semantics-table', {\n searchInput: 'semantics-search',\n pageSize: 20,\n filters: {\n 'filter-type': 1\n }\n});\n<\/script>\n\n<?php $content = ob_get_clean(); ?>\n<?php require VIEW_PATH . '\/layout.php'; ?>\n",
"structuredPatch": [
{
"oldStart": 8,
"oldLines": 15,
"newStart": 8,
"newLines": 15,
"lines": [
" <p>Begriffe und ihre Bedeutungen aus den verarbeiteten Dokumenten.<\/p>",
" ",
" <div class=\"stats-grid\">",
"- <div class=\"stat-card stat-card--primary\">",
"+ <div class=\"stat-card\">",
" <span class=\"stat-card__value\"><?= $stats['total'] ?? 0 ?><\/span>",
" <span class=\"stat-card__label\">Begriffe<\/span>",
" <\/div>",
"- <div class=\"stat-card stat-card--success\">",
"+ <div class=\"stat-card\">",
" <span class=\"stat-card__value\"><?= $stats['types'] ?? 0 ?><\/span>",
" <span class=\"stat-card__label\">Typen<\/span>",
" <\/div>",
"- <div class=\"stat-card stat-card--info\">",
"+ <div class=\"stat-card\">",
" <span class=\"stat-card__value\"><?= $stats['linked_chunks'] ?? 0 ?><\/span>",
" <span class=\"stat-card__label\">Chunks<\/span>",
" <\/div>"
]
},
{
"oldStart": 28,
"oldLines": 7,
"newStart": 28,
"newLines": 7,
"lines": [
" ",
" <div class=\"filters\">",
" <input type=\"search\" id=\"semantics-search\" class=\"form-input\" placeholder=\"Begriff suchen...\" value=\"<?= htmlspecialchars($currentSearch ?? '') ?>\">",
"- <select id=\"filter-type\" class=\"form-select--inline\">",
"+ <select id=\"filter-type\" class=\"form-select\">",
" <option value=\"\">Alle Typen<\/option>",
" <?php foreach ($entityTypes ?? [] as $t): ?>",
" <option value=\"<?= htmlspecialchars($t['type']) ?>\" <?= ($currentType ?? '') === $t['type'] ? 'selected' : '' ?>>"
]
},
{
"oldStart": 55,
"oldLines": 41,
"newStart": 55,
"newLines": 14,
"lines": [
" <?php foreach ($semantics as $s): ?>",
" <tr>",
" <td>",
"- <a href=\"\/semantic-explorer\/entitaeten\/<?= $s['id'] ?>\">",
"- <strong><?= htmlspecialchars($s['name']) ?><\/strong>",
"- <\/a>",
"- <?php if (!empty($s['canonical_name'])): ?>",
"- <br><code class=\"text-muted\"><?= htmlspecialchars($s['canonical_name']) ?><\/code>",
"- <?php endif; ?>",
"+ <a href=\"\/semantic-explorer\/entitaeten\/<?= $s['id'] ?>\"><?= htmlspecialchars($s['name']) ?><\/a>",
" <\/td>",
"- <td><span class=\"badge badge--small\"><?= htmlspecialchars($s['type']) ?><\/span><\/td>",
"+ <td><?= htmlspecialchars($s['type']) ?><\/td>",
" <td><?= htmlspecialchars($s['description'] ?? '-') ?><\/td>",
" <td>de<\/td>",
"- <td>",
"- <?php if ($s['chunk_count'] > 0): ?>",
"- <a href=\"\/semantic-explorer\/chunks?search=<?= urlencode($s['name']) ?>\" title=\"Chunks anzeigen\">",
"- <?= $s['chunk_count'] ?> Chunk<?= $s['chunk_count'] > 1 ? 's' : '' ?>",
"- <\/a>",
"- <?php else: ?>",
"- <span class=\"text-muted\">0<\/span>",
"- <?php endif; ?>",
"- <\/td>",
"- <td>",
"- <?php if ($s['document_count'] > 0): ?>",
"- <a href=\"\/semantic-explorer\/dokumente\/<?= $s['first_document_id'] ?>\" title=\"<?= htmlspecialchars($s['first_filename'] ?? '') ?>\">",
"- <?= $s['document_count'] ?> Dok<?= $s['document_count'] > 1 ? 's' : '' ?>",
"- <\/a>",
"- <?php else: ?>",
"- <span class=\"text-muted\">0<\/span>",
"- <?php endif; ?>",
"- <\/td>",
"- <td>",
"- <?php if (($s['status'] ?? '') === 'normalized'): ?>",
"- <span class=\"badge badge--success badge--small\">normalisiert<\/span>",
"- <?php else: ?>",
"- <span class=\"badge badge--warning badge--small\"><?= htmlspecialchars($s['status'] ?? 'roh') ?><\/span>",
"- <?php endif; ?>",
"- <\/td>",
"+ <td><?= $s['chunk_count'] ?><\/td>",
"+ <td><?= $s['document_count'] ?><\/td>",
"+ <td><?= ($s['status'] ?? '') === 'normalized' ? 'normalisiert' : htmlspecialchars($s['status'] ?? 'roh') ?><\/td>",
" <\/tr>",
" <?php endforeach; ?>",
" <\/tbody>"
]
},
{
"oldStart": 97,
"oldLines": 7,
"newStart": 70,
"newLines": 7,
"lines": [
" ",
" <?php if (($totalPages ?? 1) > 1): ?>",
" <div class=\"pagination\">",
"- <?php for ($i = 1; $i <= $totalPages; $i++): ?>",
"+ <?php for ($i = 1; $i <= min($totalPages, 10); $i++): ?>",
" <a href=\"?page=<?= $i ?>&search=<?= urlencode($currentSearch ?? '') ?>&type=<?= urlencode($currentType ?? '') ?>\"",
" class=\"<?= $i === ($currentPage ?? 1) ? 'active' : '' ?>\"><?= $i ?><\/a>",
" <?php endfor; ?>"
]
},
{
"oldStart": 131,
"oldLines": 7,
"newStart": 104,
"newLines": 7,
"lines": [
" searchInput: 'semantics-search',",
" pageSize: 20,",
" filters: {",
"- 'filter-type': 2",
"+ 'filter-type': 1",
" }",
" });",
" <\/script>"
]
}
],
"originalFile": "<?php ob_start(); ?>\n\n<nav class=\"breadcrumb\">\n <a href=\"\/\">Home<\/a> » <a href=\"\/explorer\">Explorer<\/a> » <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> » Semantik\n<\/nav>\n\n<h1>Semantik<\/h1>\n<p>Begriffe und ihre Bedeutungen aus den verarbeiteten Dokumenten.<\/p>\n\n<div class=\"stats-grid\">\n <div class=\"stat-card stat-card--primary\">\n <span class=\"stat-card__value\"><?= $stats['total'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Begriffe<\/span>\n <\/div>\n <div class=\"stat-card stat-card--success\">\n <span class=\"stat-card__value\"><?= $stats['types'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Typen<\/span>\n <\/div>\n <div class=\"stat-card stat-card--info\">\n <span class=\"stat-card__value\"><?= $stats['linked_chunks'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Chunks<\/span>\n <\/div>\n <div class=\"stat-card\">\n <span class=\"stat-card__value\"><?= $stats['linked_docs'] ?? 0 ?><\/span>\n <span class=\"stat-card__label\">Dokumente<\/span>\n <\/div>\n<\/div>\n\n<div class=\"filters\">\n <input type=\"search\" id=\"semantics-search\" class=\"form-input\" placeholder=\"Begriff suchen...\" value=\"<?= htmlspecialchars($currentSearch ?? '') ?>\">\n <select id=\"filter-type\" class=\"form-select--inline\">\n <option value=\"\">Alle Typen<\/option>\n <?php foreach ($entityTypes ?? [] as $t): ?>\n <option value=\"<?= htmlspecialchars($t['type']) ?>\" <?= ($currentType ?? '') === $t['type'] ? 'selected' : '' ?>>\n <?= htmlspecialchars($t['type']) ?> (<?= $t['count'] ?>)\n <\/option>\n <?php endforeach; ?>\n <\/select>\n<\/div>\n\n<?php if (!empty($semantics)): ?>\n<table id=\"semantics-table\" data-sortable>\n <thead>\n <tr>\n <th data-sort=\"name\">Begriff<\/th>\n <th data-sort=\"type\">Art<\/th>\n <th data-sort=\"description\">Bedeutung<\/th>\n <th>Sprache<\/th>\n <th data-sort=\"chunk_count\">Chunks<\/th>\n <th data-sort=\"document_count\">Dokumente<\/th>\n <th>Status<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <?php foreach ($semantics as $s): ?>\n <tr>\n <td>\n <a href=\"\/semantic-explorer\/entitaeten\/<?= $s['id'] ?>\">\n <strong><?= htmlspecialchars($s['name']) ?><\/strong>\n <\/a>\n <?php if (!empty($s['canonical_name'])): ?>\n <br><code class=\"text-muted\"><?= htmlspecialchars($s['canonical_name']) ?><\/code>\n <?php endif; ?>\n <\/td>\n <td><span class=\"badge badge--small\"><?= htmlspecialchars($s['type']) ?><\/span><\/td>\n <td><?= htmlspecialchars($s['description'] ?? '-') ?><\/td>\n <td>de<\/td>\n <td>\n <?php if ($s['chunk_count'] > 0): ?>\n <a href=\"\/semantic-explorer\/chunks?search=<?= urlencode($s['name']) ?>\" title=\"Chunks anzeigen\">\n <?= $s['chunk_count'] ?> Chunk<?= $s['chunk_count'] > 1 ? 's' : '' ?>\n <\/a>\n <?php else: ?>\n <span class=\"text-muted\">0<\/span>\n <?php endif; ?>\n <\/td>\n <td>\n <?php if ($s['document_count'] > 0): ?>\n <a href=\"\/semantic-explorer\/dokumente\/<?= $s['first_document_id'] ?>\" title=\"<?= htmlspecialchars($s['first_filename'] ?? '') ?>\">\n <?= $s['document_count'] ?> Dok<?= $s['document_count'] > 1 ? 's' : '' ?>\n <\/a>\n <?php else: ?>\n <span class=\"text-muted\">0<\/span>\n <?php endif; ?>\n <\/td>\n <td>\n <?php if (($s['status'] ?? '') === 'normalized'): ?>\n <span class=\"badge badge--success badge--small\">normalisiert<\/span>\n <?php else: ?>\n <span class=\"badge badge--warning badge--small\"><?= htmlspecialchars($s['status'] ?? 'roh') ?><\/span>\n <?php endif; ?>\n <\/td>\n <\/tr>\n <?php endforeach; ?>\n <\/tbody>\n<\/table>\n\n<?php if (($totalPages ?? 1) > 1): ?>\n<div class=\"pagination\">\n <?php for ($i = 1; $i <= $totalPages; $i++): ?>\n <a href=\"?page=<?= $i ?>&search=<?= urlencode($currentSearch ?? '') ?>&type=<?= urlencode($currentType ?? '') ?>\"\n class=\"<?= $i === ($currentPage ?? 1) ? 'active' : '' ?>\"><?= $i ?><\/a>\n <?php endfor; ?>\n<\/div>\n<?php endif; ?>\n\n<?php else: ?>\n<p class=\"empty-state\">Keine Begriffe gefunden. Verarbeiten Sie Dokumente mit der Pipeline.<\/p>\n<?php endif; ?>\n\n<p class=\"links-bar\">\n <a href=\"\/semantic-explorer\">Zurueck zum Explorer<\/a> |\n <a href=\"\/semantic-explorer\/entitaeten\">Entitaeten<\/a>\n<\/p>\n\n<script type=\"module\">\nimport { init } from '\/js\/components\/data-table.js';\n\nconst dataTable = init({\n clock: { now_epoch_ms_utc: () => Date.now() },\n logger: console,\n ui: {\n showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },\n disableFeature: (key) => { console.warn('Feature disabled: ' + key); },\n offerRetry: () => Promise.resolve(false)\n },\n runId: crypto.randomUUID()\n});\n\ndataTable.create('semantics-table', {\n searchInput: 'semantics-search',\n pageSize: 20,\n filters: {\n 'filter-type': 2\n }\n});\n<\/script>\n\n<?php $content = ob_get_clean(); ?>\n<?php require VIEW_PATH . '\/layout.php'; ?>\n"
}
}