Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

DRB Temporal Add-on

The DRB temporal add-on attaches temporal information to the product types that support it: applied to a DRB node, it returns the set of temporal properties declared for the node's topic — acquisition (sensing) period, processing date, modification date, validity period, and any other declared role. Declarations are tprl: RDF blocks attached to topic class URIs, loaded from installed TTL packages and Fuseki (the same double source as the core topic DAO).

Timezone policy

  1. Every datetime returned by this add-on is timezone-aware and normalized to UTC. No naive datetime and no non-UTC zone can leave the add-on; cross-product comparison and sorting are safe by construction.
  2. A parsed value carrying an offset (Z, +02:00, %z in a pattern) is converted to UTC; the original offset is not preserved.
  3. A parsed naive value (no zone indication) is assumed UTC — the EO product convention. This is the only assumption in the system.

Usage

from drb.topics.resolver import create
from drb.addons.temporal import TemporalAddon, ACQUISITION, PROCESSING

node = create('S1A_IW_GRDH_...SAFE')
temporal = TemporalAddon().apply(node)
temporal.roles()                  # {ACQUISITION, PROCESSING, ...} — free
temporal[ACQUISITION].begin       # aware UTC datetime (lazy, memoized)
temporal[PROCESSING].at           # aware UTC datetime

Model overview

Unit Responsibility
drb.addons.temporal.model Output types Instant / Interval / TemporalSet and the timezone contract
drb.addons.temporal.formats Format registry (entry-point extensible) + the standard contract formats only
drb.addons.temporal.core tprl: descriptor decoding, topic-chain inheritance, TemporalAddon
drb.addons.temporal.validator Static TTL validation (temporal-validator script)

The tprl: descriptor vocabulary

Declarations live under the namespace http://knowledge-base.gael.fr/drb/addons/temporal/, prefix tprl:. Like the geoloc: vocabulary of the DRB geolocation add-on, this vocabulary carries extraction rules (how to obtain a value from a node), not data literals — block predicates live in the add-on namespace while role terms and the default format term reuse standard URIs.

The building block is a tprl:time blank node attached to a topic class URI. One block declares one role.

Roles are URIs. Where an established vocabulary types the notion exactly, its URI is reused; the add-on defines nothing redundant. The Dublin Core well-known set covers the common cases:

Constant URI Meaning
ACQUISITION dct:temporal acquisition / sensing period
PROCESSING dct:created processing (generation) date
MODIFICATION dct:modified last modification date
VALIDITY dct:valid validity period

The vocabulary is controlled but extensible: any other URI is accepted as a role; the constants only make the common roles queryable without guessing strings.

Block rules

  • tprl:role is mandatory and is a URI. A role declared more than once on the same topic is a conflict: every block carrying the duplicated role is skipped with a warning (RDF gives no order, so "first wins" would be non-deterministic).
  • Shape: exactly one of
    • tprl:instant <source> — the role is an Instant;
    • tprl:begin <source> and/or tprl:end <source> — the role is an Interval; a single declared bound yields an open interval. Declaring both tprl:instant and a bound, or none of the three, skips the block with a warning.
  • Source block: exactly one of tprl:xquery (XQuery program run against the node) or tprl:value (constant literal). Wrap the tprl:xquery expression in data(...) so extraction yields a plain string value rather than a node serialization or an empty sequence.
  • Format: per source block, at most one of
    • tprl:format <uri> — a registered format term (default: xsd:dateTime);
    • tprl:pattern "<strptime>" — inline datetime.strptime pattern. Declaring both skips the block with a warning; an unknown tprl:format URI does too.
  • A malformed block is skipped with a warning at load time — it never aborts loading globally.

Example

@prefix dct:  <http://purl.org/dc/terms/> .
@prefix tprl: <http://knowledge-base.gael.fr/drb/addons/temporal/> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .

<https://knowledge-base.gael.fr/topics/sentinel-1#level-1-product> tprl:time [
    tprl:role dct:temporal ;                  # acquisition period
    tprl:begin [ tprl:xquery "data(//metadataSection//startTime)" ] ;
    tprl:end   [ tprl:xquery "data(//metadataSection//stopTime)" ] ;
] , [
    tprl:role dct:created ;                   # processing date
    tprl:instant [
        tprl:xquery "data(//processing/@stop)" ;
        tprl:pattern "%Y%m%dT%H%M%S" ;
    ] ;
] .

Topic-chain inheritance

Declarations are collected by walking the node's topic parent chain: a child topic overrides its parents on a per-role basis, so a subtype only needs to declare the roles it changes.

Formats

The format registry maps format term URIs to parser callables. The standard contract formats — the vocabulary's default, parsable with nothing else installed — are shipped in core:

Term Parsing
xsd:dateTime (default) ISO 8601
xsd:date ISO date, yielding the instant at midnight UTC of that day
(inline) tprl:pattern datetime.strptime with the given pattern

Everything else is a satellite package. Mission-specific epochs (GPS time, seconds-since-epoch, Julian days, exotic calendars) register through the drb.addon.temporal.format entry point group; with tprl:pattern available inline, most knowledge bases need no satellite package at all.

Validation

temporal-validator file.ttl... performs static checks on tprl: descriptors: role present and unique per topic, shape exclusivity, source exclusivity, format term known or pattern present (not both).

Known limitation: the validator does not parse XQuery programs nor validate strptime patterns against sample values.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drb_addon_temporal-1.0a1.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

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

drb_addon_temporal-1.0a1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file drb_addon_temporal-1.0a1.tar.gz.

File metadata

  • Download URL: drb_addon_temporal-1.0a1.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for drb_addon_temporal-1.0a1.tar.gz
Algorithm Hash digest
SHA256 4bb99511d28356db21f7a218edc52d2bb19cb52d9f486c80a575259ee3e1ab42
MD5 ba2c701c97b823139af66ac3b1a2c1ad
BLAKE2b-256 489262763813c6c9893dd055777b7a8ae4fe6b4048c25b72bbbed4af4adb1206

See more details on using hashes here.

File details

Details for the file drb_addon_temporal-1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for drb_addon_temporal-1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 f68b586dee5477e620a2744bfa561139a4f0f1a61cde8256310781920c9bf0b4
MD5 3eb5aef9daa8cbea63453645d1fe0d22
BLAKE2b-256 9ab21c6d192be10fb9fd1a25b0c4d4a7ae42d24384bde63dc7992af36cfa4121

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0a1 This release

2 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