From b0c34e96ae734dc4db301083a6d1f7248f5c02ef Mon Sep 17 00:00:00 2001
From: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Date: Sun, 30 Jul 2023 18:03:05 +1000
Subject: [PATCH 1/5] feat: add eval test cases for empty graph and isImpliedBy
---
tests/N3Tests/graph/empty_graph.n3 | 3 ++
tests/N3Tests/graph/empty_graph.nt | 1 +
tests/N3Tests/graph/empty_graph_implies.n3 | 5 +++
tests/N3Tests/graph/empty_graph_implies.nt | 2 +
tests/N3Tests/isImpliedBy/isImpliedBy.n3 | 3 ++
tests/N3Tests/isImpliedBy/isImpliedBy.nt | 2 +
.../N3Tests/isImpliedBy/isImpliedBy_bcRule.n3 | 6 +++
.../N3Tests/isImpliedBy/isImpliedBy_bcRule.nt | 6 +++
.../N3Tests/isImpliedBy/isImpliedBy_graphs.n3 | 7 ++++
.../N3Tests/isImpliedBy/isImpliedBy_graphs.nt | 4 ++
tests/N3Tests/manifest-parser.ttl | 40 +++++++++++++++++++
11 files changed, 79 insertions(+)
create mode 100644 tests/N3Tests/graph/empty_graph.n3
create mode 100644 tests/N3Tests/graph/empty_graph.nt
create mode 100644 tests/N3Tests/graph/empty_graph_implies.n3
create mode 100644 tests/N3Tests/graph/empty_graph_implies.nt
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy.n3
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy.nt
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.n3
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_graphs.n3
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt
diff --git a/tests/N3Tests/graph/empty_graph.n3 b/tests/N3Tests/graph/empty_graph.n3
new file mode 100644
index 00000000..818d4cea
--- /dev/null
+++ b/tests/N3Tests/graph/empty_graph.n3
@@ -0,0 +1,3 @@
+@prefix : .
+
+:a :b {} .
diff --git a/tests/N3Tests/graph/empty_graph.nt b/tests/N3Tests/graph/empty_graph.nt
new file mode 100644
index 00000000..8f3b7ded
--- /dev/null
+++ b/tests/N3Tests/graph/empty_graph.nt
@@ -0,0 +1 @@
+ "true"^^ .
diff --git a/tests/N3Tests/graph/empty_graph_implies.n3 b/tests/N3Tests/graph/empty_graph_implies.n3
new file mode 100644
index 00000000..305b7332
--- /dev/null
+++ b/tests/N3Tests/graph/empty_graph_implies.n3
@@ -0,0 +1,5 @@
+@prefix : .
+
+{
+ {} => {}
+} => {} .
diff --git a/tests/N3Tests/graph/empty_graph_implies.nt b/tests/N3Tests/graph/empty_graph_implies.nt
new file mode 100644
index 00000000..bcf2137a
--- /dev/null
+++ b/tests/N3Tests/graph/empty_graph_implies.nt
@@ -0,0 +1,2 @@
+"true"^^ "true"^^ _:b0 .
+_:b0 "true"^^ .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy.n3 b/tests/N3Tests/isImpliedBy/isImpliedBy.n3
new file mode 100644
index 00000000..587e8e52
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy.n3
@@ -0,0 +1,3 @@
+@prefix : .
+
+:a <= :b .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy.nt b/tests/N3Tests/isImpliedBy/isImpliedBy.nt
new file mode 100644
index 00000000..26c728e8
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy.nt
@@ -0,0 +1,2 @@
+
+ .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.n3 b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.n3
new file mode 100644
index 00000000..25b42d15
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.n3
@@ -0,0 +1,6 @@
+@prefix log: .
+@prefix : .
+:s :p {
+ { ?a :b1 :c1 } <= { ?a :b :c } .
+} .
+{ :s :p ?O } => ?O .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt
new file mode 100644
index 00000000..adbfc57d
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt
@@ -0,0 +1,6 @@
+?a _:b0 .
+?a _:b1 .
+_:b0 _:b1 _:b2 .
+ _:b2 .
+ ?O _:b3 .
+_:b3 ?O .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.n3 b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.n3
new file mode 100644
index 00000000..64c54253
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.n3
@@ -0,0 +1,7 @@
+@prefix : .
+
+{
+ :a :b :c .
+} <= {
+ :d :e :f .
+} .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt
new file mode 100644
index 00000000..4bf2fc4e
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt
@@ -0,0 +1,4 @@
+ _:b0 .
+ _:b1 .
+
+_:b0 _:b1 .
diff --git a/tests/N3Tests/manifest-parser.ttl b/tests/N3Tests/manifest-parser.ttl
index d0a25202..55cbf110 100644
--- a/tests/N3Tests/manifest-parser.ttl
+++ b/tests/N3Tests/manifest-parser.ttl
@@ -1023,6 +1023,46 @@
mf:action ;
mf:name "djb1" .
+:empty_graph_eval
+ a test:TestN3Eval ;
+ mf:action ;
+ mf:result ;
+ 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 ;
+ mf:result ;
+ 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 ;
+ mf:result ;
+ mf:name "isImpliedBy Eval";
+ rdfs:comment "<= should be parsed as log:isImpliedBy";
+ rdft:approval rdft:Approved .
+
+:isImpliedBy_graphs
+ a test:TestN3Eval ;
+ mf:action ;
+ mf:result ;
+ mf:name "isImpliedBy Eval";
+ rdfs:comment "<= should be parsed as log:isImpliedBy in a complex use case";
+ rdft:approval rdft:Approved .
+
+:isImpliedBy_bcRule
+ a test:TestN3Eval ;
+ mf:action ;
+ mf:result ;
+ 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 ;
From 8d9576a5c30e29a18fc2d84391274a3ddb7e4855 Mon Sep 17 00:00:00 2001
From: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Date: Mon, 31 Jul 2023 08:59:20 +1000
Subject: [PATCH 2/5] chore: use nq rather than nt
---
tests/N3Tests/graph/{empty_graph.nt => empty_graph.nq} | 0
.../{empty_graph_implies.nt => empty_graph_implies.nq} | 0
.../isImpliedBy/{isImpliedBy.nt => isImpliedBy.nq} | 0
.../{isImpliedBy_bcRule.nt => isImpliedBy_bcRule.nq} | 0
.../{isImpliedBy_graphs.nt => isImpliedBy_graphs.nq} | 0
tests/N3Tests/manifest-parser.ttl | 10 +++++-----
6 files changed, 5 insertions(+), 5 deletions(-)
rename tests/N3Tests/graph/{empty_graph.nt => empty_graph.nq} (100%)
rename tests/N3Tests/graph/{empty_graph_implies.nt => empty_graph_implies.nq} (100%)
rename tests/N3Tests/isImpliedBy/{isImpliedBy.nt => isImpliedBy.nq} (100%)
rename tests/N3Tests/isImpliedBy/{isImpliedBy_bcRule.nt => isImpliedBy_bcRule.nq} (100%)
rename tests/N3Tests/isImpliedBy/{isImpliedBy_graphs.nt => isImpliedBy_graphs.nq} (100%)
diff --git a/tests/N3Tests/graph/empty_graph.nt b/tests/N3Tests/graph/empty_graph.nq
similarity index 100%
rename from tests/N3Tests/graph/empty_graph.nt
rename to tests/N3Tests/graph/empty_graph.nq
diff --git a/tests/N3Tests/graph/empty_graph_implies.nt b/tests/N3Tests/graph/empty_graph_implies.nq
similarity index 100%
rename from tests/N3Tests/graph/empty_graph_implies.nt
rename to tests/N3Tests/graph/empty_graph_implies.nq
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy.nt b/tests/N3Tests/isImpliedBy/isImpliedBy.nq
similarity index 100%
rename from tests/N3Tests/isImpliedBy/isImpliedBy.nt
rename to tests/N3Tests/isImpliedBy/isImpliedBy.nq
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq
similarity index 100%
rename from tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nt
rename to tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq
similarity index 100%
rename from tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nt
rename to tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq
diff --git a/tests/N3Tests/manifest-parser.ttl b/tests/N3Tests/manifest-parser.ttl
index 55cbf110..d454725a 100644
--- a/tests/N3Tests/manifest-parser.ttl
+++ b/tests/N3Tests/manifest-parser.ttl
@@ -1026,7 +1026,7 @@
:empty_graph_eval
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "Empty Graph Eval";
rdfs:comment "Empty Graph should be parsed as the the literal true";
rdft:approval rdft:Approved .
@@ -1034,7 +1034,7 @@
:empty_graph_implies_eval
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
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 .
@@ -1042,7 +1042,7 @@
:isImpliedBy
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy";
rdft:approval rdft:Approved .
@@ -1050,7 +1050,7 @@
:isImpliedBy_graphs
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy in a complex use case";
rdft:approval rdft:Approved .
@@ -1058,7 +1058,7 @@
:isImpliedBy_bcRule
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy in a bcRule";
rdft:approval rdft:Approved .
From 69b00a07cddfd4fa87d90335808eabf71cc810be Mon Sep 17 00:00:00 2001
From: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Date: Sun, 15 Oct 2023 21:17:19 +0100
Subject: [PATCH 3/5] chore: remove invalid .nq syntax
---
tests/N3Tests/graph/empty_graph_implies.nq | 2 --
tests/N3Tests/graph/empty_graph_implies_result.n3 | 3 +++
tests/N3Tests/isImpliedBy/isImpliedBy.nq | 1 -
tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq | 6 ------
tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3 | 9 +++++++++
tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq | 4 ----
tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3 | 5 +++++
tests/N3Tests/manifest-parser.ttl | 6 +++---
8 files changed, 20 insertions(+), 16 deletions(-)
delete mode 100644 tests/N3Tests/graph/empty_graph_implies.nq
create mode 100644 tests/N3Tests/graph/empty_graph_implies_result.n3
delete mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3
delete mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq
create mode 100644 tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3
diff --git a/tests/N3Tests/graph/empty_graph_implies.nq b/tests/N3Tests/graph/empty_graph_implies.nq
deleted file mode 100644
index bcf2137a..00000000
--- a/tests/N3Tests/graph/empty_graph_implies.nq
+++ /dev/null
@@ -1,2 +0,0 @@
-"true"^^ "true"^^ _:b0 .
-_:b0 "true"^^ .
diff --git a/tests/N3Tests/graph/empty_graph_implies_result.n3 b/tests/N3Tests/graph/empty_graph_implies_result.n3
new file mode 100644
index 00000000..ff7c3449
--- /dev/null
+++ b/tests/N3Tests/graph/empty_graph_implies_result.n3
@@ -0,0 +1,3 @@
+{
+ "true"^^ "true"^^
+} "true"^^ .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy.nq b/tests/N3Tests/isImpliedBy/isImpliedBy.nq
index 26c728e8..fa40390c 100644
--- a/tests/N3Tests/isImpliedBy/isImpliedBy.nq
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy.nq
@@ -1,2 +1 @@
-
.
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq
deleted file mode 100644
index adbfc57d..00000000
--- a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule.nq
+++ /dev/null
@@ -1,6 +0,0 @@
-?a _:b0 .
-?a _:b1 .
-_:b0 _:b1 _:b2 .
- _:b2 .
- ?O _:b3 .
-_:b3 ?O .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3 b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3
new file mode 100644
index 00000000..603c34ab
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_bcRule_result.n3
@@ -0,0 +1,9 @@
+{ ?O } ?O .
+
+ {
+ {
+ ?a .
+ } {
+ ?a .
+ } .
+} .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq
deleted file mode 100644
index 4bf2fc4e..00000000
--- a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs.nq
+++ /dev/null
@@ -1,4 +0,0 @@
- _:b0 .
- _:b1 .
-
-_:b0 _:b1 .
diff --git a/tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3 b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3
new file mode 100644
index 00000000..987a43da
--- /dev/null
+++ b/tests/N3Tests/isImpliedBy/isImpliedBy_graphs_result.n3
@@ -0,0 +1,5 @@
+{
+
+} {
+
+} .
diff --git a/tests/N3Tests/manifest-parser.ttl b/tests/N3Tests/manifest-parser.ttl
index d454725a..a44b5f46 100644
--- a/tests/N3Tests/manifest-parser.ttl
+++ b/tests/N3Tests/manifest-parser.ttl
@@ -1034,7 +1034,7 @@
:empty_graph_implies_eval
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
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 .
@@ -1050,7 +1050,7 @@
:isImpliedBy_graphs
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy in a complex use case";
rdft:approval rdft:Approved .
@@ -1058,7 +1058,7 @@
:isImpliedBy_bcRule
a test:TestN3Eval ;
mf:action ;
- mf:result ;
+ mf:result ;
mf:name "isImpliedBy Eval";
rdfs:comment "<= should be parsed as log:isImpliedBy in a bcRule";
rdft:approval rdft:Approved .
From 2b1fb93c2db1441901d61f4d7041724885104ba1 Mon Sep 17 00:00:00 2001
From: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Date: Tue, 17 Oct 2023 15:03:24 +0100
Subject: [PATCH 4/5] Update tests/N3Tests/manifest-parser.ttl
---
tests/N3Tests/manifest-parser.ttl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/N3Tests/manifest-parser.ttl b/tests/N3Tests/manifest-parser.ttl
index a44b5f46..66fa93fc 100644
--- a/tests/N3Tests/manifest-parser.ttl
+++ b/tests/N3Tests/manifest-parser.ttl
@@ -1052,7 +1052,7 @@
mf:action ;
mf:result ;
mf:name "isImpliedBy Eval";
- rdfs:comment "<= should be parsed as log:isImpliedBy in a complex use case";
+ rdfs:comment "<= should be parsed as log:isImpliedBy with graph as premise and object";
rdft:approval rdft:Approved .
:isImpliedBy_bcRule
From 59f2ae74df01baa1ee2c3bad901ce578c644c252 Mon Sep 17 00:00:00 2001
From: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Date: Tue, 17 Oct 2023 15:04:04 +0100
Subject: [PATCH 5/5] Update tests/N3Tests/manifest-parser.ttl
---
tests/N3Tests/manifest-parser.ttl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/N3Tests/manifest-parser.ttl b/tests/N3Tests/manifest-parser.ttl
index 66fa93fc..d3c22b6a 100644
--- a/tests/N3Tests/manifest-parser.ttl
+++ b/tests/N3Tests/manifest-parser.ttl
@@ -1052,7 +1052,7 @@
mf:action ;
mf:result ;
mf:name "isImpliedBy Eval";
- rdfs:comment "<= should be parsed as log:isImpliedBy with graph as premise and object";
+ rdfs:comment "<= should be parsed as log:isImpliedBy with N3 graphs as subject and object";
rdft:approval rdft:Approved .
:isImpliedBy_bcRule