Skip to main content

Documentation

A slightly opinionated, common set of 'rules' for creating rdf data using 'rdf-engine':

  • Data Rules: for loading tables (csv, parquet), hierarchical (json), and rdf (ttl).
  • Mapping rule: SPARQL construct
  • Ontology rules: Inference and validation using Shifty

These rules come together in the 'engine'.

Development

History/context: This framework is a generalization of BIM2RDF.

Develop with uv sync --all-packages --all-extras.

Run python tasks.py stamp_ver before pypi publishing.

Design Choices

These are choices given the common use case of mapping data to an ontology. They are somewhat firm.

  • RDF1.2 annotates tripes with metadata as <<?s ?p ?o>> ?mp ?mo where ?mp and ?mo correspond to simple (key,value) pairs of metadata.
  • Mappings are in the form of SPARQL constructs stored as files with a .mapping.rq extension (can also be .mapping.sparql).
  • Each (specified) ontology will be processed separately.
  • By default, no assumption about data identifier uniqueness is made: A random unique identifier node, with the default 'anon.id' prefix 'urn:rdf-rules:anon🆔', will be created to identify data (table 'rows' or json data). It is the user's responsibility to make 'nice' named nodes: This can be by making a 'rule' to SPARQL construct nodes or by specifying json2rdf_options={'subject_id_keys': {'id'}, id_prefix=(..., ...) } argument for Table or JSON data rules. With these options, nodes can be made unique over all data.

Usage

Examine how rules are fed into an engine in the tests. The common workflow is:

  1. Specify rules. Each rule is constructed by providing arguments to mkrule. mkrule processes objects such as file paths and data objects. A distinction is made for 'data rules'; These are only triggered once in the beginning.

  2. Specify engine run parameters. See run function documentation.

  3. Extract data subsets with queries. 'System' queries are mapped_and_inferred and validation (results). It's best to extract these using the query function as they slightly depend on configuration.

Metadata

Release files for rdf-rules 2026.11.89

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-rules 2026.11.89
File Size Uploaded Provenance Actions
rdf_rules-2026.11.89.tar.gz 11.3 kB With provenance Details for rdf_rules-2026.11.89.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rdf-rules 2026.11.89
File Interpreter ABI Platform Actions
rdf_rules-2026.11.89-py3-none-any.whl Python 3 none any Details for rdf_rules-2026.11.89-py3-none-any.whl

Total release size: 27.3 kB

Release files / rdf_rules-2026.11.89.tar.gz

Download URL rdf_rules-2026.11.89.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1f23d555bf1a38013f2741fedda47ffdee76f9ba4847f4d8f1ae27738b66871a
BLAKE2b-256 checksum
How to use checksums
3cc3c3d0c970fcac666efb2bd0e4fd98ce28d9c5e7c295d2e4c4fec3b2aae989
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 30, 2026.

Transparency log

Release files / rdf_rules-2026.11.89-py3-none-any.whl

Download URL rdf_rules-2026.11.89-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af1048a6af5c055dc0a1626a2a54799b2e733375443867d4354a939a75751158
BLAKE2b-256 checksum
How to use checksums
ec7310da85da66b7e242327fdfc091e6e928ada036f0349f598b7d2536da8c51
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 30, 2026.

Transparency log

Security for rdf-rules 2026.11.89

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_rules-2026.11.89.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 30, 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.

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