Skip to content

[Rules] Tests #677

@afs

Description

@afs

We need rule syntax tests - a test that takes a file, parses it as a rule set and passes (positive test) or expects a faulure (negative test).
That includes well-formedness and stratification test coverage.

We need evaluation tests that take a rule set, a data graph and an expected output graph. The test run by evaluation to give an actual graph which is compared with the expected graph. Graph compare is "blank node isomorphic". Evaluation tests don't have a lot of data so "blank node isomorphic" is cheap.

:test_1 rdf:type   srt:RulesPositiveSyntaxTest ;
   mf:name    "A test of good syntax" ;
   mf:action  <syntax-rule-01.srl> ;
   .

:test_2 rdf:type   srt:RulesNegativeSyntaxTest ;
   mf:name    "A test that syntax is rejected" ;
   mf:action  <syntax-rule-02.srl> ;
   .
:eval-01 rdf:type srt:RulesEvalTest ;
    mf:name "Evaluation test basic-1";
    mf:action
         [ srt:ruleset  <eval-basic-01.shr> ;
           srt:data   <data-01.ttl> ] ;
    mf:result  <eval-results-basic-01.ttl> ;
    .

See http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#.
There is a reporting format using W3C EARL.

SHACL validation tests can use a single file because its checking the validation report which is easy to identify within a graph.
General testing for "expected graph" as part of a single graph is not so easy.

https://w3c.github.io/rdf-tests/

Metadata

Metadata

Assignees

No one assigned

    Labels

    RulesFor SHACL 1.2 Rules spec.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions