diff --git a/spec/docs/joinconditions.md b/spec/docs/joinconditions.md index 636f8d63..790970ac 100644 --- a/spec/docs/joinconditions.md +++ b/spec/docs/joinconditions.md @@ -43,7 +43,7 @@ has exactly one value for each of the following two properties: * a [child map]() (`rml:childMap`), whose value is an [Expression Map]() (`rml:ExpressionMap`), which MUST include references that exists in the [Logical Source]() - of the [Parent Triples Map]() that contains the [Referencing Object Map]() + of the [Triples Map]() that contains the [Referencing Object Map]() or it should have a constant value. * a [parent map]() (`rml:parentMap`), @@ -96,3 +96,73 @@ then the `rml:child` shortcut could be used. rml:logicalSource ; rml:subjectMap <#SM2> . ``` + +If the [Logical Source]() of the [Triples Map]() that contains the [Referencing Object Map]() +and the [Logical Source]() of the [Referencing Object Map]()'s [Parent Triples Map]() are not identical, +then the referencing object map MUST have at least one join condition. + +A [Logical Source]() is considered identical to another [Logical Source]() +when the set of objects at the end of the property paths starting with `rml:source` and starting with `rml:iterator` are identical. +In below examples `` and `` are identical, but `` and `` are not identical. +``` + + a rml:LogicalSource; + rml:source ; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.jsonpath.expression". + + a rml:Source, void:Dataset; + void:dataDump . + + + a rml:LogicalSource; + rml:source ; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.jsonpath.expression". + + a rml:Source, void:Dataset; + void:dataDump . + + + a rml:LogicalSource; + rml:source ; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.jsonpath.expression2". +``` + +``` + + a rml:LogicalSource; + rml:source [ a rml:Source, a csvw:Table + csvw:url "/absolute/path/to/data.csv"; + ]; + rml:referenceFormulation rml:CSV. + + + a rml:LogicalSource; + rml:source ; + rml:referenceFormulation rml:CSV. + + + a rml:Source, a csvw:Table + csvw:url "/absolute/path/to/data.csv". + + + a rml:LogicalSource; + rml:source [ a rml:Source, a csvw:Table + csvw:url "/relative/path/to/data.csv"; + ]. + rml:referenceFormulation rml:CSV. +``` + +If the [Referencing Object Map]() has no join condition, the [Logical Source]() of the [Triples Map]() that contains the [Referencing Object Map]() is used when generating the related RDF triples. + +If the [Referencing Object Map]() has one or more join conditions, the related RDF triples are generated using the [=n-ary Cartesian product=] +of the logical iteration of the [Logical Source]() of the [Triples Map]() that contains the [Referencing Object Map]() +and the logical iteration of the [Logical Source]() of the [Referencing Object Map]()'s [Parent Triples Map](), and +retaining only the combination of those logical iterations for which the values of the [Child Map]() and [Parent Map]() of each join condition are identical. + +