index.php
- Pfad:
src/View/semantic-explorer/index.php - Namespace: -
- Zeilen: 218 | Größe: 9,292 Bytes
- Geändert: 2025-12-28 03:05:42 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 99
- Dependencies: 100 (25%)
- LOC: 94 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Versionen 7
-
v7
2025-12-28 03:05 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v6
2025-12-27 09:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v5
2025-12-27 09:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v4
2025-12-27 09:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v3
2025-12-27 00:27 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-23 17:00 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-23 16:42 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Campus KI</a> » Semantic Explorer
</nav>
<h1>Semantic Explorer</h1>
<p>Nutzdaten aus Nextcloud mit Chunking und Vektor-Embeddings.</p>
<div class="stats-grid">
<div class="stat-card stat-card--primary">
<span class="stat-card__value"><?= number_format($docStats['total'] ?? 0) ?></span>
<span class="stat-card__label">Dokumente</span>
</div>
<div class="stat-card stat-card--success">
<span class="stat-card__value"><?= number_format($docStats['processed'] ?? 0) ?></span>
<span class="stat-card__label">Verarbeitet</span>
</div>
<div class="stat-card stat-card--warning">
<span class="stat-card__value"><?= number_format($docStats['errors'] ?? 0) ?></span>
<span class="stat-card__label">Fehler</span>
</div>
<div class="stat-card stat-card--info">
<span class="stat-card__value"><?= number_format($chunkStats['total'] ?? 0) ?></span>
<span class="stat-card__label">Chunks</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= number_format($chunkStats['tokens'] ?? 0) ?></span>
<span class="stat-card__label">Tokens</span>
</div>
<div class="stat-card stat-card--success">
<span class="stat-card__value"><?= number_format($chunkStats['embedded'] ?? 0) ?></span>
<span class="stat-card__label">In Qdrant</span>
</div>
</div>
<h2>Semantik-Analyse Coverage</h2>
<div class="stats-grid">
<div class="stat-card stat-card--<?= ($textSemanticStats['coverage'] ?? 0) >= 90 ? 'success' : (($textSemanticStats['coverage'] ?? 0) >= 50 ? 'warning' : 'danger') ?>">
<span class="stat-card__value"><?= $textSemanticStats['coverage'] ?? 0 ?>%</span>
<span class="stat-card__label">Text-Semantik (<?= number_format($textSemanticStats['analyzed'] ?? 0) ?>/<?= number_format($textSemanticStats['total'] ?? 0) ?>)</span>
<div class="progress-bar" style="margin-top: 0.5rem;">
<div class="progress-bar__fill" style="width: <?= $textSemanticStats['coverage'] ?? 0 ?>%; background: var(--color-success);"></div>
</div>
</div>
<div class="stat-card stat-card--<?= ($knowledgeSemanticStats['coverage'] ?? 0) >= 90 ? 'success' : (($knowledgeSemanticStats['coverage'] ?? 0) >= 50 ? 'warning' : 'danger') ?>">
<span class="stat-card__value"><?= $knowledgeSemanticStats['coverage'] ?? 0 ?>%</span>
<span class="stat-card__label">Knowledge-Semantik (<?= number_format($knowledgeSemanticStats['analyzed'] ?? 0) ?>/<?= number_format($knowledgeSemanticStats['total'] ?? 0) ?>)</span>
<div class="progress-bar" style="margin-top: 0.5rem;">
<div class="progress-bar__fill" style="width: <?= $knowledgeSemanticStats['coverage'] ?? 0 ?>%; background: var(--color-info);"></div>
</div>
</div>
</div>
<?php if (!empty($textSemanticStats['by_statement_form']) || !empty($knowledgeSemanticStats['by_semantic_role'])): ?>
<div class="grid grid--2">
<?php if (!empty($textSemanticStats['by_statement_form'])): ?>
<div class="card">
<h3>Text-Semantik: Aussageformen</h3>
<div class="tags">
<?php foreach ($textSemanticStats['by_statement_form'] as $sf): ?>
<span class="badge badge--primary"><?= htmlspecialchars($sf['statement_form']) ?> <small>(<?= $sf['count'] ?>)</small></span>
<?php endforeach; ?>
</div>
<?php if (!empty($textSemanticStats['by_intent'])): ?>
<h4 style="margin-top: 1rem;">Absichten</h4>
<div class="tags">
<?php foreach ($textSemanticStats['by_intent'] as $intent): ?>
<span class="badge badge--info"><?= htmlspecialchars($intent['intent']) ?> <small>(<?= $intent['count'] ?>)</small></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!empty($knowledgeSemanticStats['by_semantic_role'])): ?>
<div class="card">
<h3>Knowledge-Semantik: Rollen</h3>
<div class="tags">
<?php foreach ($knowledgeSemanticStats['by_semantic_role'] as $role): ?>
<span class="badge badge--success"><?= htmlspecialchars($role['semantic_role']) ?> <small>(<?= $role['count'] ?>)</small></span>
<?php endforeach; ?>
</div>
<?php if (!empty($knowledgeSemanticStats['by_functional_category'])): ?>
<h4 style="margin-top: 1rem;">Kategorien</h4>
<div class="tags">
<?php foreach ($knowledgeSemanticStats['by_functional_category'] as $cat): ?>
<span class="badge badge--warning"><?= htmlspecialchars($cat['functional_category']) ?> <small>(<?= $cat['count'] ?>)</small></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<h2>Bereiche</h2>
<table data-sortable>
<thead>
<tr>
<th data-sort="bereich">Bereich</th>
<th data-sort="beschreibung">Beschreibung</th>
<th data-sort="anzahl">Anzahl</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/semantic-explorer/dokumente">Dokumente</a></td>
<td>PDFs, DOCX, PPTX aus Nextcloud</td>
<td><?= $docStats['total'] ?? 0 ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/chunks">Chunks</a></td>
<td>Semantische Textabschnitte mit Embeddings</td>
<td><?= number_format($chunkStats['total'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/entitaeten">Entitäten</a></td>
<td>Personen, Organisationen, Konzepte</td>
<td><?= number_format($semanticStats['entities'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/relationen">Relationen</a></td>
<td>Beziehungen zwischen Entitäten</td>
<td><?= number_format($semanticStats['relations'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/graph"><strong>Graph</strong></a></td>
<td>Visualisierung aller Entitäten und Relationen</td>
<td><?= number_format(($semanticStats['entities'] ?? 0) + ($semanticStats['relations'] ?? 0)) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/taxonomie">Taxonomie</a></td>
<td>Hierarchische Kategorisierung</td>
<td><?= number_format($semanticStats['taxonomy'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/ontologie">Ontologie</a></td>
<td>Konzept-Klassen und Eigenschaften</td>
<td><?= number_format($semanticStats['ontology'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/semantik">Semantik</a></td>
<td>Sentiment, Keywords, Zusammenfassungen</td>
<td><?= number_format($semanticStats['semantics'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/stopwords">Stopwords</a></td>
<td>Filter fuer Entity-Extraction</td>
<td><?= number_format($semanticStats['stopwords'] ?? 0) ?></td>
</tr>
<tr>
<td><a href="/semantic-explorer/suche">Suche</a></td>
<td>Semantische Vektor-Suche</td>
<td>-</td>
</tr>
</tbody>
</table>
<?php if (!empty($documents)): ?>
<h2>Dokumente</h2>
<table data-sortable>
<thead>
<tr>
<th data-sort="filename">Datei</th>
<th data-sort="mime_type">Typ</th>
<th data-sort="status">Status</th>
<th data-sort="chunk_count">Chunks</th>
<th data-sort="imported_at">Importiert</th>
</tr>
</thead>
<tbody>
<?php foreach ($documents as $doc): ?>
<tr>
<td><a href="/semantic-explorer/dokumente/<?= $doc['id'] ?>"><?= htmlspecialchars($doc['filename']) ?></a></td>
<td><code><?= htmlspecialchars($doc['mime_type'] ?? '-') ?></code></td>
<td><span class="badge badge--<?= $doc['status'] ?>"><?= $doc['status'] ?></span></td>
<td><?= $doc['chunk_count'] ?></td>
<td><?= date('d.m.Y H:i', strtotime($doc['imported_at'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if (!empty($recentChunks)): ?>
<h2>Neueste Chunks</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Dokument</th>
<th>Tokens</th>
<th>Status</th>
<th>Inhalt</th>
</tr>
</thead>
<tbody>
<?php foreach ($recentChunks as $c): ?>
<tr>
<td><a href="/semantic-explorer/chunks/<?= $c['id'] ?>">#<?= $c['id'] ?></a></td>
<td><?= htmlspecialchars($c['filename']) ?></td>
<td><?= $c['token_count'] ?></td>
<td><?php if ($c['qdrant_id']): ?><span class="badge badge--success">synced</span><?php else: ?><span class="badge">pending</span><?php endif; ?></td>
<td><?= htmlspecialchars(substr($c['content'], 0, 80)) ?>...</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<p class="links-bar">
<a href="/explorer">Zurueck zum Explorer</a> |
<a href="/semantic-explorer/suche">Semantische Suche</a>
</p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>