Claude Code skill

The repository DataTreehouse/fastrdf is also a Claude Code plugin with one skill, using-fastrdf. With it, Claude builds knowledge graphs for data integration with fastrdf: it uses fastrdf where it would otherwise use rdflib, pyshacl, owlrl or SPARQLWrapper, and it knows the fastrdf API. Because fastrdf answers within seconds on large graphs, Claude can work through a large dataset interactively, for instance when analysing energy grid data.

Install

In Claude Code:

/plugin marketplace add DataTreehouse/fastrdf
/plugin install fastrdf@fastrdf

Or copy the folder skills/using-fastrdf of that repository to ~/.claude/skills/ (for all your projects) or to .claude/skills/ in a project.

The skill needs fastrdf itself in the Python environment Claude works in: pip install fastrdf.

When Claude uses it

Claude loads the skill by itself when a Python task involves RDF: triples, knowledge graphs, ontologies, SPARQL, SHACL, OWL or RDFS reasoning, OTTR templates, R2RML or RML mappings, turning DataFrames, CSV, JSON or XML into RDF, or reading and writing RDF files. It also loads it when existing code imports rdflib and you ask to migrate it or to speed it up.

With the skill, Claude:

  • writes fastrdf for new code that touches RDF;

  • works on whole tables: it maps a DataFrame in one call and reads with one SPARQL query that returns a DataFrame, in place of loops over triples;

  • translates rdflib code when asked to, and leaves working rdflib code that the task does not touch as it is;

  • tells you when fastrdf is missing from the environment, and does not fall back to rdflib silently.

What it covers

The skill has a short main file and five references that Claude reads when it needs them:

Reference

Contents

Building graphs

Templates and map for DataFrames, map_triples, and the other mapping sources

Querying

SPARQL with DataFrame results, updates, and passing values into a query

Reading and writing

The RDF formats, and serializing a model

Reasoning and validation

Datalog rules, the reasoning profiles and SHACL

rdflib migration

How each rdflib, pyshacl, owlrl and SPARQLWrapper call translates to fastrdf

License

The skill is part of the fastrdf repository and under the same license. fastrdf is free for evaluation, development, testing and research, and for personal use and accredited educational institutions in production; other production use needs a commercial license.