A time and identifiers for each order

Do two orders share a recording time while keeping separate identifiers?

execution-identifiers-srl.srl · output · proof · check · playground


The question

Do two orders share a recording time while keeping separate identifiers?


Historical background

RFC 4122 documented UUID formats in 2005. SPARQL 1.1 later provided functions for generating UUID strings and IRIs, as well as a shared time for an evaluation. The example applies these ideas to one batch, where the orders use the same time and each identifier is fresh. IETF, RFC 4122 · W3C, SPARQL 1.1 functions


What the program says

# Two orders receive a recording time, a UUID IRI and a UUID string.
# Both orders share one NOW value and have distinct identifiers. Shows
# SPARQL 1.2 RL execution functions and their reproducible proof context.
PREFIX : <https://example.org/orders/>

DATA { :alice :order :first, :second }

RULE { ?order :recordedAt ?time ; :record ?iri ; :reference ?text } WHERE {
  :alice :order ?order
  SET(?time := NOW())
  SET(?iri := UUID())
  SET(?text := STRUUID())
}

These functions and numeric promotions follow SPARQL 1.2 RL, with the expression functions defined by SPARQL.


What eyemind concludes

PREFIX : <https://example.org/orders/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

:alice :order :first .
:alice :order :second .
:first :recordedAt "2026-11-12T00:00:00.000Z"^^xsd:dateTime .
:first :record <urn:uuid:567640d9-7825-4b1a-8670-72e7537e6d6d> .
:first :reference "ed94111c-4eb9-43b6-a4ae-b143045578d2" .
:second :recordedAt "2026-11-12T00:00:00.000Z"^^xsd:dateTime .
:second :record <urn:uuid:7fdb5e72-d210-4a7a-a1e7-cc9de9ec2761> .
:second :reference "a7fe6c89-42f0-465d-acf3-1e613fa697e1" .

Both orders have the same NOW timestamp. Each UUID() result is an IRI; each STRUUID() result is an xsd:string. All four identifiers are distinct. The manifest fixes the timestamp and seed for these saved artifacts. Running the source normally captures the current time and fresh entropy, so its concrete values change.

The check report records these claims:

// Checked answers: these follow from the input program and are every answer of its questions.
inf(iri('https://example.org/orders/first'), iri('https://example.org/orders/recordedAt'), literal('2026-11-12T00:00:00.000Z', datatype('http://www.w3.org/2001/XMLSchema#dateTime')))
inf(iri('https://example.org/orders/first'), iri('https://example.org/orders/record'), iri('urn:uuid:567640d9-7825-4b1a-8670-72e7537e6d6d'))
inf(iri('https://example.org/orders/first'), iri('https://example.org/orders/reference'), literal('ed94111c-4eb9-43b6-a4ae-b143045578d2', datatype('http://www.w3.org/2001/XMLSchema#string')))
inf(iri('https://example.org/orders/second'), iri('https://example.org/orders/recordedAt'), literal('2026-11-12T00:00:00.000Z', datatype('http://www.w3.org/2001/XMLSchema#dateTime')))
inf(iri('https://example.org/orders/second'), iri('https://example.org/orders/record'), iri('urn:uuid:7fdb5e72-d210-4a7a-a1e7-cc9de9ec2761'))
inf(iri('https://example.org/orders/second'), iri('https://example.org/orders/reference'), literal('a7fe6c89-42f0-465d-acf3-1e613fa697e1', datatype('http://www.w3.org/2001/XMLSchema#string')))
inf(iri('https://example.org/orders/alice'), iri('https://example.org/orders/order'), iri('https://example.org/orders/first'))
inf(iri('https://example.org/orders/alice'), iri('https://example.org/orders/order'), iri('https://example.org/orders/second'))

What the proof establishes

The compiled program states the execution context as one srl_execution rule, and the proof records it as the answer of that call’s table:

called(srl_execution(F, _6), [srl_execution('2026-11-12T00:00:00.000Z', '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef')])

Checking a saved proof restores that context before recompiling the rules, then checks the UUID hash, variant bits and other computations itself. This proves consequences of the recorded inputs; it does not attest a clock observation or seed randomness.

The saved report ends with verdict('checked'). The checker follows the certificate without calling the reasoning engine: it checks each call table by applying the compiled rules one level, requires the listings to be closed under the rules, and replays each listed triple’s firing. The compiled rules compute the identifiers only from bound inputs, so the verdict establishes that the claims follow from the program and are every answer of its questions.


Try it

node bin/eyemind.js --check-proof examples/proof/execution-identifiers-srl.js examples/execution-identifiers-srl.srl

Run node bin/eyemind.js examples/execution-identifiers-srl.srl for fresh times and identifiers, or node bin/eyemind.js --proof examples/execution-identifiers-srl.srl for a proof of that new execution.