-
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
Merged
rubensworks
merged 10 commits into
w3c:main
from
rubensworks:feature/sparql-triple-terms
Oct 25, 2024
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f6c7fe5
Add positive and negative SPARQL 1.2 triple terms syntax tests
rubensworks bcd1108
Make compound-all a negative test and add positive variant
rubensworks fef7c5d
Add syntax tests for triple terms and reifiers not in triple patterns
rubensworks bfc6364
Add tests for multiple reifiers in annotation syntax
rubensworks a62f4f0
Remove mfx prefix
rubensworks 109b173
Fix incorrect : prefixes
rubensworks 0e7088f
Remove expr-tripleterm-02
rubensworks 690d699
Disallow triple terms in subject position
rubensworks eafb886
Introduce version-agnostic SPARQL test classes and mf:specVersion
rubensworks 3b4894a
Remove redundancy in SPARQL test classes
rubensworks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/alternate-path-anonreifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
<<s :p|:q ?o>>. | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/alternate-path-reifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
<<s :p|:q ?o ~ :iri >>. | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/alternate-path-tripleterm.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
<<(s :p|:q ?o)>>. | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-alternate-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p|:q ?o {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-list-predicate.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/ns#> | ||
|
||
SELECT * { | ||
:p ("abc") :o {| :q 123 |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-oneOrMore.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p+ ?o {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-optional.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * { | ||
:s :p? :o {| ?p ?o |} | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-path-on-start.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
:s+ :p ?o {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p/:q ?o {| ?pp ?oo |}. | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-anonreifier-variable-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s1 ?p1/?p2 ?o1 {| ?p2 ?o2 |} | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-list-predicate.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/ns#> | ||
|
||
SELECT * { | ||
:p ("abc") :o ~ :iri {| :q 123 |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-oneOrMore.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p+ ?o ~ :iri {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-optional.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * { | ||
:s :p? :o ~ :iri {| ?p ?o |} | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-path-on-start.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
:s+ :p ?o ~ :iri {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p/:q ?o ~ :iri {| ?pp ?oo |}. | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-reifier-alternate-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s :p|:q ?o ~ :iri {| ?pp ?oo |} . | ||
} |
5 changes: 5 additions & 0 deletions
5
sparql/sparql12/syntax-triple-terms-negative/annotated-reifier-variable-path.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREFIX : <http://example.com/> | ||
|
||
SELECT * WHERE { | ||
?s1 ?p1/?p2 ?o1 ~ :iri {| ?p2 ?o2 |} | ||
} |
4 changes: 4 additions & 0 deletions
4
sparql/sparql12/syntax-triple-terms-negative/bind-anonreified.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT * { | ||
?s ?p ?o . | ||
BIND(<< ?s ?p ?o >> AS ?t ) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT * { | ||
?s ?p ?o . | ||
BIND(<< ?s ?p ?o ~ :iri >> AS ?t ) | ||
} |
4 changes: 4 additions & 0 deletions
4
sparql/sparql12/syntax-triple-terms-negative/bindbnode-anonreifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT * { | ||
?s ?p ?o . | ||
BIND(<< [] ?p ?o >> AS ?t ) | ||
} |
4 changes: 4 additions & 0 deletions
4
sparql/sparql12/syntax-triple-terms-negative/bindbnode-reifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT * { | ||
?s ?p ?o . | ||
BIND(<< [] ?p ?o ~ :iri >> AS ?t ) | ||
} |
4 changes: 4 additions & 0 deletions
4
sparql/sparql12/syntax-triple-terms-negative/bindbnode-tripleterm.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT * { | ||
?s ?p ?o . | ||
BIND(<<( [] ?p ?o )>> AS ?t ) | ||
} |
3 changes: 3 additions & 0 deletions
3
sparql/sparql12/syntax-triple-terms-negative/bnode-predicate-anonreifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SELECT * WHERE { | ||
<<?s [] ?o>> ?p2 ?o2 . | ||
} |
3 changes: 3 additions & 0 deletions
3
sparql/sparql12/syntax-triple-terms-negative/bnode-predicate-reifier.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SELECT * WHERE { | ||
<<?s [] ?o ~ :iri>> ?p2 ?o2 . | ||
} |
3 changes: 3 additions & 0 deletions
3
sparql/sparql12/syntax-triple-terms-negative/bnode-predicate-tripleterm.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SELECT * WHERE { | ||
<<(?s [] ?o)>> ?p2 ?o2 . | ||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-anonreifier-01.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<?s ?p ?o>> ex:author ex:Bob . | ||
<< ex:Moscow a ex:City >> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<< _:b ex:x () >> ex:broken true . | ||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-anonreifier-02.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<?s ?p ?o>> ex:author ex:Bob . | ||
<< ex:Moscow a ex:City >> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<< _:b ex:x ( 1 2 3 ) >> ex:broken true . | ||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-reifier-01.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<?s ?p ?o ~ :iri >> ex:author ex:Bob . | ||
<< ex:Moscow a ex:City ~ :iri >> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<< _:b ex:x () ~ :iri >> ex:broken true . | ||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-reifier-02.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<?s ?p ?o ~ :iri >> ex:author ex:Bob . | ||
<< ex:Moscow a ex:City ~ :iri >> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<< _:b ex:x ( 1 2 3 ) ~ :iri >> ex:broken true . | ||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-tripleterm-01.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<(?s ?p ?o)>> ex:author ex:Bob . | ||
<<( ex:Moscow a ex:City )>> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<<( _:b ex:x () )>> ex:broken true . | ||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here as with |
||
} |
9 changes: 9 additions & 0 deletions
9
sparql/sparql12/syntax-triple-terms-negative/list-tripleterm-02.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PREFIX ex: <http://example.com/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
SELECT * WHERE { | ||
<<(?s ?p ?o)>> ex:author ex:Bob . | ||
<<( ex:Moscow a ex:City )>> ex:author ?person . | ||
# TODO: See if this should be throwing an error | ||
<<( _:b ex:x ( 1 2 3 ) )>> ex:broken true . | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?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.
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 asrdf:nil.
See also:
()
: Consider changing use ofNIL
toLPAREN
,RPAREN
sparql-query#160