# Send Query DBpedia using Natural Language to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "query-dbpedia",
    "name": "Query DBpedia using Natural Language",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/kidehen/query-dbpedia",
    "canonicalUrl": "https://clawhub.ai/kidehen/query-dbpedia",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/query-dbpedia",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=query-dbpedia",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "christopher_nolan_films.html",
      "README.md",
      "examples/sample-queries.md",
      "SKILL.md",
      "templates/html-template.html"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "query-dbpedia",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T19:02:30.027Z",
      "expiresAt": "2026-05-14T19:02:30.027Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=query-dbpedia",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=query-dbpedia",
        "contentDisposition": "attachment; filename=\"query-dbpedia-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "query-dbpedia"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/query-dbpedia"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/query-dbpedia",
    "downloadUrl": "https://openagent3.xyz/downloads/query-dbpedia",
    "agentUrl": "https://openagent3.xyz/skills/query-dbpedia/agent",
    "manifestUrl": "https://openagent3.xyz/skills/query-dbpedia/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/query-dbpedia/agent.md"
  }
}
```
## Documentation

### 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

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:

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:

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

### Pattern 1: Films by Director

User: "Show me movies directed by Christopher Nolan"

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:

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:

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

Title: Question or query description
Statistics: Number of results, query execution time
Table: Results with hyperlinked DBpedia URIs
SPARQL Query Display: Show the executed query
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

<!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>

### 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

Always use DISTINCT: Avoid duplicate results
Filter by language: Use FILTER(LANG(?label) = 'en')
Add LIMIT: Default to LIMIT 100 unless specified
Use OPTIONAL: For properties that may not exist
Order results: Make results meaningful with ORDER BY
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:

JSON
Markdown table
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)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: kidehen
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T19:02:30.027Z
- Expires at: 2026-05-14T19:02:30.027Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/query-dbpedia)
- [Send to Agent page](https://openagent3.xyz/skills/query-dbpedia/agent)
- [JSON manifest](https://openagent3.xyz/skills/query-dbpedia/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/query-dbpedia/agent.md)
- [Download page](https://openagent3.xyz/downloads/query-dbpedia)