<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VitalVault Ontology Documentation</title>
    <meta name="description" content="Modular semantic web schema for personal health and wellness data">
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header>
        <div class="container">
            <h1>VitalVault Ontology Documentation</h1>
            <p class="subtitle">Modular Semantic Web Schema for Personal Health Data</p>
        </div>
    </header>

    <main class="container">
        <section id="overview">
            <h2>Overview</h2>
            <p>
                VitalVault provides a modular ontology framework for representing personal health and wellness data
                using <a href="https://www.w3.org/RDF/" target="_blank">Linked Data standards</a>. The architecture
                separates core cross-cutting concerns from domain-specific vocabularies, enabling flexible extension
                as new health applications are added.
            </p>

            <div class="info-box">
                <h3>Key Features</h3>
                <ul>
                    <li><strong>Modular Design:</strong> Core vocabulary (vv:) + domain vocabularies (pots:, ecg:, glucose:, ...)</li>
                    <li><strong>Standards-Based:</strong> Built on W3C RDF, OWL, and PROV-O recommendations</li>
                    <li><strong>Healthcare Interoperability:</strong> Aligned with FHIR, SNOMED CT, LOINC standards</li>
                    <li><strong>Privacy-First:</strong> Designed for Solid Pod storage with WebID-based access control</li>
                    <li><strong>Semantic Versioning:</strong> Independent version tracking per vocabulary</li>
                </ul>
            </div>
        </section>

        <section id="vocabularies">
            <h2>Available Vocabularies</h2>

            <div class="vocab-card">
                <div class="vocab-header">
                    <h3>Core Vocabulary</h3>
                    <span class="badge success">v1.0 Stable</span>
                </div>
                <dl>
                    <dt>Namespace:</dt>
                    <dd><code>https://vitalvault.org/vocab/core#</code></dd>
                    <dt>Prefix:</dt>
                    <dd><code>vv:</code></dd>
                    <dt>Purpose:</dt>
                    <dd>Cross-application vocabulary for schema versioning, data provenance, and user identity</dd>
                </dl>
                <p>
                    Defines foundational concepts used by all VitalVault health data applications, including
                    schema version tracking, consumer vs. clinical data provenance, and Solid WebID integration.
                </p>
                <div class="button-group">
                    <a href="core/v1.0/index.html" class="btn btn-primary">View Documentation →</a>
                    <a href="core/v1.0/core.ttl" class="btn btn-secondary" download>Download TTL</a>
                </div>
            </div>

            <div class="vocab-card">
                <div class="vocab-header">
                    <h3>POTS Check Vocabulary</h3>
                    <span class="badge success">v1.2 Stable</span>
                </div>
                <dl>
                    <dt>Namespace:</dt>
                    <dd><code>https://vitalvault.org/vocab/pots#</code></dd>
                    <dt>Prefix:</dt>
                    <dd><code>pots:</code></dd>
                    <dt>Purpose:</dt>
                    <dd>Domain-specific vocabulary for POTS home screening checks</dd>
                    <dt>Imports:</dt>
                    <dd><code>vv:</code> (Core Vocabulary v1.0)</dd>
                </dl>
                <p>
                    Describes consumer-generated wellness data from guided orthostatic screening checks using
                    the NASA Lean Test protocol with Apple Watch heart rate monitoring and iPhone posture tracking.
                    Supports age-adjusted thresholds, symptom logging, and blood pressure analysis.
                </p>
                <div class="button-group">
                    <a href="pots/v1.2/index.html" class="btn btn-primary">View Documentation →</a>
                    <a href="pots/v1.2/pots.ttl" class="btn btn-secondary" download>Download TTL</a>
                </div>
            </div>

            <div class="vocab-card coming-soon">
                <div class="vocab-header">
                    <h3>ECG Vocabulary</h3>
                    <span class="badge">Coming Soon</span>
                </div>
                <dl>
                    <dt>Namespace:</dt>
                    <dd><code>https://vitalvault.org/vocab/ecg#</code></dd>
                    <dt>Prefix:</dt>
                    <dd><code>ecg:</code></dd>
                    <dt>Purpose:</dt>
                    <dd>Electrocardiogram data from Apple Watch and medical devices</dd>
                </dl>
                <p>Planned for v2.0</p>
            </div>

            <div class="vocab-card coming-soon">
                <div class="vocab-header">
                    <h3>Glucose Vocabulary</h3>
                    <span class="badge">Coming Soon</span>
                </div>
                <dl>
                    <dt>Namespace:</dt>
                    <dd><code>https://vitalvault.org/vocab/glucose#</code></dd>
                    <dt>Prefix:</dt>
                    <dd><code>glucose:</code></dd>
                    <dt>Purpose:</dt>
                    <dd>Blood glucose monitoring data from CGMs and glucometers</dd>
                </dl>
                <p>Planned for v2.1</p>
            </div>
        </section>

        <section id="principles">
            <h2>Design Principles</h2>

            <div class="principle-card">
                <h3>1. Modularity</h3>
                <p>
                    Core concepts (<code>vv:</code>) are stable and versioned independently from domain vocabularies
                    (<code>pots:</code>, <code>ecg:</code>, etc.). New health apps can be added without breaking existing data.
                </p>
            </div>

            <div class="principle-card">
                <h3>2. Interoperability</h3>
                <p>
                    All vocabularies align with healthcare standards (FHIR, SNOMED CT, LOINC) and use standard
                    W3C formats (RDF, OWL, PROV-O) for maximum compatibility with medical systems.
                </p>
            </div>

            <div class="principle-card">
                <h3>3. Privacy-First</h3>
                <p>
                    Designed for local-first storage in Solid Pods with WebID-based access control. Users own
                    their data and control who can access it.
                </p>
            </div>

            <div class="principle-card">
                <h3>4. Consumer Wellness Focus</h3>
                <p>
                    Data is classified as consumer-generated wellness information (non-diagnostic). Non-medical
                    language throughout emphasizes that results are informational only.
                </p>
            </div>

            <div class="principle-card">
                <h3>5. Provenance Tracking</h3>
                <p>
                    All data includes comprehensive provenance metadata using W3C PROV-O, tracking who created
                    the data, when, and how it was generated.
                </p>
            </div>
        </section>

        <section id="usage">
            <h2>Quick Start</h2>

            <h3>Basic Example</h3>
            <p>Here's a minimal example showing how the vocabularies work together:</p>

            <pre><code>@prefix vv: &lt;https://vitalvault.org/vocab/core#&gt; .
@prefix pots: &lt;https://vitalvault.org/vocab/pots#&gt; .
@prefix prov: &lt;http://www.w3.org/ns/prov#&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;#pots-check-abc123&gt; a pots:POTSCheckResult ;
    # Core vocabulary properties
    vv:schemaVersion "1.2" ;
    vv:dataProvenance vv:ConsumerGenerated ;

    # POTS-specific properties
    pots:date "2025-10-31T14:30:00Z"^^xsd:dateTime ;
    pots:protocol "nasaLean" ;
    pots:potsThresholdMet "true"^^xsd:boolean ;

    # Provenance tracking
    prov:wasAttributedTo &lt;https://user.vitalvault.org/profile/card#me&gt; .</code></pre>

            <p>
                See individual vocabulary documentation for complete property lists and usage examples.
            </p>
        </section>

        <section id="resources">
            <h2>Resources</h2>
            <ul>
                <li><a href="https://www.w3.org/RDF/" target="_blank">W3C RDF Specification</a></li>
                <li><a href="https://www.w3.org/OWL/" target="_blank">W3C OWL Web Ontology Language</a></li>
                <li><a href="https://www.w3.org/TR/prov-o/" target="_blank">W3C PROV-O Provenance Ontology</a></li>
                <li><a href="https://solidproject.org/" target="_blank">Solid Project</a></li>
                <li><a href="https://www.hl7.org/fhir/" target="_blank">HL7 FHIR</a></li>
                <li><a href="https://www.snomed.org/" target="_blank">SNOMED CT</a></li>
                <li><a href="https://loinc.org/" target="_blank">LOINC</a></li>
            </ul>
        </section>

        <section id="contributing">
            <h2>Extending VitalVault</h2>
            <p>
                To add a new health data domain (e.g., sleep tracking, nutrition):
            </p>
            <ol>
                <li>Create a new vocabulary namespace: <code>https://vitalvault.org/vocab/{domain}#</code></li>
                <li>Import the core vocabulary: <code>owl:imports &lt;https://vitalvault.org/vocab/core#&gt;</code></li>
                <li>Define domain-specific classes and properties</li>
                <li>Align with relevant healthcare standards (FHIR, SNOMED CT, LOINC)</li>
                <li>Create HTML documentation following the modular pattern</li>
                <li>Version independently using semantic versioning</li>
            </ol>
            <p>
                See the <a href="pots/v1.2/index.html">POTS vocabulary</a> as a reference implementation.
            </p>
        </section>
    </main>

    <footer>
        <div class="container">
            <p>© 2025 VitalVault | <a href="https://github.com/vitalvault" target="_blank">GitHub</a></p>
        </div>
    </footer>
</body>
</html>
