-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add positive and negative SPARQL 1.2 triple terms syntax tests #144
Add positive and negative SPARQL 1.2 triple terms syntax tests #144
Conversation
@afs Your comment regarding |
f116dfa
to
fef7c5d
Compare
Reified triple declaration tests (positive and negative) have also been added. |
sparql/sparql12/syntax-triple-terms-positive/expr-tripleterm-02.rq
Outdated
Show resolved
Hide resolved
Thanks for the reviews, all comments should be resolved now. @afs I've also added some tests for multiple reifiers in annotation syntax (which is the reason this took me a while, as I didn't have this properly supported in SPARQL.js yet...) |
Regarding the comment on #140 by @afs:
The grouping of all update-related tests in a single (or two) directory seemed a bit weird to me, since for non-update tests a feature-based directory grouping was chosen. So I opted for a pure feature-based directory grouping here. I've split the positive and negative tests in separate directories to make management of the test manifest easier. But I don't have a strong opinion on this, so I'm happy to move things around. |
sparql/sparql12/syntax-triple-terms-positive/basic-tripleterm-05.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/compound-tripleterm.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/nested-tripleterm-01.rq
Outdated
Show resolved
Hide resolved
# TODO: See if this should be throwing an error | ||
<< _:b ex:x () >> ex:broken true . |
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.
Is the suggestion here that ()
shouldn't parse as rdf:nil
and be disallowed because you shouldn't be able to reify a triple with a list as an object?
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 test was derived from the RDF-star tests.
I suspect you are right.
But I wonder if we really want/need to disallow this.
A message on this exact topic was also just raised on the mailinglist.
@afs perhaps you have some more insights on this?
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.
See also w3c/rdf-ucr#26 ("Example 3: RDF Lists").
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.
Is the suggestion here that
()
shouldn't parse asrdf:nil
and be disallowed because you shouldn't be able to reify a triple with a list as an object?
Yes. The only meaning would be to assert the triples into the graph. RDF Collections are messy. In N3, collections are first-class citizens but not in RDF 1.x.
The idea is to keep triple terms as terms, without additional triples asserted in to a graph.
<<:s :p :o >>
becomes _:r rdf:reifies <<( :s :p :o )>>
-- <<...>>
usage is connected to triple terms.
In SPARQL, a query expression can create terms outside a graph. No lists one or greater, no predicate object lists.
In annotation syntax, it is more reasonable to put the asserted triples in the graph although it only puts the head blank node into the triple term.
-- w3c/rdf-ucr#26 ("Example 3: RDF Lists") -- but << >>
is not asserting.
()
is an odd case because it is a term whereas any other list has triples. It can't occur in expressions as rdf:nil.
See also:
# TODO: See if this should be throwing an error | ||
<<( _:b ex:x () )>> ex:broken true . |
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.
Same question here as with list-anonreifier-01
– is this about ()
/rdf:nil
?
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.
Would it be beneficial to move positive tests involving triple terms as subjects (here commented) to a "generalized RDF" feature set?
sparql/sparql12/syntax-triple-terms-positive/basic-tripleterm-06.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/basic-tripleterm-07.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/update-tripleterm-01.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/update-tripleterm-03.rq
Outdated
Show resolved
Hide resolved
sparql/sparql12/syntax-triple-terms-positive/update-tripleterm-04.rq
Outdated
Show resolved
Hide resolved
This makes the SPARQL syntax test classes more flexible towards future spec versions. Closes w3c#143
52735fd
to
eafb886
Compare
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.
My implementation passes all these tests, although the test entry types should be changed as I suggested in #143 (comment).
@kasei pointed out that reverse paths means that subject and object positions should be the same. This isn't a generalized RDF issue. |
My implementation passes the current PR when adding |
@gkellogg The report generation is failing. Is this because the PR branch is not in the repository?
|
I will look into it; could be transitory. |
:alternate-path-anonreifier rdf:type mf:NegativeSyntaxTest ; | ||
dawgt:approval dawgt:Proposed ; | ||
mf:name "alternate-path-anonreifier.rq" ; | ||
mf:specVersion "sparql-1.2"; |
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.
We have IRIs for the different SPARQL language versions (via the service description spec). I'd personally prefer if we used those instead of literals here. Thoughts?
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.
We have IRIs for the different SPARQL language versions (via the service description spec). I'd personally prefer if we used those instead of literals here. Thoughts?
@kasei Would you be OK with raising that as separate issue, either one it's own or one to cover all manifest vocabulary changes? This is to let the test material go in - it's big PR.
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.
Yes, totally fine if that's handled later.
We discussed this PR in the WG meeting 2024-10-24 (brief minutes) It was noted that there are sub-parts on the tests themselves and on the test manifest vocabulary. The WG would be happy if the tests were merged and issues subsequently raised. The decision is left to this group. |
I also have an implementation passing all of these tests. Happy for this to get merged now. |
I agree with merging this PR in its current form, and discussing remaining issues through separate issues. |
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.
Merge it. Big improvement over status quo. Nothing prevents further fine tuning of issues, whether remaining after or caused by this PR.
I also agree. |
So, I believe the problem is that the PR is from a forked repository, and Generally, I prefer that PRs come from local branches, but that requires write permission from the authors, which shouldn't be a problem. |
As part of #140, this PR adds positive and negative syntax tests related to the new triple terms in SPARQL 1.2.
Evaluation tests are not included yet in this PR.
Some notes on this:
reifier
,anonreifier
, andtripleterm
in the test name where applicable.11
) #143 needs to be resolved first if we don't want this.