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

feat: add eval test cases for empty graph and isImpliedBy #202

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/N3Tests/graph/empty_graph.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix : <http://example.com/> .

:a :b {} .
1 change: 1 addition & 0 deletions tests/N3Tests/graph/empty_graph.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<http://example.com/a> <http://example.com/b> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
5 changes: 5 additions & 0 deletions tests/N3Tests/graph/empty_graph_implies.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@prefix : <http://example.com/> .

{
{} => {}
} => {} .
3 changes: 3 additions & 0 deletions tests/N3Tests/graph/empty_graph_implies_result.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"true"^^<http://www.w3.org/2001/XMLSchema#boolean> <http://www.w3.org/2000/10/swap/log#implies> "true"^^<http://www.w3.org/2001/XMLSchema#boolean>
} <http://www.w3.org/2000/10/swap/log#implies> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
3 changes: 3 additions & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix : <http://example.com/> .

:a <= :b .
1 change: 1 addition & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<http://example.com/a> <http://www.w3.org/2000/10/swap/log#isImpliedBy> <http://example.com/b> .
6 changes: 6 additions & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix : <http://example.org/> .
:s :p {
{ ?a :b1 :c1 } <= { ?a :b :c } .
} .
{ :s :p ?O } => ?O .
9 changes: 9 additions & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ <http://example.org/s> <http://example.org/p> ?O } <http://www.w3.org/2000/10/swap/log#implies> ?O .

<http://example.org/s> <http://example.org/p> {
{
?a <http://example.org/b1> <http://example.org/c1> .
} <http://www.w3.org/2000/10/swap/log#isImpliedBy> {
?a <http://example.org/b> <http://example.org/c> .
} .
} .
7 changes: 7 additions & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy_graphs.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@prefix : <http://example.com/> .

{
:a :b :c .
} <= {
:d :e :f .
} .
5 changes: 5 additions & 0 deletions tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
<http://example.com/a> <http://example.com/b> <http://example.com/c>
} <http://www.w3.org/2000/10/swap/log#isImpliedBy> {
<http://example.com/d> <http://example.com/e> <http://example.com/f>
} .
40 changes: 40 additions & 0 deletions tests/N3Tests/manifest-parser.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,46 @@
mf:action <cwm_syntax/djb1.n3> ;
mf:name "djb1" .

:empty_graph_eval
a test:TestN3Eval ;
mf:action <graph/empty_graph.n3> ;
mf:result <graph/empty_graph.nq> ;
mf:name "Empty Graph Eval";
rdfs:comment "Empty Graph should be parsed as the the literal true";
rdft:approval rdft:Approved .

:empty_graph_implies_eval
a test:TestN3Eval ;
mf:action <graph/empty_graph_implies.n3> ;
mf:result <graph/empty_graph_implies_result.n3> ;
mf:name "Empty Graph Implies Eval";
rdfs:comment "Empty Graph should be parsed as the the literal true when in global scope and when in a premise";
rdft:approval rdft:Approved .

:isImpliedBy
a test:TestN3Eval ;
mf:action <isImpliedBy/isImpliedBy.n3> ;
mf:result <isImpliedBy/isImpliedBy.nq> ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy";
rdft:approval rdft:Approved .

:isImpliedBy_graphs
a test:TestN3Eval ;
mf:action <isImpliedBy/isImpliedBy_graphs.n3> ;
mf:result <isImpliedBy/isImpliedBy_graphs_result.n3> ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy with graph as premise and object";
jeswr marked this conversation as resolved.
Show resolved Hide resolved
rdft:approval rdft:Approved .

:isImpliedBy_bcRule
a test:TestN3Eval ;
mf:action <isImpliedBy/isImpliedBy_bcRule.n3> ;
mf:result <isImpliedBy/isImpliedBy_bcRule_result.n3> ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy in a bcRule";
rdft:approval rdft:Approved .

:cwm_syntax_djb1a.n3
a test:TestN3Eval ;
mf:action <cwm_syntax/djb1a.n3> ;
Expand Down