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.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 time-agnostic-library 8.0.1
File Size Uploaded
time_agnostic_library-8.0.1.tar.gz 371.5 kB Details

Built distribution (wheel)

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

Total release size: 411.2 kB

Release files / time_agnostic_library-8.0.1.tar.gz

Download URL time_agnostic_library-8.0.1.tar.gz
Size 371.5 kB
Tags Source
SHA-256 checksum
How to use checksums
384b7666595da8d91e422ff0b092a73a970f2ff865e01bc740dee7057690e9c7
BLAKE2b-256 checksum
How to use checksums
d3a8d377fbd08850ca536f41ac5e43d4c77834e7f610ae5719ecdaa3a4b6092e
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.1-py3-none-any.whl

Download URL time_agnostic_library-8.0.1-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a66248985ad2ee2ba81650ce927061ac706c69be50c36710d727b6ccc6f1f12
BLAKE2b-256 checksum
How to use checksums
b51fb654c0668e95af800a66320cf0a7dc46259e1028352acbbadb4e6ae6e7e4
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

This release

8.0.1 This release

2 release files

8.0.0

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