Skip to main content

RDF Fingerprinter

PyPI version Python versions Downloads License CI codecov Docs Ruff

See the structure of an RDF dataset at a glance. RDF Fingerprinter profiles a SPARQL endpoint and reconstructs the data shapes its data actually follow — its application profile — as an HTML report, SHACL, ShEx, PlantUML diagrams and compact schemas for language models.

One read-only pass over a SPARQL endpoint saves profile.json once; from it come outputs for people (HTML report, PlantUML diagrams, pitfalls), for agents (query-writing schema, glossary, ShExC) and for machines (JSON profile, SHACL, CSV tables, pitfall TSV, exit status)

An application profile is the set of data shapes that constrain how data are instantiated for a purpose, and so can validate them. Fingerprinting infers that profile from the data: for each class in the dataset, it reconstructs the shape its instances share. Compare two fingerprints to spot how two datasets differ in structure.

Who it's for: data stewards, modellers and reviewers who need to know what a dataset really contains; language models that write SPARQL; and validators, pipelines and CI jobs that check data against its profile.

Documentation: https://meaningfy-ws.github.io/rdf-fingerprinter/ · The story behind 3.5: A fingerprint you can trust on a large graph

Features

  • Profiles any SPARQL 1.1 endpoint, read-only, class by class with bounded queries, and says how precise every number is (exact, or first N of M when a class is too big).
  • Writes an HTML report and a saved profile.json, from which SHACL shapes, enriched ShExC, PlantUML diagrams and a pattern schema for language models are generated without querying again.
  • Scans for modelling pitfalls (--pitfalls, 28 SPARQL checks, most from the OOPS! catalogue) and fails a CI job on them (--fail-on).
  • Recognises reifications (rdf:Statement, singleton properties, owl:Axiom, PROV, Wikibase, RDF 1.2 triple terms, …) and shows the relations they stand for.

How it compares with SHACL Play, sheXer, void-generator, QSE and others: Comparison.

Why you can trust the results

RDF Fingerprinter began in 2024 as report templates and about sixty lines of Python. On large graphs its queries timed out, and the run still reported success. It has since been rewritten around one idea: a fingerprint you can trust on a large graph.

  • It never writes to your store. It sends only SELECT and ASK queries.
  • Every number says how precise it is: exact, or the first N of M instances when a class is too big. A failed measurement is recorded, not hidden: a run neither stops at the first timeout nor hides it.
  • The facts are collected once; the judgements can be redone. Raw counts are saved in profile.json, and every output is regenerated from it offline, with different thresholds or filters, without touching the endpoint again.
  • Generated SHACL is graded by confidence: sh:Violation, sh:Warning or sh:Info, according to how strongly the data support each constraint.
  • Exit codes tell automation what happened: 0 all measured, 1 written with failures, 2–5 usage error, endpoint unreachable, unexpected error, or pitfalls at the --fail-on level.

It is built and tested like the infrastructure it is meant to be: 1,300+ unit tests, 191 end-to-end tests against a real triple store, property-based tests, mutation testing after every release (score 0.969 at 3.5), layer boundaries enforced by import-linter, and 12 recorded architecture decisions.

Installation

pip install rdf-fingerprinter

Requires Python 3.12 or later (tested on 3.12, 3.13 and 3.14).

Upgrading from 0.3 or 1.x? The library was rewritten in 2.0 and has grown since. Read the breaking changes per release in the CHANGELOG and the Getting Started upgrade notes.

Quick start

Point fingerprint at a SPARQL endpoint and an output folder (output folders must exist):

mkdir -p out shapes diagrams
fingerprint -e https://my.sparql.endpoint/query -o out

It writes out/main.html (the report) and out/profile.json (the raw profile). Generate other representations from the saved profile, without querying the endpoint again:

fingerprint-gen-shacl out/profile.json -o shapes/
fingerprint-gen-puml  out/profile.json -o diagrams/

Run fingerprint --help for every option (depth, precision, graphs, timeouts, pitfalls, …), and see Getting Started for exit codes and configuration files. To use the library from Python, see the API Reference.

Schemas for LLMs

To give a language model the shape of your data before it writes SPARQL, render the saved profile as a pattern schema: five files per graph (prefixes-*.md, patterns-*.md, patterns-*.csv, glossary-*.md, glossary-*.csv) with compact (:Class)-property-> (:Target) lines, statistics, and labels, alt labels, definitions and notes. Or as enriched ShExC (the same content as ShEx shapes):

fingerprint-gen-pattern out/profile.json -o llm/ --ontology vocab.ttl --max-classes 30
fingerprint-gen-shex    out/profile.json -o llm/ --min-instances 10

Give a model that writes SPARQL patterns-*.md and prefixes-*.md; filter the CSV files with grep or DuckDB. On the test data, the patterns Markdown of a graph is about five times smaller than its SHACL shapes (2,081 against 10,950 characters). See Schemas for LLMs.

Namespace filters

Leave out whole namespaces in every output (report, SHACL, ShExC, PlantUML, pattern schema) by prefix, prefix glob or IRI stem; repeat the option to combine them, and use --include-namespace to bring one back:

fingerprint-gen-pattern profile.json -o llm/ --exclude-namespace relationid --exclude-namespace 'prv*'
fingerprint-gen-doc     profile.json -o out/ --exclude-namespace 'https://my.brainframe.com/#/knowledge/'

The report keeps every namespace in its table, marks the excluded ones, and has a switch per namespace that hides its classes and property rows on the page. See Namespace filters.

Development

Requires Poetry, Docker and (for make check-spec) Node.js.

make install                    # Poetry env with the test and lint groups
make check-all                  # lint, types, layers, OpenSpec, parallel tests with coverage floors — the gate CI runs
make check-release              # check-all + release tests + random properties + e2e; before a release
make oxigraph-load-test-data    # in-memory Oxigraph on :7878 with the test graphs
make test-e2e                   # end-to-end tests against it (local only)

See Development.

Contributing

Contributions are welcome. Before you change something, please discuss it with the maintainers in a GitHub issue. We follow the Apache code of conduct; please follow it in all your interactions on the project.

License

Licensed under the Apache License 2.0. Maintained by Meaningfy.

Metadata

Release files for rdf-fingerprinter 3.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rdf-fingerprinter 3.7.1
File Size Uploaded Provenance Actions
rdf_fingerprinter-3.7.1.tar.gz 170.5 kB With provenance Details for rdf_fingerprinter-3.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rdf-fingerprinter 3.7.1
File Interpreter ABI Platform Actions
rdf_fingerprinter-3.7.1-py3-none-any.whl Python 3 none any Details for rdf_fingerprinter-3.7.1-py3-none-any.whl

Total release size: 396.8 kB

Release files / rdf_fingerprinter-3.7.1.tar.gz

Download URL rdf_fingerprinter-3.7.1.tar.gz
Size 170.5 kB
Tags Source
SHA-256 checksum
How to use checksums
144a53740629795fe3a0205e70f8899741c33342dd4a9ef195c23931b3ed30a6
BLAKE2b-256 checksum
How to use checksums
f8a2a9e0b5fcd182fef1aebe602845ded3434a21c84c5cb4976ed1f9d8768e47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / rdf_fingerprinter-3.7.1-py3-none-any.whl

Download URL rdf_fingerprinter-3.7.1-py3-none-any.whl
Size 226.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6dafe63265fd53cb55b49000718ee4e6cd1079c242ada62ee931f449d49de76
BLAKE2b-256 checksum
How to use checksums
d0b12ccb13951f29ba50828caa04aee7096ce9a110612a887be19ca3ec9698e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for rdf-fingerprinter 3.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rdf_fingerprinter-3.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.7.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page