-
Notifications
You must be signed in to change notification settings - Fork 25
Fix protocol manifest #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Another thing that might be useful is to remove the fuzzy results comparison, and instead use a specific result set (.srx, .srj, or .ttl) to compare that the result set or graph is isomorphic with the expected result. From the manifest description, it would just mean adding a |
Overall I think this looks good. I'm going to try to take a closer look at the specifics of the protocol test definitions this coming week. I'm unfamiliar with all the ruby/rake/haml stuff in here. I see that those predate this PR, but I would find it helpful to have a description of what's going on here in the PR (and maybe also somewhere in the repo) – what files are source of truth, what are supporting code to generate other files, which files are committed to git but are just generated from other files, etc. |
The Ruby/Rake/Haml stuff is just there to produce the manifests. It happens to be what I'm familiar with, but the data structure used in the |
Fair enough, as this mechanism is used pervasively throughout the repo. I'll make that the focus of another PR, but basically, the strategy is to generate JSON-LD based manifests from the Turtle source using a common Frame, and then use the resulting In principle, this could be done easily enough in another language, as code to parse and frame JSON-LD from Turtle is standard, and Haml is one of many different templating languages (e.g. Shpaml. |
@kasei ping. |
@kasei @gkellogg Then you can still build an official binary evaluation via CGI or something else, but it is easier to also integrate these tests and extend them into other tools. |
515c519
to
a519993
Compare
Rebased to lastest, although some more follow-on may be necessary. |
This was discussed during the #rdf-star meeting on 03 July 2025. View the transcriptw3c/rdf-tests#79gregg: 79 is created by me ora: would be ok to check if people want to merge andy: agree, worth it for moving things forward adrian: 193 and 198 seem to be ok, on concepts doc pchampin: will take care about this by end of week |
Does not currently integrate back-links to tests. * Don't automatically add Content-Type on POSTs if not explicitly provided. * Validate and lint HTML/RDFa output. * Extract information from protocol_validator.cgi in to Ruby script used to generate manifest variations. * Uses HTTP and CNT ontologies to encode server interactions.
a519993
to
d89f70a
Compare
Ping @kasei |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a lot of changes encoded here from the previously approved (by the 1.1 WG) tests. If we're going to go through and re-approve them all, maybe that's not an issue, but it concerns me. Some of the changes I call out are important to the intentions of tests, while others do not impact conformance (e.g. some tests have been changed to use form-url-encoding instead of direct-POST, but in tests that are not testing the encoding mechanism). I think there's are also some questionable choices being made in the use of the http
and content
vocabularies in modeling the tests.
I think moving away from the 1.1-era encoding of these tests in my perl scripts is a good thing, but I'm a bit uncomfortable about moving away from them by moving towards ruby scripts as the source of truth here. It's still not clear to me why that's the direction used here instead of having a data file be the source of truth, and generating other data formats from that source. That also makes my uncomfortable, but it's something I could live with if we can get the flagged issues worked out (for the sake of moving forward).
ht:methodName "GET"; | ||
ht:resp [ | ||
a ht:Response; | ||
ht:statusCodeValue "4XX" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the correct use of ht:statusCodeValue
. It is meant to be used with an actual response code (e.g. "200", or "406"). I'm not sure there's any predicate to use in this way, but there are classes that represent the idea of "4XX": <http://www.w3.org/2011/http#StatusCode4xx>
. This applies to all uses of this predicate below.
ht:connectionAuthority "www.example"; | ||
ht:requests ([ | ||
a ht:Request; | ||
ht:absolutePath "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default-graph-uri
parameter was not part of the original test case.
ht:body [ | ||
a cnt:ContentAsText; | ||
cnt:characterEncoding "UTF-8"; | ||
cnt:chars "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default-graph-uri
was not part of the original test.
This seems to be a repeating issue; I won't comment on every occurrence.
ht:connectionAuthority "www.example"; | ||
ht:requests ([ | ||
a ht:Request; | ||
ht:absolutePath "/sparql?update=CLEAR%20ALL&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like default-graph-uri
elsewhere, the using-graph-uri
parameter here was not part of the original test.
ht:requests ([ | ||
a ht:Request; | ||
ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; | ||
ht:body [ | ||
a cnt:ContentAsText; | ||
cnt:characterEncoding "UTF-8"; | ||
cnt:chars "update=CLEAR%20ALL&update=CLEAR%20DEFAULT" | ||
]; | ||
ht:httpVersion "1.1"; | ||
ht:methodName "POST"; | ||
ht:resp [ | ||
a ht:Response; | ||
ht:statusCodeValue "4XX" | ||
] | ||
]) | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This request seems to be missing the Content-Type: application/x-www-url-form-urlencoded
header.
ht:httpVersion "1.1"; | ||
ht:methodName "POST"; | ||
ht:resp [ | ||
a ht:Response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original test expects a true
response.
a ht:Connection; | ||
ht:connectionAuthority "www.example"; | ||
ht:requests ([ | ||
a ht:Request; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request is missing Content-Type: application/x-www-url-form-urlencoded
header.
ht:body [ | ||
a cnt:ContentAsText; | ||
cnt:characterEncoding "UTF-8"; | ||
cnt:chars "update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original test encoded update using direct-POST request body, not form-url-encoding.
ht:body [ | ||
a cnt:ContentAsText; | ||
cnt:characterEncoding "UTF-8"; | ||
cnt:chars "query=SELECT%20%3Fo%20WHERE%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Fo%20%7D%20%7D" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original query is encoded as direct-POST request body.
ht:body [ | ||
a cnt:ContentAsText; | ||
cnt:characterEncoding "UTF-8"; | ||
cnt:chars "one result with `?o` bound to an IRI that is _not_ `<test>`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the description of the test expectation, not the expected response text.
This is a fair rewrite of the protocol manifest (Turtle, HTML and now JSON-LD) based on the protocol_validator.
Information used in the CGI script has been extracted into a Ruby script used to generate the manifests. It should be at least as good as what was up previously, and conform to the semantics embedded in the CGI script (other than scripted result validation). It uses the http and cnt ontologies to encode the sequence of HTTP interactions, taking some liberties in the response fields to allow for matching results. For example:
cc/ @kasei