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

run_tests Coverage PyPI PyPI version GitHub code size in bytes

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.0.0.tar.gz (283.9 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.0.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: time_agnostic_library-7.0.0.tar.gz
  • Upload date:
  • Size: 283.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.0.0.tar.gz
Algorithm Hash digest
SHA256 a4de7b786d73888d2b13afe6f945e933e21837d8c0a3852252ce6c2d1938a70e
MD5 1d5a27f3c3f14b64e4d54f33dd7510a7
BLAKE2b-256 9c086b33118e2251aa1e5d078bacd45ec2c11d8701059dfc3ade6ff91be254ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: time_agnostic_library-7.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2989d4eae59455415e5c82cb962e30470555598aa76c29fa17a80a07dfbc7010
MD5 31a5c0e05315a2b24ff5797d728ba329
BLAKE2b-256 9b5f31ceef8b9fa9b29acbd8c0d858711867d05f86c8ce859eb41e9faa624ef4

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