Skip to content
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 SPARQL tests for new triple term and reification syntax #140

Open
rubensworks opened this issue Sep 18, 2024 · 12 comments
Open

Add SPARQL tests for new triple term and reification syntax #140

rubensworks opened this issue Sep 18, 2024 · 12 comments
Assignees

Comments

@rubensworks
Copy link
Member

New tests should be added, inspired by the sparql-star tests.

@rubensworks rubensworks self-assigned this Sep 18, 2024
@rubensworks
Copy link
Member Author

@afs Just letting you know that I started working on creating syntax tests, to avoid duplicate parallel effort.

@afs
Copy link
Contributor

afs commented Sep 18, 2024

Excellent!
Thanks for coordinating.

I have recently finished the set of changes for current RDF 1.2.

There is a fix needed in the grammar (nested reified triples).
w3c/rdf-turtle#71 affects the grammar.

I don't have any scripted tests.

I have some development syntax tests (current temporary location for RDF 1.2 tests) in ${programming language}. They focus on specific details and are not checked for comprehensive coverage which I hope to use rdf-tests tests for.

@afs
Copy link
Contributor

afs commented Sep 18, 2024

PR w3c/sparql-query#153 updated.

@afs
Copy link
Contributor

afs commented Sep 26, 2024

Awesome set of tests!

Jena passes all except:

  • syntax-triple-terms-negative/list-anonreifier-01.rq
  • syntax-triple-terms-negative/list-tripleterm-01.rq
  • syntax-triple-terms-positive/compound-all.rq

The first two are more like spec bugs: see w3c/sparql-query#157

syntax-triple-terms-negative/list-anonreifier-01.rq
     8	    << _:b ex:x () >> ex:broken true .

() - rdf:nil - is a term (in VarOrTerm) rather than a compound list. Hence it is included.

It is not legal in Turtle - Turtle (1.1) handles collections differently to SPARQL which has NIL as a parser token.

We can change the grammar to match the tests. w3c/sparql-query#157

syntax-triple-terms-negative/list-tripleterm-01.rq`
     7	    # TODO: See if this should be throwing an error
     8	    <<( _:b ex:x () )>> ex:broken true .

Ditto except in triple terms. w3c/sparql-query#157.

syntax-triple-terms-positive/compound-all.rq 
     7	  << <<(:x ?R :z )>> :p <<:a :b [] >> ~ _:bnode >>

This a triple term as subject.

While it will be allowed via variables, as are literals, I think we should make this a negative test.

@rubensworks
Copy link
Member Author

syntax-triple-terms-positive/compound-all.rq
This a triple term as subject.
While it will be allowed variables, as are literals, I think we should make this negative test.

Ah right, that should be disallowed.
I'll look into making that specific case a negative test, but modify syntax-triple-terms-positive/compound-all.rq to remain a positive one to still test the combination of triple terms and reifiers.

@afs
Copy link
Contributor

afs commented Sep 26, 2024

This is unused and should be removed :: @prefix mfx: <http://jena.hpl.hp.com/2005/05/test-manifest-extra#> .
Unfortunately, this is also in SPARQL 1.1. - no uses of the prefix and SPARQL 1.0 in some mf:requires.
Raised: #145

@afs
Copy link
Contributor

afs commented Sep 26, 2024

Discussion point:

The SPARQL 1.1 are organised separated by query vs update as syntax-query/ and syntax-update-1/ syntax-update-2/. Positive and negative tests are in the same directory.

Should the SPARQL 1.2 test be organised in a similar fashion?

@afs
Copy link
Contributor

afs commented Sep 26, 2024

Missing: (I didn't see these but that may be my mistake - many tests!)

1::
I don't see many reified triple declaration syntax tests, only syntax-triple-terms-positive/compound-anonreifier.rq.

SELECT * {
    <<?s ?p ?o >> .
}

2:: Multiple reifier ids in annotation syntax: declaration of reifier ids and annotation blocks can be fixed.

:s :p :o ~ :r1 ~ :r2 .
:s :p :o ~ :r1 {| :y :z |} ~:r2 {| :y :z |} .
:s :p :o ~ :r1 {| :y :z |} ~:rx ~:r3 {| :y :z |} ~:ry .

(~:rx declares a reified id, which isn't immediately used.)

These are likely rare cases but are in the draft grammar.

@rubensworks
Copy link
Member Author

Right, we need more of those.
Especially also multiple reifier ids in annotation syntax, because we don't have any tests yet for those indeed.

@afs
Copy link
Contributor

afs commented Sep 26, 2024

expr-tripleterm-02.rq : triple term as subject in <<( )>>- spec bug. w3c/sparql-query#158

However I suspect TRIPLE(<<(:s :p :o)>> , ... , ....) not fixable.

@afs
Copy link
Contributor

afs commented Sep 26, 2024

My bad. Some/all of these comments should be on the PR not the issues.
I will see if comments can be moved. If not, shall I delete them here and recreate on the PR?

@rubensworks
Copy link
Member Author

Either option is fine by me, I'll find the comments once I continue working on the tests :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants