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 (7.2.0), use this BibTeX entry:

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

Metadata

Release files for time-agnostic-library 8.0.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.0.0
File Size Uploaded
time_agnostic_library-8.0.0.tar.gz 371.4 kB Details

Built distribution (wheel)

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

Total release size: 411.1 kB

Release files / time_agnostic_library-8.0.0.tar.gz

Download URL time_agnostic_library-8.0.0.tar.gz
Size 371.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f60793e9ba2df498fd465d3f05d9bcc243dccb6d12844b459f40de0c11409a9f
BLAKE2b-256 checksum
How to use checksums
c70fa773f6da5b4ac0a23ebb1dfbf9435c410c62ca688ca95820dd16734b835e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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.0.0-py3-none-any.whl

Download URL time_agnostic_library-8.0.0-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7345724e5e8f4a1d579ac10a5c89078d427fd6c4a07860035be8831e914832d
BLAKE2b-256 checksum
How to use checksums
49ee2b1042ed37bab5a858527b1e489d1d47043cd73dea8ea79996e4d02c7afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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 history Release notifications | RSS feed

8.0.1

2 release files

This release

8.0.0 This release

2 release files

7.2.0

2 release files

7.1.0

2 release files

7.0.0

2 release files

6.0.0

2 release files

5.0.7

2 release files

5.0.6

2 release files

5.0.5

2 release files

5.0.4

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.7.1

2 release files

4.7.0

2 release files

4.6.15

2 release files

4.6.14

2 release files

4.6.11

2 release files

4.6.10

2 release files

4.6.9

2 release files

4.6.8

2 release files

4.6.7

2 release files

4.6.6

2 release files

4.6.5

2 release files

4.6.4

2 release files

4.6.3

2 release files

4.6.2

2 release files

4.6.1

2 release files

1.0.1

2 release files

1.0.0

2 release files

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