Skip to main content

A Python library for performing time-travel queries on RDF datasets compliant with the OCDM v2.0.1 provenance specification.

Project description

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), config_path="./config.json")
query.run_agnostic_query()

# Track changes across the entire history
delta = DeltaQuery(query="SELECT ...", config_path="./config.json")
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.

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

time_agnostic_library-7.1.0.tar.gz (292.6 kB view details)

Uploaded Source

Built Distribution

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

time_agnostic_library-7.1.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file time_agnostic_library-7.1.0.tar.gz.

File metadata

  • Download URL: time_agnostic_library-7.1.0.tar.gz
  • Upload date:
  • Size: 292.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for time_agnostic_library-7.1.0.tar.gz
Algorithm Hash digest
SHA256 0287fb97938c1c651872790e4fbf110ed85fc8aa6591073f700cf5bcc192abe5
MD5 111bc58e15a3884fffd064fac25be35c
BLAKE2b-256 b893f8880199efcbe34c9d4f4b5c25952e34c8bd9a926bc86e378841eae3fc23

See more details on using hashes here.

File details

Details for the file time_agnostic_library-7.1.0-py3-none-any.whl.

File metadata

  • Download URL: time_agnostic_library-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}

File hashes

Hashes for time_agnostic_library-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd245ade94764ae69e459addc85158c7b5117303cacc399ffa92416df5374826
MD5 47e02b1f7721707a875a67ad244b8a29
BLAKE2b-256 c98e803e61b73f05ff2a0c0f0aa89eb5de51b0692e3cc3a7f886e203acd31a29

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