Skip to main content

A Spec By Example framework for RDF and SPARQL, Inspired by Cucumber.

Project description

mustrd

"MustRD: Validate your SPARQL queries and transformations with precision and confidence, using BDD and Given-When-Then principles."

coverage badge

Why?

SPARQL is a powerful query language for RDF data, but how can you ensure your queries and transformations are doing what you intend? Whether you're working on a pipeline or a standalone query, certainty is key.

While RDF and SPARQL offer great flexibility, we noticed a gap in tooling to validate their behavior. We missed the robust testing frameworks available in imperative programming languages that help ensure your code works as expected.

With MustRD, you can:

  • Define data scenarios and verify that queries produce the expected results.
  • Test edge cases to ensure your queries remain reliable.
  • Isolate small SPARQL enrichment or transformation steps and confirm you're only inserting what you intend.

What?

MustRD is a Spec-By-Example ontology with a reference Python implementation, inspired by tools like Cucumber. It uses the Given-When-Then approach to define and validate SPARQL queries and transformations.

MustRD is designed to be triplestore/SPARQL engine agnostic, leveraging open standards to ensure compatibility across different platforms.

What it is NOT

MustRD is not an alternative to SHACL. While SHACL validates data structures, MustRD focuses on validating data transformations and query results.

How?

You define your specs in Turtle (.ttl) or TriG (.trig) files using the Given-When-Then approach:

  • Given: Define the starting dataset.
  • When: Specify the action (e.g., a SPARQL query).
  • Then: Outline the expected results.

Depending on the type of SPARQL query (CONSTRUCT, SELECT, INSERT/DELETE), MustRD runs the query and compares the results against the expectations defined in the spec.

Expectations can also be defined as:

  • INSERT queries.
  • SELECT queries.
  • Higher-order expectation languages, similar to those used in various platforms.

When?

MustRD is a work in progress, built to meet the needs of our projects across multiple clients and vendor stacks. While we find it useful, it may not meet your needs out of the box.

We invite you to try it, raise issues, or contribute via pull requests. If you need custom features, contact us for consultancy rates, and we may prioritize your request.

Support

Semantic Partners is a specialist consultancy in Semantic Technology. If you need more support, contact us at info@semanticpartners.com or mustrd@semanticpartners.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mustrd-0.3.1a0.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mustrd-0.3.1a0-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

Details for the file mustrd-0.3.1a0.tar.gz.

File metadata

  • Download URL: mustrd-0.3.1a0.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for mustrd-0.3.1a0.tar.gz
Algorithm Hash digest
SHA256 1af2fe519170cae5cc582b483e69403f692b2ea648355afece4c61b03b128afc
MD5 0dc9dc5683a067d353f80f3053276c38
BLAKE2b-256 c42ed19c5be94abdbe4992d9448e7ea4f54198d09d37741a40945afc4882462d

See more details on using hashes here.

File details

Details for the file mustrd-0.3.1a0-py3-none-any.whl.

File metadata

  • Download URL: mustrd-0.3.1a0-py3-none-any.whl
  • Upload date:
  • Size: 56.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for mustrd-0.3.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c18ebab3ac666c480cd48ed96ee95ef4b34a7ab6e4390d9fd3a0460288f8d07
MD5 1e98c5db5509f8650609877d2248b6fc
BLAKE2b-256 5317ed8544350693f2fc5017340f65ee2f5fb6bb8b7e1fcb9f58df584b773a5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page