diff --git a/spec/docs/abstract.md b/spec/docs/abstract.md index f402d43..aa41dfe 100644 --- a/spec/docs/abstract.md +++ b/spec/docs/abstract.md @@ -1 +1 @@ -This document describes RML, a generic mapping language, based on and extending [R2RML](https://www.w3.org/TR/r2rml). The RDF Mapping language (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF [RDF-CONCEPTS](https://www.w3.org/TR/rdf-concepts/) data model. RML is defined as a superset of the W3C-standardized mapping language [R2RML](https://www.w3.org/TR/r2rml), aiming to extend its applicability and broaden its scope, adding support for data in other structured formats. [R2RML](https://www.w3.org/TR/r2rml) is the W3C standard to express customized mappings from relational databases to RDF. RML follows exactly the same syntax as R2RML; therefore, RML mappings are themselves RDF graphs. The present document describes the RML-Core language and its concepts through definitions and examples. \ No newline at end of file +This document describes RML, a generic mapping language, based on and extending [R2RML](https://www.w3.org/TR/r2rml). The RDF Mapping language (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF [RDF-CONCEPTS](https://www.w3.org/TR/rdf-concepts/) data model. RML is defined as a superset of the W3C-standardized mapping language [R2RML](https://www.w3.org/TR/r2rml), aiming to extend its applicability and broaden its scope, adding support for data in other structured formats. [R2RML](https://www.w3.org/TR/r2rml) is the W3C standard to express customized mappings from relational databases to RDF. RML follows exactly the same syntax as R2RML; therefore, RML mappings are themselves [=RDF graphs=]. The present document describes the RML-Core language and its concepts through definitions and examples. diff --git a/spec/docs/config.js b/spec/docs/config.js index 9e4d3b4..9181f75 100644 --- a/spec/docs/config.js +++ b/spec/docs/config.js @@ -62,12 +62,16 @@ var respecConfig = { license: "w3c-software-doc", localBiblio: { RML: { - title: "RDF Mapping Language (RML)", - href: "https://rml.io/specs/rml/", - status: "Unofficial Draft", - publisher: "", - date: "", - }, + title: "RDF Mapping Language (RML)", + href: "https://rml.io/specs/rml/", + status: "Unofficial Draft", + publisher: "", + date: "", + }, + // TODO: update once RML-IO-Registry is published + "RML-IO-Registry": { + title: "RML-IO Registry", + } }, otherLinks: [ { diff --git a/spec/docs/expressions.md b/spec/docs/expressions.md index 5ad1cc4..5d5dbd4 100644 --- a/spec/docs/expressions.md +++ b/spec/docs/expressions.md @@ -46,7 +46,7 @@ The [=reference expression set=] of a [=template expression=] is the set of [=re Sub classes of [=template-valued expression maps=] MAY define a reference value transforming function which will be applied to each [=reference value=] when evaluating the template. -The template value when evaluating a [=string template=] for a given [=logical source iteration=] is determined as follows: +The template value when evaluating a [=string template=] for a given [=logical iteration=] is determined as follows: 1. Let `result` be the [=reference expression set=] of the [=string template=] 2. For each [=reference expression=] in `result`: 1. Let `values` be the [=reference value=] of the [=reference expression=] that is enclosed in the curly braces diff --git a/spec/docs/index.html b/spec/docs/index.html index 0e1e780..303e624 100644 --- a/spec/docs/index.html +++ b/spec/docs/index.html @@ -96,6 +96,8 @@
+
+
@@ -106,6 +108,7 @@
+
diff --git a/spec/docs/introduction.md b/spec/docs/introduction.md index c2f60fa..c080b9e 100644 --- a/spec/docs/introduction.md +++ b/spec/docs/introduction.md @@ -1,9 +1,9 @@ # Base IRIs -The base IRI of the [=mapping document=] is used to resolve relative IRIs in the RML document following the specification of the Turtle serialisaiton. +The base IRI of the [=mapping document=] is used to resolve relative [=IRIs=] in the RML document following the specification of the Turtle serialisaiton. ## Base IRI for mapping rules -The [=base IRI=] of the [=Triples Map=] is used in resolving relative IRIs produced by the [=RML mapping=]. +The [=base IRI=] of the [=Triples Map=] is used in resolving relative [=IRIs=] produced by the [=RML mapping=].
@@ -13,13 +13,13 @@ The [=base IRI=] of the [=Triples Map=] is used in resolving relative IRIs produ
     rml:baseIri  .
 
-The [=base IRI=] MUST be a valid IRI. It SHOULD NOT contain question mark (“?”) or hash (“#”) characters and SHOULD end in a slash (“/”) character. +The [=base IRI=] MUST be a valid [=IRI=]. It SHOULD NOT contain question mark ("`?`") or hash ("`#`") characters and SHOULD end in a slash ("`/`") character. -To obtain an absolute IRI from a relative IRI, the term generation rules of RML use simple string concatenation, rather than the more complex algorithm for resolution of relative URIs defined in Section 5.2 of [RFC3986]. This ensures that the original database value can be reconstructed from the generated absolute IRI. Both algorithms are equivalent if all of the following are true: +To obtain an absolute [=IRI=] from a relative [=IRI=], the term generation rules of RML use simple string concatenation, rather than the more complex algorithm for resolution of relative URIs defined in Section 5.2 of [RFC3986]. This ensures that the original database value can be reconstructed from the generated absolute [=IRI=]. Both algorithms are equivalent if all of the following are true: 1. The base IRI does not contain question marks or hashes, 2. the base IRI ends in a slash, - 3. the relative IRI does not start with a slash, and - 4. the relative IRI does not contain any “.” or “..” path segments. + 3. the relative [=IRI=] does not start with a slash, and + 4. the relative [=IRI=] does not contain any "`.`" or "`..`" path segments. diff --git a/spec/docs/joins.md b/spec/docs/joins.md index 25d3af9..f6da4f4 100644 --- a/spec/docs/joins.md +++ b/spec/docs/joins.md @@ -19,7 +19,7 @@ as the [Referencing Term Map]()'s [Triples Map]() is known. The [Referencing Term Map]() (`rml:ReferencingTermMap`) can be * a [Referencing Subject Map]() (`rml:ReferencingSubjectMap`) -if it constructs the subject of an RDF triple. +if it constructs the subject of an [=RDF triple=]. ``` <#TM1> @@ -33,7 +33,7 @@ if it constructs the subject of an RDF triple. If the [Referencing Term Map]() (`rml:ReferencingTermMap`) is a [Referencing Subject Map]() (`rml:ReferencingSubjectMap`), then the [Parent Term Map]() (`rml:ParentTermMap`) -should construct an IRI or Blank Node. +should construct an [=IRI=] or [=blank node=]. The aforementioned could be shortcutted by using the [parent subject map]() (`rml:parentSubjectMap`) property as follows: @@ -48,7 +48,7 @@ The aforementioned could be shortcutted by using the [parent subject map]() (`rm ``` * a [Referencing Predicate Map]() (`rml:ReferencingPredicateMap`) -if it constructs the predicate of an RDF triple. +if it constructs the predicate of an [=RDF triple=]. ``` <#TM1> @@ -67,7 +67,7 @@ if it constructs the predicate of an RDF triple. If the [Referencing Term Map]() (`rml:ReferencingTermMap`) is a [Referencing Predicate Map]() (`rml:ReferencingPredicateMap`) then -the [Parent Term Map] should construct an IRI. +the [Parent Term Map] should construct an [=IRI=]. The aforementioned could be shortcutted using the [parent predicate map]() (`rml:parentPredicateMap`) property as follows: @@ -87,7 +87,7 @@ The aforementioned could be shortcutted using the [parent predicate map]() (`rml ``` * a [Referencing Object Map]() (`rml:ReferencingObjectMap`) -if it constructs the object of an RDF triple. +if it constructs the object of an [=RDF triple=]. ``` <#TM1> @@ -123,7 +123,7 @@ The aforementioned could be shortcutted using the [parent object map]() (`rml:pa ``` * a [Referencing Graph Map]() (`rml:ReferencingGraphMap`) -if it constructs the graph of an RDF triple. +if it constructs the graph of an [=RDF triple=]. ``` <#TM1> @@ -240,7 +240,7 @@ The [Parent Term Map]() (`rml:parentTermMap`) can be ### Edge cases for Parent Term Maps **Alternative 1**: -If the Referencing Term Map of the Parent Tiples Map could/should not construct any RDF triples, +If the Referencing Term Map of the Parent Tiples Map could/should not construct any [=RDF triples=], the Triples Map should not have a Subject Map and/or the Predicate Object Map should not have a Predicate or an Object Map. ``` <#TM1> @@ -257,7 +257,7 @@ the Triples Map should not have a Subject Map and/or the Predicate Object Map sh ``` **Alternative 2**: -If the Referencing Term Map of the Parent Tiples Map could/should not construct any RDF triples, +If the Referencing Term Map of the Parent Tiples Map could/should not construct any [=RDF triple=], the Triples Map should not have a Subject Map and the Predicate Object Map should only have a Term Map. ``` <#TM1> @@ -274,7 +274,7 @@ the Triples Map should not have a Subject Map and the Predicate Object Map shoul ``` **Alternative 3**: -If the Referencing Term Map of the Parent Tiples Map should not construct any RDF triples, +If the Referencing Term Map of the Parent Tiples Map should not construct any [=RDF triple=], the Triples Map should only have a Logical Source and a Term Map. ``` <#TM1> @@ -296,14 +296,14 @@ 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]() +MUST include references that exists in the [=logical source=] of the [Triples Map]() that contains the [Referencing Object Map]() or it should have a constant value. * a [parent map]() (`rml:parentMap`), whose value is an [Expression Map]() (`rml:ExpressionMap'), which, as the join condition's parent map, -MUST include references that exists in the [Logical Source]() +MUST include references that exists in the [=logical source=] of the [Referencing Object Map]()'s [Parent Triples Map]() or it should have a constant value. diff --git a/spec/docs/logicalSource.md b/spec/docs/logicalSource.md new file mode 100644 index 0000000..3e387a6 --- /dev/null +++ b/spec/docs/logicalSource.md @@ -0,0 +1,15 @@ +# Defining Logical Sources + +A logical source is an abstract construct to describe data access and iteration for a [=data source=] such that it can be mapped to [=RDF triples=]. + +A [=logical source=] (`rml:LogicalSource`) MUST have: +* exactly one `rml:referenceFormulation` property, whose value is a reference formulation which defines how the underlying [=data source=] is to be accessed, and which [=expressions=] can be evaluated on [=logical iterations=], +* zero or one `rml:iterator` property, whose value is a logical iterator that defines a sequence of [=logical iterations=] on the [=data source=]. If no [=iterator=] is provided, a default iterator MUST be associated with the [=reference formulation=]. + +A logical iteration is an item in the sequence produced by the [=logical source=], on which [=expressions=] can be evaluated. + +A data source is an abstract concept that represents a source of data that can be accessed via a [=logical source=]. A [=data source=] can be a file, a database, a web service, or any other source of data. + + diff --git a/spec/docs/mapping.md b/spec/docs/mapping.md index 583fa7f..c5d65a6 100644 --- a/spec/docs/mapping.md +++ b/spec/docs/mapping.md @@ -1,68 +1,50 @@ # Mapping to RDF with Triples Maps -A triples map specifies a set of rules for translating -each iteration of a [=logical source=] to zero or more RDF triples. +A triples map specifies a set of rules for translating each [=iteration=] of a [=logical source=] to zero or more [=RDF triple=]. -All RDF triples generated from one [=logical iteration=] in the [=logical source=] share the same subject. +All [=RDF triples=] generated from one [=logical iteration=] in the [=logical source=] share the same [=subject=]. -A [=triples map=] is represented by a resource that references the following other resources: +A [=triples map=] is represented by a [=resource=] that references the following other [=resources=]: -* It MUST have zero or one [=logical source=] (`rml:logicalSource`) property. The [=logical source=] property MAY only be omitted if all of the [=term maps=] of the [=triples map=] are [=constant-valued term maps=]. -* It MUST have exactly one [=subject map=] (`rml:SubjectMap`) that specifies -how to generate a subject for each iteration of the [=Logical Source=]. +* It MUST have zero or one [=logical source=] (`rml:logicalSource`) property. +* It MUST have exactly one [=subject map=] (`rml:SubjectMap`) that specifies how to generate a subject for each [=iteration=] of the [=logical source=]. It may be specified in two ways: - 1. using the subject map `rml:subjectMap` property, - whose value MUST be the [=subject map=], or - 2. using the constant shortcut property (``rml:subject``), - followed by a constant IRI. -* It MUST have zero or more predicate-object maps (`rml:predicateObjectMap`) properties, -whose values MUST be [=predicate-object maps=]. -They specify pairs of [=predicate maps=] and [=object maps=] that, -together with the subjects generated by the [=subject map=], -may form one or more [=RDF triples=] for each iteration. - -``` -<#TM> - rml:LogicalSource <#LS> ; - rml:subjectMap <#SM> ; - rml:predicateObjectMap <#POM1>, <#POM2>, ..., <#POMn> . -``` + 1. using the subject map `rml:subjectMap` property, whose value MUST be the [=subject map=], or + 2. using the [=constant shortcut property=] (`rml:subject`). +* It MUST have zero or more predicate-object map (`rml:predicateObjectMap`) properties, whose values MUST be [=predicate-object maps=]. +They specify pairs of [=predicate maps=] and [=object maps=] that, together with the [=subjects=] generated by the [=subject map=], may form one or more [=RDF triples=] for each [=iteration=]. -# Term Maps +