From d961d96497ccf62de31e327509f1e7637d2fc3f3 Mon Sep 17 00:00:00 2001 From: Pano Maria Date: Wed, 21 Feb 2024 06:52:36 +0100 Subject: [PATCH] update test cases and shapes (#13) --- ontology/documentation/ontology.ttl | 2 +- shapes/lv.ttl | 63 ++++++++++++++-- spec/section/joins.md | 9 +++ test-cases/RMLLVTC0001/mapping.ttl | 17 +++-- test-cases/RMLLVTC0001/output.nq | 2 + test-cases/RMLLVTC0002/mapping.ttl | 8 +- test-cases/RMLLVTC0003/mapping.ttl | 60 +++++++++++++-- test-cases/RMLLVTC0003/output.nq | 15 ++++ test-cases/RMLLVTC0004/mapping.ttl | 110 ++++++++++++++++++++++++++++ test-cases/RMLLVTC0004/output.nq | 13 ++++ test-cases/RMLLVTC0004/people.csv | 4 + test-cases/RMLLVTC0004/people.json | 26 +++++++ test-cases/RMLLVTC0005/mapping.ttl | 110 ++++++++++++++++++++++++++++ test-cases/RMLLVTC0005/output.nq | 13 ++++ test-cases/RMLLVTC0005/people.csv | 4 + test-cases/RMLLVTC0005/people.json | 26 +++++++ 16 files changed, 459 insertions(+), 23 deletions(-) create mode 100644 test-cases/RMLLVTC0001/output.nq create mode 100644 test-cases/RMLLVTC0003/output.nq create mode 100644 test-cases/RMLLVTC0004/mapping.ttl create mode 100644 test-cases/RMLLVTC0004/output.nq create mode 100644 test-cases/RMLLVTC0004/people.csv create mode 100644 test-cases/RMLLVTC0004/people.json create mode 100644 test-cases/RMLLVTC0005/mapping.ttl create mode 100644 test-cases/RMLLVTC0005/output.nq create mode 100644 test-cases/RMLLVTC0005/people.csv create mode 100644 test-cases/RMLLVTC0005/people.json diff --git a/ontology/documentation/ontology.ttl b/ontology/documentation/ontology.ttl index 1739a44..5cf5bf1 100644 --- a/ontology/documentation/ontology.ttl +++ b/ontology/documentation/ontology.ttl @@ -6,7 +6,7 @@ a owl:Ontology ; - # TODO check https://github.com/kg-construct/rml-core/issues/73 for resolution + # check https://github.com/kg-construct/rml-core/issues/73 for resolution # owl:imports ; # TODO not dereferencable? owl:imports ; # owl:imports ; # TODO not dereferencable? diff --git a/shapes/lv.ttl b/shapes/lv.ttl index f1bbb19..1a0e42c 100644 --- a/shapes/lv.ttl +++ b/shapes/lv.ttl @@ -13,19 +13,21 @@ rmlsh:LogicalViewShape a sh:NodeShape ; sh:name "LogicalView" ; sh:description """ - A logical view is ... + A logical view (rml:LogicalView) is a type of logical source that is derived from another logical source by defining field with data from said logical source. """ ; sh:message """ - Logical view requires ... + rml:LogicalView requires requires + - exactly one rml:source property, with a rml:LogicalSource as its value. + - at least one rml:field property, with a rml:Field as its value. """ ; sh:targetClass rml:LogicalView ; sh:targetObjectsOf rml:parentLogicalView ; sh:property [ sh:description """ - TODO describe here and in spec + The source of the logical view. This is the logical source from which the logical view is derived. """ ; sh:message """ - Exactly one rml:onLogicalSource property must be present, with a rml:LogicalSource as its value. + Exactly one rml:source property must be specified for a rml:LogicalView, with a rml:LogicalSource as its value. """ ; sh:path rml:source ; sh:minCount 1 ; @@ -33,11 +35,32 @@ rmlsh:LogicalViewShape a sh:NodeShape ; sh:node rmlsh:LogicalSource ; sh:nodeKind sh:BlankNodeOrIRI ; ] , [ + sh:description """ + A field of the logical view. + """ ; + sh:message """ + At least one rml:field property must be specified for a rml:LogicalView, with a resource as its value. + """ ; sh:path rml:field ; sh:minCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ; ] , [ - sh:path [ sh:alternativePath ( rml:leftJoin rml:innerJoin ) ] ; + sh:description """ + A left join of the logical view. + """ ; + sh:message """ + The value of a rml:leftJoin property for a rml:LogicalView must be a resource. + """ ; + sh:path rml:leftJoin ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + An inner join of the logical view. + """ ; + sh:message """ + The value of a rml:innerJoin property for a rml:LogicalView must be a resource. + """ ; + sh:path rml:innerJoin ; sh:nodeKind sh:BlankNodeOrIRI ; ] . @@ -53,12 +76,24 @@ rmlsh:FieldShape a sh:NodeShape ; sh:targetClass rml:Field ; sh:targetObjectOf rml:field ; sh:property [ + sh:description """ + The name of the field. + """ ; + sh:message """ + Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. + """ ; sh:path rml:fieldName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:nodeKind sh:Literal ; ] , [ + sh:description """ + A child field of the field. + """ ; + sh:message """ + The value of a rml:field property for a rml:Field must be a resource. + """ ; sh:path rml:field ; sh:nodeKind sh:BlankNodeOrIRI ; ] . @@ -75,15 +110,33 @@ rmlsh:LogicalViewJoinShape a sh:NodeShape ; sh:targetClass rml:LogicalViewJoin ; sh:targetObjectOf rml:leftJoin , rml:innerJoin ; sh:property [ + sh:description """ + The parent logical view of the logical view join. + """ ; + sh:message """ + Exactly one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; sh:path rml:parentLogicalView ; sh:minCount 1 ; sh:maxCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ; ] , [ + sh:description """ + A join condition of the logical view join. + """ ; + sh:message """ + At least one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; sh:path rml:joinCondition ; sh:minCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ; ] , [ + sh:description """ + A join condition of the logical view join. + """ ; + sh:message """ + At least one rml:field property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; sh:path rml:field ; sh:minCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ; diff --git a/spec/section/joins.md b/spec/section/joins.md index a06362a..3814ad8 100644 --- a/spec/section/joins.md +++ b/spec/section/joins.md @@ -77,6 +77,10 @@ The logical iterations from the child logical view are extended with values from When more than one logical iteration in the parent logical view matches with a logical iteration in the child logical view, each match leads to an additional extended logical iteration. If no match is found for a logical iteration, the logical iteration is removed from the child logical view. + + ### Join examples + + ### Inner join