Skip to content

Testing for cycles (test cases) #91

@chrdebru

Description

@chrdebru

Proposal: the use of SPARQL Constraints to test for cycles. Which works for the test cases in LV.
Also, shouldn't there be a test case for cyclical fields to ensure all cases are covered?

rmlsh:parentCyclesShape a sh:NodeShape ;
    sh:targetSubjectsOf rml:viewOn ;
    sh:targetSubjectsOf rml:field ;

    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "There must be no cycles via rml:viewOn or rml:Field." ;
        sh:select """
            PREFIX rml: <http://w3id.org/rml/>
            SELECT ?this
            WHERE {
              ?this a rml:LogicalView .
              ?this (rml:viewOn|rml:field)+ ?this .
            }
        """ ;
    ] .

rmlsh:joinCyclesShape a sh:NodeShape ;
    sh:targetSubjectsOf rml:viewOn ;

    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "There must be no cycles via rml:viewOn and rml:leftJoin or rml:innerJoin." ;
        sh:select """
            PREFIX rml: <http://w3id.org/rml/>
            SELECT ?this
            WHERE {
              ?this a rml:LogicalView .
              ?this ((rml:leftJoin|rml:innerJoin)/rml:parentLogicalView)+ ?this .
            }
        """ ;
    ] .

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions