Skip to content

Rule executes twice #125

Answered by josd
tpluscode asked this question in Q&A
Jan 24, 2025 · 5 comments · 3 replies
Discussion options

You must be logged in to vote

The following should work fine:

@prefix earl: <http://www.w3.org/ns/earl#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
@prefix tuner: <https://api-tuner.described.at/> .
@prefix : <urn:example:>.

{
    ?method tuner:response "an Example" .
} <= {
    ({ :test :is :ok } false true) log:ifThenElseIn ?SCOPE .
    1 log:trace ?method .
    ?method string:length 3 .
    true log:becomes { :test :is :ok } .
} .

{
    "GET" tuner:response ?res .
    ?res string:contains "Example" .
} => {
    [] earl:passed true
} .

and give

$ eye --quiet once.n3
1 TRACE "GET"

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@josd
Comment options

josd Jan 25, 2025
Maintainer

Answer selected by tpluscode
@tpluscode
Comment options

@tpluscode
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants