Skip to main content

PyPI run_tests Coverage Pyright Ruff PyPI version GitHub code size in bytes REUSE status

time-agnostic-library

time-agnostic-library is a Python >=3.10 library that allows performing time-travel queries on RDF datasets compliant with the OCDM v2.0.1 provenance specification.

Tested on Blazegraph, GraphDB, Apache Jena Fuseki, and OpenLink Virtuoso.

Full documentation: https://opencitations.github.io/time-agnostic-library

Quick start

pip install time-agnostic-library
import json
from time_agnostic_library.agnostic_entity import AgnosticEntity

with open("./config.json") as f:
    config = json.load(f)

# Get the full history of an entity
entity = AgnosticEntity(res="https://example.com/br/1", config=config)
history, prov_metadata = entity.get_history(include_prov_metadata=True)

# Get an entity's state at a specific time
entity.get_state_at_time(time=("2023-01-01", "2023-12-31"))
from time_agnostic_library.agnostic_query import VersionQuery, DeltaQuery

# Run a SPARQL query on a specific version
query = VersionQuery(
    query="SELECT ...",
    on_time=("2023-01-01", None),
    merge_aware=True,
    include_prov_metadata=True,
    config_path="./config.json",
)
results, provenance, other_provenance = query.run_agnostic_query()

# Track changes across the entire history
delta = DeltaQuery(query="SELECT ...", config_path="./config.json")
results, provenance, other_provenance = delta.run_agnostic_query()

All date/time values must be in ISO 8601 format (e.g., 2023-01-01, 2023-01-01T00:00:00+00:00).

Contributing

See CONTRIBUTING.md for development setup, testing, and release process.

Changelog

All notable changes are documented in CHANGELOG.md.

How to cite

If you use the Time Agnostic Library, please cite both the preprint and the software:

Massari, A., Peroni, S. (2026). Time travel for knowledge graphs: live queries over RDF change histories. arXiv. https://doi.org/10.48550/arXiv.2210.02534

@misc{massari2026timetravelknowledgegraphs,
  title = {Time travel for knowledge graphs: live queries over RDF change histories},
  author = {Arcangelo Massari and Silvio Peroni},
  year = {2026},
  publisher = {arXiv},
  doi = {10.48550/arXiv.2210.02534}
}

To cite the latest version of this software (8.0.1), use this BibTeX entry:

@software{Time-Agnostic-Library-8.0.1,
author = {Massari, Arcangelo},
title = {Time Agnostic Library},
url = {https://archive.softwareheritage.org/swh:1:snp:897bd6683fa5d326178f519316d4faf9d3a7b08d;origin=https://github.com/opencitations/time-agnostic-library},
version = {8.0.1},
year = {2026}
}

Metadata

Release files for time-agnostic-library 8.1.0

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

Source distribution (sdist)

Source distribution for time-agnostic-library 8.1.0
File Size Uploaded Provenance Actions
time_agnostic_library-8.1.0.tar.gz 366.4 kB Without provenance Details for time_agnostic_library-8.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for time-agnostic-library 8.1.0
File Interpreter ABI Platform Actions
time_agnostic_library-8.1.0-py3-none-any.whl Python 3 none any Details for time_agnostic_library-8.1.0-py3-none-any.whl

Total release size: 406.9 kB

Release files / time_agnostic_library-8.1.0.tar.gz

Download URL time_agnostic_library-8.1.0.tar.gz
Size 366.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bd93d9234c3bef72e5ea8a7822703ecc0a982642e9dfd5522f8b0db3fdb4728d
BLAKE2b-256 checksum
How to use checksums
d1deea20b3bf305f45fafb22ff5b76b4de7b7f25e8268a616f6dd62b4733fadb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / time_agnostic_library-8.1.0-py3-none-any.whl

Download URL time_agnostic_library-8.1.0-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e54f3ffb609d0bedd2ee580ffceb24f30e8c8f50f8073cdc39747d2f3805ad78
BLAKE2b-256 checksum
How to use checksums
33c0a6ed77a5a1a36f51b141016d87a5a404a957db987619f0f719c4fd3f3303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for time-agnostic-library 8.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

8.1.0 This release

2 release files No 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