Skip to content

Instantly share code, notes, and snippets.

@tpluscode
Last active April 16, 2025 08:41
Show Gist options
  • Save tpluscode/cb4b4563469dd8cc439a6ad3ec172869 to your computer and use it in GitHub Desktop.
Save tpluscode/cb4b4563469dd8cc439a6ad3ec172869 to your computer and use it in GitHub Desktop.
eye issue #148

Run

eye --nope --quiet --pass-only-new *.n3

Expected output

</req.n3#withResourcePath> earl:outcome earl:passed.
</req.n3#withoutResourcePath> earl:outcome earl:passed.
</req.n3#withoutFormula> earl:outcome earl:passed.

Actual ouptut

-</req.n3#withResourcePath> earl:outcome earl:passed.
</req.n3#withoutResourcePath> earl:outcome earl:passed.
</req.n3#withoutFormula> earl:outcome earl:passed.
PREFIX string: <http://www.w3.org/2000/10/swap/string#>
PREFIX hydra: <http://www.w3.org/ns/hydra/core#>
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX earl: <http://www.w3.org/ns/earl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tuner: <https://api-tuner.described.at/>
prefix resource: <https://api-tuner.described.at/resource#>
prefix schema: <http://schema.org/>
PREFIX qlever: <https://qlever.described.at/>
<#withResourcePath>
a earl:TestCase ;
tuner:formula {
(<http://example.com> ?res) resource:getIn [] .
?res!tuner:body string:contains "Example"
} ;
.
<#withoutResourcePath>
a earl:TestCase ;
tuner:formula {
(<http://example.com> ?res) resource:getIn [] .
?res tuner:body ?b .
?b string:contains "Example" .
} ;
.
{
(<http://example.com> ?res) resource:getIn [] .
?res!tuner:body string:contains "Example"
} => {
<#withoutFormula> earl:outcome earl:passed .
} .
PREFIX string: <http://www.w3.org/2000/10/swap/string#>
prefix resource: <https://api-tuner.described.at/resource#>
prefix tuner: <https://api-tuner.described.at/>
prefix log: <http://www.w3.org/2000/10/swap/log#>
prefix graph: <http://www.w3.org/2000/10/swap/graph#>
{
(?resource ?res) resource:getIn ?scope
} <= {
( <#getRequest>!log:uri "&resource=" ?resource!log:uri ) string:concatenation ?idStr .
?id log:uri ?idStr .
({[
a tuner:Request ;
tuner:method "GET" ;
tuner:url ?resource ;
]} ?res) resource:requestIn ( ?scope ?id ) .
} .
{
(?g ?res) resource:requestIn ( ?scope ?id )
} <= {
({ ?scope ?id [] } false true) log:ifThenElseIn [].
?g log:includes { ?req a tuner:Request } .
( ?g { ?scope ?id ?req } ) graph:union ?union .
true log:becomes ?union .
?scope!?id tuner:response ?res .
} .
[] a <https://api-tuner.described.at/Response> ;
<https://api-tuner.described.at/certs> "" ;
<https://api-tuner.described.at/conn_id> 0 ;
<https://api-tuner.described.at/content_type> "text/html" ;
<https://api-tuner.described.at/curl_version> "libcurl/8.13.0 OpenSSL/3.4.1 (SecureTransport) zlib/1.2.12 brotli/1.1.0 zstd/1.5.7 AppleIDN libssh2/1.11.1 nghttp2/1.65.0 librtmp/2.3" ;
<https://api-tuner.described.at/exitcode> 0 ;
<https://api-tuner.described.at/filename_effective> "62ae313f-44ee-4c36-bd6d-150d124f99ca" ;
<https://api-tuner.described.at/http_code> 200 ;
<https://api-tuner.described.at/http_connect> 0 ;
<https://api-tuner.described.at/http_version> "1.1" ;
<https://api-tuner.described.at/local_ip> "192.168.1.157" ;
<https://api-tuner.described.at/local_port> 53172 ;
<https://api-tuner.described.at/method> "GET" ;
<https://api-tuner.described.at/num_certs> 0 ;
<https://api-tuner.described.at/num_connects> 1 ;
<https://api-tuner.described.at/num_headers> 7 ;
<https://api-tuner.described.at/num_redirects> 0 ;
<https://api-tuner.described.at/num_retries> 0 ;
<https://api-tuner.described.at/proxy_ssl_verify_result> 0 ;
<https://api-tuner.described.at/proxy_used> 0 ;
<https://api-tuner.described.at/remote_ip> "23.215.0.136" ;
<https://api-tuner.described.at/remote_port> 80 ;
<https://api-tuner.described.at/response_code> 200 ;
<https://api-tuner.described.at/scheme> "http" ;
<https://api-tuner.described.at/size_download> 1256 ;
<https://api-tuner.described.at/size_header> 262 ;
<https://api-tuner.described.at/size_request> 75 ;
<https://api-tuner.described.at/size_upload> 0 ;
<https://api-tuner.described.at/speed_download> 3936 ;
<https://api-tuner.described.at/speed_upload> 0 ;
<https://api-tuner.described.at/ssl_verify_result> 0 ;
<https://api-tuner.described.at/time_appconnect> 0 ;
<https://api-tuner.described.at/time_connect> "1.47019E-1"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_namelookup> "1.563E-3"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_posttransfer> "1.47123E-1"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_pretransfer> "1.47085E-1"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_queue> "5.7E-5"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_redirect> 0 ;
<https://api-tuner.described.at/time_starttransfer> "3.18813E-1"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/time_total> "3.19073E-1"^^<http://www.w3.org/2001/XMLSchema#double> ;
<https://api-tuner.described.at/tls_earlydata> 0 ;
<https://api-tuner.described.at/url> "http://example.com" ;
<https://api-tuner.described.at/url.host> "example.com" ;
<https://api-tuner.described.at/url.path> "/" ;
<https://api-tuner.described.at/url.port> "80" ;
<https://api-tuner.described.at/url.scheme> "http" ;
<https://api-tuner.described.at/url_effective> "http://example.com/" ;
<https://api-tuner.described.at/urle.host> "example.com" ;
<https://api-tuner.described.at/urle.path> "/" ;
<https://api-tuner.described.at/urle.port> "80" ;
<https://api-tuner.described.at/urle.scheme> "http" ;
<https://api-tuner.described.at/urlnum> 0 ;
<https://api-tuner.described.at/xfer_id> 0 ;
<https://api-tuner.described.at/body> "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color: #f0f0f2;\n margin: 0;\n padding: 0;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n div {\n width: 600px;\n margin: 5em auto;\n padding: 2em;\n background-color: #fdfdff;\n border-radius: 0.5em;\n box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);\n }\n a:link, a:visited {\n color: #38488f;\n text-decoration: none;\n }\n @media (max-width: 700px) {\n div {\n margin: 0 auto;\n width: auto;\n }\n }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n <p>This domain is for use in illustrative examples in documents. You may use this\n domain in literature without prior coordination or asking for permission.</p>\n <p><a href=\"https://www.iana.org/domains/example\">More information...</a></p>\n</div>\n</body>\n</html>\n" ;
<https://api-tuner.described.at/headers> [
<https://api-tuner.described.at/name> "content-type" ;
<https://api-tuner.described.at/value> "text/html"
], [
<https://api-tuner.described.at/name> "etag" ;
<https://api-tuner.described.at/value> "\"84238dfc8092e5d9c0dac8ef93371a07:1736799080.121134\""
], [
<https://api-tuner.described.at/name> "last-modified" ;
<https://api-tuner.described.at/value> "Mon, 13 Jan 2025 20:11:20 GMT"
], [
<https://api-tuner.described.at/name> "cache-control" ;
<https://api-tuner.described.at/value> "max-age=2209"
], [
<https://api-tuner.described.at/name> "date" ;
<https://api-tuner.described.at/value> "Wed, 16 Apr 2025 08:19:39 GMT"
], [
<https://api-tuner.described.at/name> "content-length" ;
<https://api-tuner.described.at/value> "1256"
], [
<https://api-tuner.described.at/name> "connection" ;
<https://api-tuner.described.at/value> "keep-alive"
] .
prefix earl: <http://www.w3.org/ns/earl#>
prefix log: <http://www.w3.org/2000/10/swap/log#>
prefix tuner: <https://api-tuner.described.at/>
prefix graph: <http://www.w3.org/2000/10/swap/graph#>
{
?test a earl:TestCase ; tuner:formula ?formula .
?formula log:call true .
} => {
?test earl:outcome earl:passed .
} .
prefix tuner: <https://api-tuner.described.at/>
prefix log: <http://www.w3.org/2000/10/swap/log#>
prefix string: <http://www.w3.org/2000/10/swap/string#>
prefix list: <http://www.w3.org/2000/10/swap/list#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
{
?req tuner:response ?res .
} <= {
{
?req a tuner:Request .
?req tuner:method ?method .
?req tuner:url ?endpointUri .
} .
({ ?req tuner:done true } false true) log:ifThenElseIn ?SCOPE .
true log:becomes { ?req tuner:done true } .
"file://response"^log:uri log:semantics ?res .
} .
{
?res tuner:body ?body .
} <= {
?res log:includes {
[] a tuner:Response ; tuner:body ?body .
} .
} .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment