Badge requests streamed as Jelly are granted or refused, message by message, by Logical English rules that compare clearances with department requirements.
badge-requests-le.le · data/badge-requests-le.ttl · data/badge-requests-le.jelly · output · playground
The question
Badge readers send each request to open a department’s door as an RDF Message, in a Jelly stream. Which requests are granted, and which refused?
Historical background
RDF streams bring a sequence of graph-shaped records into a system. Jelly was designed as a compact format for transmitting that data. A badge request is a small case where event boundaries matter: each decision needs the request’s own clearance alongside the standing department rules. Jelly, design and evaluation
What we tell eyemind
data/badge-requests-le.ttl is the background: the clearance each
department requires.
ex:hr ex:requiredClearance 2 .
ex:finance ex:requiredClearance 3 .
data/badge-requests-le.jelly holds three messages. The first, written as
Turtle, is
ex:request1 ex:requester ex:alice ; ex:department ex:hr .
ex:alice ex:clearance 3 .
badge-requests-le.le binds its templates to these properties in
the RDF properties are:, and grants a request when the requester’s
clearance meets what the department requires; a request that is not granted
is refused. --stream-messages runs the rules for each message on its own,
with the background.
What eyemind concludes
The answers of each message, under its number:
% message 1
% query granted
ex:request1 is granted.
% message 2
ex:request2 is refused.
% message 3
ex:request3 is granted.
ex:request4 is refused.
Bob’s clearance of 2 is below the 3 that finance requires; Dave’s 2 meets what HR requires, and Erin’s 1 does not meet finance’s.
Try it
node bin/eyemind.js --stream-messages examples/badge-requests-le.le examples/data/badge-requests-le.ttl examples/data/badge-requests-le.jelly
Lower the clearance finance requires to 2 in the background, and Bob’s request is granted too.
