ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

dbpedia-query-skill

Transform natural language questions into SPARQL queries for DBpedia and generate beautiful HTML results pages. Query the DBpedia knowledge graph using plain English prompts.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/kidehen/query-dbpedia
Or

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

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

Example Query Patterns

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

Metadata

Author@kidehen
Stars1776
Views0
Updated2026-03-02
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-kidehen-query-dbpedia": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.