Backup #1930

ID1930
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/semantic-explorer/ontologie.php
Version10
Typ modified
Größe5.1 KB
Hashaa36efb462d8209a61f6c198f126a72a18003543ea9f71954b34cf777b07180e
Datum2025-12-28 01:22:10
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/">Campus KI</a> &raquo; <a href="/semantic-explorer">Semantic Explorer</a> &raquo; 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) * 100, 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'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1930 10 modified 5.1 KB 2025-12-28 01:22
1639 9 modified 5.1 KB 2025-12-27 09:45
1638 8 modified 5.1 KB 2025-12-27 09:45
1634 7 modified 5.1 KB 2025-12-27 09:45
1633 6 modified 5.1 KB 2025-12-27 09:45
1623 5 modified 5.2 KB 2025-12-27 09:44
1531 4 modified 5.2 KB 2025-12-26 07:16
1530 3 modified 5.7 KB 2025-12-26 07:15
1529 2 modified 3.0 KB 2025-12-26 07:02
15 1 modified 2.3 KB 2025-12-20 16:43

← Zurück zur Übersicht