ontologie.php
- Pfad:
src/View/semantic-explorer/ontologie.php
- Namespace: -
- Zeilen: 150 | Größe: 5,290 Bytes
- Geändert: 2025-12-28 01:22:10 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 99
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 90 (10%)
Issues 1
| Zeile |
Typ |
Beschreibung |
| 56 |
magic_number |
Magic Number gefunden: 100 |
Versionen 10
-
v10
2025-12-28 01:22 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v9
2025-12-27 09:45 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v8
2025-12-27 09:45 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v7
2025-12-27 09:45 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v6
2025-12-27 09:45 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v5
2025-12-27 09:44 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v4
2025-12-26 07:16 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v3
2025-12-26 07:15 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
-
v2
2025-12-26 07:02 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation
-
v1
2025-12-20 16:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Campus KI</a> » <a href="/semantic-explorer">Semantic Explorer</a> » Ontologie
</nav>
<h1>Ontologie</h1>
<p>Klassifizierte Entitäten mit ihren Ontologie-Klassen und Verbindungen.</p>
<div class="stats-grid">
<div class="stat-card">
<span class="stat-card__value"><?= $stats['total_classes'] ?? 0 ?></span>
<span class="stat-card__label">Klassen</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= $stats['classified_entities'] ?? 0 ?></span>
<span class="stat-card__label">Klassifizierte Entitäten</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= $totalCount ?? 0 ?></span>
<span class="stat-card__label">Zuordnungen</span>
</div>
</div>
<div class="filters">
<input type="search" id="ontology-search" class="form-input" placeholder="Entität suchen..." value="<?= htmlspecialchars($currentSearch ?? '') ?>">
<select id="filter-class" class="form-select">
<option value="">Alle Klassen</option>
<?php foreach ($classes ?? [] as $c): ?>
<option value="<?= $c['id'] ?>" <?= ($currentClass ?? '') == $c['id'] ? 'selected' : '' ?>>
<?= htmlspecialchars($c['name']) ?> (<?= $c['entity_count'] ?>)
</option>
<?php endforeach; ?>
</select>
</div>
<?php if (!empty($entities)): ?>
<table id="ontology-table" data-sortable>
<thead>
<tr>
<th data-sort="entity_name">Entität</th>
<th data-sort="entity_type">Typ</th>
<th data-sort="description">Beschreibung</th>
<th data-sort="class_name">Klasse</th>
<th data-sort="confidence">Konfidenz %</th>
<th>Verbindungen</th>
</tr>
</thead>
<tbody>
<?php foreach ($entities as $e): ?>
<tr>
<td>
<a href="/semantic-explorer/entitaeten/<?= $e['entity_id'] ?>"><?= htmlspecialchars($e['entity_name']) ?></a>
</td>
<td><?= htmlspecialchars($e['entity_type']) ?></td>
<td><?= htmlspecialchars(substr($e['description'] ?? '-', 0, 100)) ?></td>
<td><?= htmlspecialchars($e['class_name']) ?></td>
<td><?= number_format((float) ($e['confidence'] ?? 0) * \Domain\Constants::PERCENT_FULL, 0) ?></td>
<td>
<?php if (!empty($e['relations'])): ?>
<?php
$rels = explode(', ', $e['relations']);
$relLinks = [];
foreach (array_slice($rels, 0, 3) as $rel):
$parts = explode(':', $rel, 2);
$relLinks[] = htmlspecialchars($parts[1] ?? $rel);
endforeach;
echo implode(', ', $relLinks);
if (count($rels) > 3): ?>
<span class="text-muted"> +<?= count($rels) - 3 ?></span>
<?php endif; ?>
<?php else: ?>
-
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if (($totalPages ?? 1) > 1): ?>
<div class="pagination">
<?php for ($i = 1; $i <= min($totalPages, 10); $i++): ?>
<a href="?page=<?= $i ?>&search=<?= urlencode($currentSearch ?? '') ?>&class=<?= urlencode($currentClass ?? '') ?>"
class="<?= $i === ($currentPage ?? 1) ? 'active' : '' ?>"><?= $i ?></a>
<?php endfor; ?>
</div>
<?php endif; ?>
<?php else: ?>
<p class="empty-state">Keine klassifizierten Entitäten gefunden. Führen Sie die Pipeline mit semantischer Analyse aus.</p>
<?php endif; ?>
<h2>Ontologie-Klassen</h2>
<table data-sortable>
<thead>
<tr>
<th>Klasse</th>
<th>Beschreibung</th>
<th>Entitäten</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<?php foreach ($classes ?? [] as $c): ?>
<tr>
<td><?= htmlspecialchars($c['name']) ?></td>
<td><?= htmlspecialchars(substr($c['description'] ?? '', 0, 80)) ?></td>
<td><?= $c['entity_count'] ?></td>
<td>
<a href="?class=<?= $c['id'] ?>" class="btn">Anzeigen</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p class="links-bar">
<a href="/semantic-explorer">Zurueck zum Explorer</a> |
<a href="/semantic-explorer/taxonomie">Taxonomie</a> |
<a href="/semantic-explorer/semantik">Semantik</a> |
<a href="/semantic-explorer/graph">Graph</a>
</p>
<script type="module">
import { init } from '/js/components/data-table.js';
const dataTable = init({
clock: { now_epoch_ms_utc: () => Date.now() },
logger: console,
ui: {
showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },
disableFeature: (key) => { console.warn('Feature disabled: ' + key); },
offerRetry: () => Promise.resolve(false)
},
runId: crypto.randomUUID()
});
dataTable.create('ontology-table', {
searchInput: 'ontology-search',
pageSize: 20,
filters: {
'filter-class': 2
}
});
</script>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>