Skill: kidehen/query-dbpedia (version 1.0.0)

--- name: dbpedia-query-skill description: Transform natural language questions into SPARQL queries for DBpedia and generate beautiful HTML results pages. Query the DBpedia knowledge graph using plain English prompts. --- # DBpedia Query Skill ## When to Use This Skill Use this skill when users want to: - Query DBpedia using natural language - Ask questions about people, places, movies, books, organizations, etc. - Get structured data from Wikipedia via DBpedia - Create visualizations of DBpedia query results - Generate HTML reports from SPARQL queries ## Core Capabilities ✅ **Natural Language to SPARQL**: Convert user questions into valid SPARQL queries ✅ **Query Execution**: Execute queries against DBpedia endpoint ✅ **HTML Generation**: Create beautiful, interactive HTML result pages ✅ **Multiple Output Formats**: JSON, Markdown tables, or HTML ✅ **Error Handling**: Graceful handling of malformed queries or no results ## DBpedia Endpoint **SPARQL Endpoint**: `https://dbpedia.org/sparql` **Format**: JSON results (`format=json`) **Method**: HTTP GET with URL-encoded query ## Common DBpedia Prefixes ```sparql PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX dbp: <http://dbpedia.org/property/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dct: <http://purl.org/dc/terms/> ``` ## Query Conversion Workflow When a user provides a natural language prompt: ### 1. Analyze the Question - Identify the **subject** (who/what is being asked about) - Identify the **predicate** (what information is requested) - Determine if filtering, sorting, or limiting is needed ### 2. Map to DBpedia Properties **Common mappings:** - "directed by" → `dbo:director` - "release date" → `dbp:date` or `dbo:releaseDate` - "budget" → `dbo:budget` - "born in" → `dbo:birthPlace` - "population" → `dbo:populationTotal` - "capital of" → `dbo:capital` - "written by" → `dbo:author` - "starring" → `dbo:starring` ### 3. Construct SPARQL Query **Template:** ```sparql PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?variable ?label WHERE { ?variable <predicate> <object> ; rdfs:label ?label . FILTER(LANG(?label) = 'en') } ORDER BY <sort_criteria> LIMIT <number> ``` ### 4. Execute Query Use curl to execute against DBpedia: ```bash curl -s -G "https://dbpedia.org/sparql" \ --data-urlencode "query=<SPARQL_QUERY>" \ --data-urlencode "format=json" ``` ### 5. Generate Output **Options:** - **JSON**: Raw query results - **Markdown Table**: Formatted for terminal display - **HTML Page**: Interactive, styled results page ## Example Query Patterns ### Pattern 1: Films by Director **User**: "Show me movies directed by Christopher Nolan" **SPARQL**: ```sparql PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?film ?title ?releaseDate WHERE { ?film dbo:director dbr:Christopher_Nolan ; a dbo:Film ; rdfs:label ?title . OPTIONAL { ?film dbo:releaseDate ?releaseDate } FILTER(LANG(?title) = 'en') } ORDER BY DESC(?releaseDate) ``` ### Pattern 2: Population Queries **User**: "What are the 10 most populous cities in France?" **SPARQL**: ```sparql PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?city ?name ?population WHERE { ?city dbo:country dbr:France ; a dbo:City ; rdfs:label ?name ; dbo:populationTotal ?population . FILTER(LANG(?name) = 'en') } ORDER BY DESC(?population) LIMIT 10 ``` ### Pattern 3: Person Information **User**: "Tell me about Albert Einstein - when was he born and where?" **SPARQL**: ```sparql PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?birthDate ?birthPlace ?placeLabel WHERE { dbr:Albert_Einstein dbo:birthDate ?birthDate ; dbo:birthPlace ?birthPlace . ?birthPlace rdfs:label ?placeLabel . FILTER(LANG(?placeLabel) = 'en') } ``` ## HTML Template Generation When generating HTML results: ### Required Elements 1. **Title**: Question or query description 2. **Statistics**: Number of results, query execution time 3. **Table**: Results with hyperlinked DBpedia URIs 4. **SPARQL Query Display**: Show the executed query 5. **Footer**: Link to DBpedia, data source attribution ### Styling Guidelines - Use gradient backgrounds - Responsive design (mobile-friendly) - Hover effects on table rows - Hyperlink all DBpedia resources - Color-code different data types - Include icons for visual appeal ### HTML Template Structure ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>[Query Description] - DBpedia</title> <style> /* Modern, responsive styling */ /* Gradient backgrounds */ /* Hover effects */ /* Mobile-first design */ </style> </head> <body> <div class="container"> <h1>[Question/Title]</h1> <div class="stats">[Results count]</div> <table>[Results]</table> <div class="sparql-query">[Query code]</div> <div class="footer">[Attribution]</div> </div> </body> </html> ``` ## Error Handling ### No Results If query returns 0 results: - Inform user clearly - Suggest alternative phrasings - Check for typos in entity names ### Query Errors If SPARQL syntax error: - Display error message - Show attempted query - Offer to reformulate ### Timeout If query times out: - Add LIMIT clause - Simplify query complexity - Suggest narrowing criteria ## Output Preferences Always ask the user: ``` "Would you like the results as: 1. JSON (raw data) 2. Markdown table (terminal display) 3. HTML page (interactive visualization)" ``` ## Best Practices 1. **Always use DISTINCT**: Avoid duplicate results 2. **Filter by language**: Use `FILTER(LANG(?label) = 'en')` 3. **Add LIMIT**: Default to LIMIT 100 unless specified 4. **Use OPTIONAL**: For properties that may not exist 5. **Order results**: Make results meaningful with ORDER BY 6. **Hyperlink in HTML**: All DBpedia URIs should be clickable ## Example Session **User**: "List books written by J.K. Rowling with publication dates" **Assistant**: "I'll query DBpedia for books authored by J.K. Rowling. Executing SPARQL query against DBpedia endpoint..." [Constructs and executes query] "Found 15 books! Would you like the results as: 1. JSON 2. Markdown table 3. HTML page" **User**: "HTML page" **Assistant**: [Generates beautiful HTML page with results] "✓ HTML page generated and saved to: ./jk_rowling_books.html ✓ 15 books found with publication dates" ## Scope **This skill handles:** - Queries about entities in DBpedia - Structured data extraction - Result formatting and visualization **This skill does NOT handle:** - Text search (use DBpedia Lookup API instead) - Data modification (read-only queries) - Real-time data (DBpedia updates periodically) --- **Version**: 1.0.0 **Endpoint**: https://dbpedia.org/sparql **Data Source**: DBpedia (Wikipedia structured data)

path: christopher_nolan_films.html
content: <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Movies Directed by Christopher Nolan - DBpedia</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
            color: #e0e0e0;
            min-height: 100vh;
            padding: 2rem;
        }
        .container {
            max-width: 900px;
            margin: 0 auto;
        }
        h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
            background: linear-gradient(90deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .stats {
            font-size: 0.9rem;
            color: #888;
            margin-bottom: 1.5rem;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            background: rgba(255,255,255,0.05);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 2rem;
        }
        thead { background: rgba(102,126,234,0.3); }
        th {
            padding: 0.75rem 1rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        td {
            padding: 0.65rem 1rem;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
        tr:hover td { background: rgba(102,126,234,0.1); }
        a {
            color: #667eea;
            text-decoration: none;
        }
        a:hover { text-decoration: underline; color: #8fa4f0; }
        .num { color: #888; font-size: 0.85rem; }
        .sparql-section {
            background: rgba(255,255,255,0.05);
            border-radius: 8px;
            padding: 1.25rem;
            margin-bottom: 2rem;
        }
        .sparql-section h2 {
            font-size: 1rem;
            color: #999;
            margin-bottom: 0.75rem;
        }
        pre {
            background: rgba(0,0,0,0.3);
            padding: 1rem;
            border-radius: 6px;
            overflow-x: auto;
            font-size: 0.8rem;
            line-height: 1.5;
            color: #c5c8c6;
        }
        .footer {
            text-align: center;
            font-size: 0.8rem;
            color: #666;
            padding-top: 1rem;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Movies Directed by Christopher Nolan</h1>
        <div class="stats">16 results from DBpedia SPARQL endpoint</div>
        <table>
            <thead>
                <tr>
                    <th>#</th>
                    <th>Title</th>
                    <th>DBpedia Resource</th>
                </tr>
            </thead>
            <tbody>
                <tr><td class="num">1</td><td>Larceny (1996 film)</td><td><a href="http://dbpedia.org/resource/Larceny_(1996_film)" target="_blank">dbr:Larceny_(1996_film)</a></td></tr>
                <tr><td class="num">2</td><td>Doodlebug (film)</td><td><a href="http://dbpedia.org/resource/Doodlebug_(film)" target="_blank">dbr:Doodlebug_(film)</a></td></tr>
                <tr><td class="num">3</td><td>Following</td><td><a href="http://dbpedia.org/resource/Following" target="_blank">dbr:Following</a></td></tr>
                <tr><td class="num">4</td><td>Memento (film)</td><td><a href="http://dbpedia.org/resource/Memento_(film)" target="_blank">dbr:Memento_(film)</a></td></tr>
                <tr><td class="num">5</td><td>Insomnia (2002 film)</td><td><a href="http://dbpedia.org/resource/Insomnia_(2002_film)" target="_blank">dbr:Insomnia_(2002_film)</a></td></tr>
                <tr><td class="num">6</td><td>Batman Begins</td><td><a href="http://dbpedia.org/resource/Batman_Begins" target="_blank">dbr:Batman_Begins</a></td></tr>
                <tr><td class="num">7</td><td>The Prestige (film)</td><td><a href="http://dbpedia.org/resource/The_Prestige_(film)" target="_blank">dbr:The_Prestige_(film)</a></td></tr>
                <tr><td class="num">8</td><td>The Dark Knight</td><td><a href="http://dbpedia.org/resource/The_Dark_Knight" target="_blank">dbr:The_Dark_Knight</a></td></tr>
                <tr><td class="num">9</td><td>Inception</td><td><a href="http://dbpedia.org/resource/Inception" target="_blank">dbr:Inception</a></td></tr>
                <tr><td class="num">10</td><td>The Dark Knight Rises</td><td><a href="http://dbpedia.org/resource/The_Dark_Knight_Rises" target="_blank">dbr:The_Dark_Knight_Rises</a></td></tr>
                <tr><td class="num">11</td><td>Interstellar (film)</td><td><a href="http://dbpedia.org/resource/Interstellar_(film)" target="_blank">dbr:Interstellar_(film)</a></td></tr>
                <tr><td class="num">12</td><td>Quay (film)</td><td><a href="http://dbpedia.org/resource/Quay_(film)" target="_blank">dbr:Quay_(film)</a></td></tr>
                <tr><td class="num">13</td><td>Dunkirk (2017 film)</td><td><a href="http://dbpedia.org/resource/Dunkirk_(2017_film)" target="_blank">dbr:Dunkirk_(2017_film)</a></td></tr>
                <tr><td class="num">14</td><td>Tenet (film)</td><td><a href="http://dbpedia.org/resource/Tenet_(film)" target="_blank">dbr:Tenet_(film)</a></td></tr>
                <tr><td class="num">15</td><td>Oppenheimer (film)</td><td><a href="http://dbpedia.org/resource/Oppenheimer_(film)" target="_blank">dbr:Oppenheimer_(film)</a></td></tr>
                <tr><td class="num">16</td><td>The Odyssey (2026 film)</td><td><a href="http://dbpedia.org/resource/The_Odyssey_(2026_film)" target="_blank">dbr:The_Odyssey_(2026_film)</a></td></tr>
            </tbody>
        </table>

        <div class="sparql-section">
            <h2>SPARQL Query</h2>
            <pre><code>PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;
PREFIX dbr: &lt;http://dbpedia.org/resource/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

SELECT DISTINCT ?film ?title ?releaseDate
WHERE {
  ?film dbo:director dbr:Christopher_Nolan ;
        a dbo:Film ;
        rdfs:label ?title .
  OPTIONAL { ?film dbo:releaseDate ?releaseDate }
  FILTER(LANG(?title) = 'en')
}
ORDER BY DESC(?releaseDate)
LIMIT 20</code></pre>
        </div>

        <div class="footer">
            Data from <a href="https://dbpedia.org">DBpedia</a> &mdash; structured data extracted from Wikipedia
        </div>
    </div>
</body>
</html>


path: README.md
content: # DBpedia Query Skill

Transform natural language questions into SPARQL queries for DBpedia and generate beautiful HTML results pages.

## Overview

This Claude Code skill enables you to query the DBpedia knowledge graph using plain English. Simply describe what you want to know, and the skill will:

1. Convert your question to a SPARQL query
2. Execute it against DBpedia
3. Format results as JSON, Markdown, or HTML

## Installation

```bash
# Copy to Claude Code skills directory
cp -r dbpedia-query-skill ~/.claude/skills/

# Or use as a skill bundle
# (ZIP file can be distributed)
```

## Usage

### Basic Query

```
User: "Show me all movies directed by Spike Lee"

Skill: Converts to SPARQL, executes query, returns results
```

### With HTML Output

```
User: "List books by Agatha Christie and save as HTML"

Skill: Generates beautiful HTML page with:
- Formatted table
- DBpedia links
- SPARQL query display
- Professional styling
```

## Features

✅ Natural language to SPARQL conversion
✅ Automatic query execution
✅ Multiple output formats (JSON/Markdown/HTML)
✅ Beautiful HTML templates
✅ Error handling and suggestions
✅ DBpedia endpoint integration

## Examples

See `examples/sample-queries.md` for:
- Films by director
- Books by author
- Geographic queries
- Population data
- Sports teams
- And more!

## File Structure

```
dbpedia-query-skill/
├── SKILL.md                    # Main skill definition
├── README.md                   # This file
├── examples/
│   └── sample-queries.md       # Query examples
└── templates/
    └── html-template.html      # HTML output template
```

## How It Works

1. **User provides natural language prompt**
   - Example: "What are the most populous cities in France?"

2. **Skill analyzes and maps to DBpedia**
   - Identifies entities and properties
   - Constructs valid SPARQL query

3. **Query execution**
   - Executes against https://dbpedia.org/sparql
   - Retrieves JSON results

4. **Format output**
   - User chooses: JSON, Markdown table, or HTML
   - HTML includes beautiful styling and interactivity

## DBpedia Prefixes

The skill knows common DBpedia prefixes:

- `dbo:` - DBpedia Ontology
- `dbr:` - DBpedia Resource
- `dbp:` - DBpedia Property
- `rdfs:` - RDF Schema
- `foaf:` - Friend of a Friend

## Output Examples

### JSON Output
Raw SPARQL results in JSON format

### Markdown Table
```
| Film Title              | Release Date | Budget    |
|------------------------|--------------|-----------|
| Do the Right Thing     | 1989         | $6.2M     |
| Malcolm X              | 1992         | $35M      |
```

### HTML Page
Beautiful, interactive page with:
- Gradient backgrounds
- Hover effects
- Clickable DBpedia links
- Embedded SPARQL query
- Responsive design

## Common Use Cases

1. **Film Research**: Directors, actors, budgets, release dates
2. **Geographic Data**: Cities, countries, populations
3. **Book Information**: Authors, publication dates, genres
4. **Person Queries**: Birth dates, occupations, achievements
5. **Organization Data**: Founding dates, locations, members

## Best Practices

- Start with simple queries
- Be specific about entities (use full names)
- Request HTML output for better visualization
- Check example queries for patterns
- DBpedia uses underscores in names (e.g., "Spike_Lee")

## Limitations

- Read-only queries (no data modification)
- DBpedia updates periodically (not real-time)
- Some entities may have incomplete data
- Complex queries may timeout

## Support

- DBpedia Homepage: https://dbpedia.org
- SPARQL Endpoint: https://dbpedia.org/sparql
- DBpedia Documentation: https://www.dbpedia.org/resources/documentation/

## Version

1.0.0

## License

This skill is provided as-is for use with Claude Code.
DBpedia data is available under CC BY-SA 3.0 license.


path: examples/sample-queries.md
content: # DBpedia Query Examples

## Example 1: Films by Director

**Natural Language**: "Show me all movies directed by Spike Lee with their budgets"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbp: <http://dbpedia.org/property/>

SELECT DISTINCT ?film ?title ?date ?budget
WHERE {
  ?film dbo:director dbr:Spike_Lee ;
        a dbo:Film ;
        rdfs:label ?title .
  OPTIONAL { ?film dbp:date ?date }
  OPTIONAL { ?film dbo:budget ?budget }
  FILTER(LANG(?title) = 'en')
}
ORDER BY DESC(?date)
```

## Example 2: Most Populous Cities

**Natural Language**: "What are the 20 largest cities in the world by population?"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?city ?name ?population ?country
WHERE {
  ?city a dbo:City ;
        rdfs:label ?name ;
        dbo:populationTotal ?population ;
        dbo:country ?countryRes .
  ?countryRes rdfs:label ?country .
  FILTER(LANG(?name) = 'en' && LANG(?country) = 'en')
  FILTER(?population > 1000000)
}
ORDER BY DESC(?population)
LIMIT 20
```

## Example 3: Books by Author

**Natural Language**: "List all books by Agatha Christie"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?book ?title ?publicationDate
WHERE {
  ?book dbo:author dbr:Agatha_Christie ;
        a dbo:Book ;
        rdfs:label ?title .
  OPTIONAL { ?book dbo:publicationDate ?publicationDate }
  FILTER(LANG(?title) = 'en')
}
ORDER BY ?publicationDate
```

## Example 4: University Information

**Natural Language**: "Show me universities in California with their founding dates"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?university ?name ?foundingDate ?city
WHERE {
  ?university a dbo:University ;
              dbo:state dbr:California ;
              rdfs:label ?name .
  OPTIONAL { ?university dbo:foundingDate ?foundingDate }
  OPTIONAL { ?university dbo:city ?cityRes .
             ?cityRes rdfs:label ?city .
             FILTER(LANG(?city) = 'en') }
  FILTER(LANG(?name) = 'en')
}
ORDER BY ?foundingDate
```

## Example 5: Sports Teams

**Natural Language**: "What NBA teams are there and where are they located?"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?team ?name ?city ?cityName
WHERE {
  ?team dbo:league dbr:National_Basketball_Association ;
        rdfs:label ?name ;
        dbo:city ?city .
  ?city rdfs:label ?cityName .
  FILTER(LANG(?name) = 'en' && LANG(?cityName) = 'en')
}
ORDER BY ?name
```

## Example 6: Nobel Prize Winners

**Natural Language**: "List Nobel Prize in Literature winners from the last 20 years"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?person ?name ?year
WHERE {
  ?person dbo:award dbr:Nobel_Prize_in_Literature ;
          rdfs:label ?name ;
          dbo:birthDate ?birthDate .
  ?award dbo:year ?year .
  FILTER(LANG(?name) = 'en' && ?year > 2004)
}
ORDER BY DESC(?year)
```

## Example 7: Programming Languages

**Natural Language**: "Show me programming languages and who designed them"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?language ?name ?designer ?designerName
WHERE {
  ?language a dbo:ProgrammingLanguage ;
            rdfs:label ?name .
  OPTIONAL { ?language dbo:designer ?designer .
             ?designer rdfs:label ?designerName .
             FILTER(LANG(?designerName) = 'en') }
  FILTER(LANG(?name) = 'en')
}
ORDER BY ?name
LIMIT 50
```

## Example 8: Mountain Heights

**Natural Language**: "What are the highest mountains in the world?"

**SPARQL Query**:
```sparql
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?mountain ?name ?elevation ?range
WHERE {
  ?mountain a dbo:Mountain ;
            rdfs:label ?name ;
            dbo:elevation ?elevation .
  OPTIONAL { ?mountain dbo:mountainRange ?rangeRes .
             ?rangeRes rdfs:label ?range .
             FILTER(LANG(?range) = 'en') }
  FILTER(LANG(?name) = 'en')
}
ORDER BY DESC(?elevation)
LIMIT 20
```

## Tips for Creating Queries

1. **Start with entity type**: Use `a dbo:Film`, `a dbo:Person`, etc.
2. **Add filters**: Always filter by language for labels
3. **Use OPTIONAL**: For properties that might not exist
4. **Sort results**: Make output meaningful with ORDER BY
5. **Limit results**: Don't overwhelm with too many results
6. **Check entity names**: DBpedia uses underscores (e.g., `Spike_Lee`)


path: templates/html-template.html
content: <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{TITLE}} - DBpedia Query Results</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 40px 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        h1 {
            color: white;
            text-align: center;
            margin-bottom: 10px;
            font-size: 2.5em;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }
        .subtitle {
            text-align: center;
            color: rgba(255,255,255,0.9);
            margin-bottom: 10px;
            font-size: 1.1em;
        }
        .source-badge {
            text-align: center;
            margin-bottom: 30px;
        }
        .badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            color: white;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 0.9em;
            backdrop-filter: blur(10px);
        }
        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        .stat-box {
            background: rgba(255,255,255,0.95);
            padding: 25px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.2);
            transition: transform 0.3s;
        }
        .stat-box:hover {
            transform: translateY(-5px);
        }
        .stat-number {
            font-size: 2.5em;
            font-weight: bold;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .stat-label {
            color: #666;
            margin-top: 8px;
            font-size: 0.95em;
        }
        .table-wrapper {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 8px 16px rgba(0,0,0,0.3);
            margin-bottom: 30px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        thead {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        th {
            padding: 18px 20px;
            text-align: left;
            font-weight: 600;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        td {
            padding: 16px 20px;
            border-bottom: 1px solid #f0f0f0;
        }
        tr:last-child td {
            border-bottom: none;
        }
        tbody tr {
            transition: all 0.3s ease;
        }
        tbody tr:hover {
            background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
            transform: translateX(8px);
        }
        tbody tr:nth-child(even) {
            background: #fafafa;
        }
        tbody tr:nth-child(even):hover {
            background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
        }
        a {
            color: #667eea;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }
        a:hover {
            color: #764ba2;
            text-decoration: underline;
        }
        .sparql-section {
            background: rgba(255,255,255,0.95);
            padding: 25px;
            border-radius: 12px;
            margin: 20px 0;
            font-family: 'Courier New', monospace;
            font-size: 0.85em;
            line-height: 1.8;
            box-shadow: 0 4px 6px rgba(0,0,0,0.2);
        }
        .sparql-section strong {
            color: #667eea;
            font-size: 1.1em;
        }
        code {
            display: block;
            background: #2c3e50;
            color: #ecf0f1;
            padding: 15px;
            border-radius: 6px;
            margin-top: 10px;
            overflow-x: auto;
            line-height: 1.6;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            padding: 25px;
            background: rgba(255,255,255,0.95);
            border-radius: 12px;
            color: #666;
            font-size: 0.9em;
            box-shadow: 0 4px 6px rgba(0,0,0,0.2);
        }
        .footer a {
            color: #667eea;
        }
        .number-col {
            color: #95a5a6;
            font-weight: bold;
            width: 60px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>{{TITLE}}</h1>
        <div class="subtitle">{{SUBTITLE}}</div>
        <div class="source-badge">
            <span class="badge">📊 Data Source: DBpedia</span>
        </div>

        <div class="stats">
            {{STATS}}
        </div>

        <div class="table-wrapper">
            <table>
                <thead>
                    <tr>
                        {{TABLE_HEADERS}}
                    </tr>
                </thead>
                <tbody>
                    {{TABLE_ROWS}}
                </tbody>
            </table>
        </div>

        <div class="sparql-section">
            <strong>SPARQL Query Executed</strong><br>
            Endpoint: <a href="https://dbpedia.org/sparql" target="_blank">https://dbpedia.org/sparql</a><br><br>

            <code>{{SPARQL_QUERY}}</code>
        </div>

        <div class="footer">
            <p><strong>Data Source:</strong> <a href="https://dbpedia.org" target="_blank">DBpedia</a> - Structured information extracted from Wikipedia</p>
            <p style="margin-top: 10px;">
                Click any link to explore entities on DBpedia
            </p>
            <p style="margin-top: 15px; padding-top: 15px; border-top: 1px solid #ddd; font-size: 0.85em;">
                Generated with Claude Code DBpedia Query Skill
            </p>
        </div>
    </div>
</body>
</html>


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: suspicious | SkillSpector: clean (LOW)