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-6.0.0.tar.gz (269.3 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-6.0.0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: time_agnostic_library-6.0.0.tar.gz
  • Upload date:
  • Size: 269.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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-6.0.0.tar.gz
Algorithm Hash digest
SHA256 9f7af757a7c27b5473b60e8336bae96f626ee6f89bee86b55a6dbe5a5a4f08a6
MD5 d975ade8dc89a8ad6fd5815f96cdfc66
BLAKE2b-256 f0de64fc05c20cb663eb00261d3879bb9aba231309d7ffed6da9bd287b8c5e5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: time_agnostic_library-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f13e754b86d0771d8eed6508fb2d37381588a00991a9c1b5d05f5a5a66233198
MD5 ec72e9565440acfbbae732cf65abd9fe
BLAKE2b-256 dde73d3165c819f44dfea21f32223a7ef18f4fb325e0da7db37e23f5e5ff1d15

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