From 439d6ec3d6dfbea74334beace790f500e61c9b7d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 May 2023 12:35:46 -0400 Subject: Add statement filter sink and serd-filter tool --- test/extra/filter/input.ttl | 9 ++++++++ test/extra/filter/manifest.ttl | 48 +++++++++++++++++++++++++++++++++++++++++ test/extra/filter/meson.build | 17 +++++++++++++++ test/extra/filter/o1.pattern.nt | 1 + test/extra/filter/o1.result.nt | 2 ++ test/extra/filter/p1.pattern.nt | 1 + test/extra/filter/p1.result.nt | 2 ++ test/extra/filter/s1.pattern.nt | 1 + test/extra/filter/s1.result.nt | 2 ++ 9 files changed, 83 insertions(+) create mode 100644 test/extra/filter/input.ttl create mode 100644 test/extra/filter/manifest.ttl create mode 100644 test/extra/filter/meson.build create mode 100644 test/extra/filter/o1.pattern.nt create mode 100644 test/extra/filter/o1.result.nt create mode 100644 test/extra/filter/p1.pattern.nt create mode 100644 test/extra/filter/p1.result.nt create mode 100644 test/extra/filter/s1.pattern.nt create mode 100644 test/extra/filter/s1.result.nt (limited to 'test/extra') diff --git a/test/extra/filter/input.ttl b/test/extra/filter/input.ttl new file mode 100644 index 00000000..59aa67f7 --- /dev/null +++ b/test/extra/filter/input.ttl @@ -0,0 +1,9 @@ +@prefix eg: . + +eg:s1 + eg:p1 eg:o1 ; + eg:p2 eg:o2 . + +eg:s2 + eg:p1 eg:o1 ; + eg:p2 eg:o2 . diff --git a/test/extra/filter/manifest.ttl b/test/extra/filter/manifest.ttl new file mode 100644 index 00000000..6ac5cec8 --- /dev/null +++ b/test/extra/filter/manifest.ttl @@ -0,0 +1,48 @@ +@prefix checks: . +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +serd:TestFilterPositive + a rdfs:Class ; + rdfs:label "Positive Filtering" ; + rdfs:subClassOf rdft:Test . + +serd:patternFile + a rdf:Property ; + rdfs:label "pattern file" . + +rdft:Test + rdfs:subClassOf mf:ManifestEntry . + +<> + a mf:Manifest ; + rdfs:comment "Serd statement filtering test suite" ; + mf:entries ( + <#o1> + <#p1> + <#s1> + ) . + +<#o1> + a serd:TestFilterPositive ; + serd:patternFile ; + mf:action ; + mf:name "o1" ; + mf:result . + +<#p1> + a serd:TestFilterPositive ; + serd:patternFile ; + mf:action ; + mf:name "p1" ; + mf:result . + +<#s1> + a serd:TestFilterPositive ; + serd:patternFile ; + mf:action ; + mf:name "s1" ; + mf:result . diff --git a/test/extra/filter/meson.build b/test/extra/filter/meson.build new file mode 100644 index 00000000..f03c7130 --- /dev/null +++ b/test/extra/filter/meson.build @@ -0,0 +1,17 @@ +base_uri = 'http://drobilla.net/sw/serd/test/filter/' + +test( + 'filter', + run_filter_suite, + args: common_script_args + [ + '--pipe', + serd_pipe, + '--filter', + serd_filter, + files('manifest.ttl'), + base_uri, + ], + env: test_env, + suite: ['suite', 'extra'], + timeout: 240, +) diff --git a/test/extra/filter/o1.pattern.nt b/test/extra/filter/o1.pattern.nt new file mode 100644 index 00000000..41932fd7 --- /dev/null +++ b/test/extra/filter/o1.pattern.nt @@ -0,0 +1 @@ +?s ?p . diff --git a/test/extra/filter/o1.result.nt b/test/extra/filter/o1.result.nt new file mode 100644 index 00000000..e7b1e759 --- /dev/null +++ b/test/extra/filter/o1.result.nt @@ -0,0 +1,2 @@ + . + . diff --git a/test/extra/filter/p1.pattern.nt b/test/extra/filter/p1.pattern.nt new file mode 100644 index 00000000..fca20e94 --- /dev/null +++ b/test/extra/filter/p1.pattern.nt @@ -0,0 +1 @@ +?s ?o . diff --git a/test/extra/filter/p1.result.nt b/test/extra/filter/p1.result.nt new file mode 100644 index 00000000..e7b1e759 --- /dev/null +++ b/test/extra/filter/p1.result.nt @@ -0,0 +1,2 @@ + . + . diff --git a/test/extra/filter/s1.pattern.nt b/test/extra/filter/s1.pattern.nt new file mode 100644 index 00000000..f5b87db1 --- /dev/null +++ b/test/extra/filter/s1.pattern.nt @@ -0,0 +1 @@ + ?p ?o . diff --git a/test/extra/filter/s1.result.nt b/test/extra/filter/s1.result.nt new file mode 100644 index 00000000..023faf42 --- /dev/null +++ b/test/extra/filter/s1.result.nt @@ -0,0 +1,2 @@ + . + . -- cgit v1.2.1