Skip to content

Commit

Permalink
Merge pull request #202 from jeswr/feat/test-cases
Browse files Browse the repository at this point in the history
feat: add eval test cases for empty graph and isImpliedBy
  • Loading branch information
william-vw authored Oct 17, 2023
2 parents 7625aae + 59f2ae7 commit 73f4e00
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 0 deletions.
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 N3 graphs as subject and object";
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

0 comments on commit 73f4e00

Please sign in to comment.