diff --git a/spec/docs/config.js b/spec/docs/config.js new file mode 100644 index 0000000..9e4d3b4 --- /dev/null +++ b/spec/docs/config.js @@ -0,0 +1,91 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Pano Maria", + company: "Skemu", + url: "https://skemu.com", + orcid: "0009-0000-2598-1894", + companyURL: "https://skemu.com" + }, + { + name: "Anastasia Dimou", + mailto: "anastasia.dimou@kuleuven.be", + company: "KU Leuven", + orcid: "0000-0003-2138-7972", + companyURL: "https://dtai.cs.kuleuven.be/" + }, + ], + edDraftURI: "https://w3id.org/rml/core/spec", + editors: [ + { + name: "Pano Maria", + company: "Skemu", + url: "https://skemu.com", + orcid: "0009-0000-2598-1894", + companyURL: "https://skemu.com" + }, + { + name: "Anastasia Dimou", + mailto: "anastasia.dimou@kuleuven.be", + company: "KU Leuven", + orcid: "0000-0003-2138-7972", + companyURL: "https://dtai.cs.kuleuven.be/" + }, + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-core", + license: "w3c-software-doc", + localBiblio: { + RML: { + title: "RDF Mapping Language (RML)", + href: "https://rml.io/specs/rml/", + status: "Unofficial Draft", + publisher: "", + date: "", + }, + }, + otherLinks: [ + { + key: "Website", + data: [{ + value: "https://rml.io", + href: "https://rml.io" + }, + { + value: "https://fno.io", + href: "https://fno.io" + }] + }, + ], + shortName: "RML-Core", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2021", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/spec/docs/expressions.md b/spec/docs/expressions.md index fe8dd66..5ad1cc4 100644 --- a/spec/docs/expressions.md +++ b/spec/docs/expressions.md @@ -4,31 +4,33 @@ ## Expression map (`rml:ExpressionMap`) -An expression map (`rml:ExpressionMap`) is an abstract class, that is specialized by other RML classes. An [=expression map=] MAY have one the following properties: +An expression map (`rml:ExpressionMap`) is an abstract class, that is specialized by other RML classes. An [=expression map=] MUST have one the following properties: * 0 or 1 `rml:constant`, or * 0 or 1 `rml:reference`, or -* 0 or 1 `rml:template`. +* 0 or 1 `rml:template`, or +* another property, or properties, defined by a subclass of `rml:ExpressionMap`. -Each of these properties specifies an [=expression=] which, upon evaluation, results in a set of values. +Each of these properties specifies an [=expression=] which, upon evaluation, results in an ordered list of values. -The reference expression set of an [=expression map=] ar the set of expressions which are evaluated on a [=logical iteration=]. +The reference expression set of an [=expression map=] is the set of expressions which are evaluated on a [=logical iteration=]. ### Constant expression (`rml:constant`) -A constant-valued expression map is an [=expression map=] that always generates the same expression value. A constant-valued expression map is represented by a resource that has exactly one `rml:constant` property, the value of which is called a constant expression. +A constant-valued expression map is an [=expression map=] that always generates the same value. A constant-valued expression map is represented by a resource that has exactly one `rml:constant` property, the value of which is called a constant expression. -The constant value is a singleton set containing the [=constant expression=]. +The constant value is a singleton list containing the [=constant expression=]. -The [=reference expressions=] of a [constant-valued expression map=] is the empty set. +The [=reference expressions=] of a [constant-valued expression map=] is an empty list. ### Reference (`rml:reference`) A reference-valued expression map is an [=expression map=] that is represented by a resource that has exactly one `rml:reference` property, the value of which is called a reference expression. The [=reference expression=] MUST be a valid [=expression=] according to the defined [=reference formulation=] in the [=logical source=]. -The [=reference expression set=] of a [reference-valued expression map=] is the singleton set containing the [=reference expression=]. +The [=reference expression set=] of a [=reference-valued expression map=] is the singleton set containing the [=reference expression=]. -The reference value is a set of values obtained by evaluating the [=reference expression=] against a given [=logical iteration=]. +The reference value is an ordered list of values obtained by evaluating the [=reference expression=] against a given [=logical iteration=]. +For each value in the ordered list, an expression is created. ### Template (`rml:template`) A template-valued expression map is an [=expression map=] that is represented by a resource that has exactly one `rml:template` property, the value of which is called a template expression. The [=template expression=] MUST be a valid [=string template=]. @@ -48,7 +50,7 @@ The template value when evaluating a [=string template=] for a given 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 - 2. If `values` is an empty set, then return `NULL` + 2. If `values` is an empty list, then return `NULL` 3. For each `value` in `values`: 1. Let `value` be the [=natural RDF lexical form=] corresponding to `value` 3. Let `result` be the [=n-ary Cartesian product=] of `result` diff --git a/spec/docs/index.html b/spec/docs/index.html index 0d6c075..0e1e780 100644 --- a/spec/docs/index.html +++ b/spec/docs/index.html @@ -5,74 +5,78 @@ RML-Core - + + diff --git a/spec/docs/introduction.md b/spec/docs/introduction.md index dc425ff..c2f60fa 100644 --- a/spec/docs/introduction.md +++ b/spec/docs/introduction.md @@ -1,5 +1,25 @@ # 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. ## Base IRI for mapping rules -## Base IRI for vocabulary +The [=base IRI=] of the [=Triples Map=] is used in resolving relative IRIs produced by the [=RML mapping=]. + + +
+# Triples Map that has a declared base IRI
+<#TriplesMap>
+    a rml:TriplesMap;
+    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. + +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. + + diff --git a/spec/docs/joinconditions.md b/spec/docs/joinconditions.md index 636f8d6..7a7f3fd 100644 --- a/spec/docs/joinconditions.md +++ b/spec/docs/joinconditions.md @@ -1,98 +1,120 @@ # Joins -A Referencing Object Map (`rml:ReferencingObjectMap`) allows -using the subject generated by the [Subject Map]() (`rml:SubjectMap`) -of the referenced [Triples Map]() (`rml:TriplesMap`). -Since the two triples maps (`rml:TriplesMap`) may be based on -different logical sources (`rml:LogicalSource`), -this may require a join between the logical sources (`rml:LogicalSource`). -This is not restricted to 1:1 joins. +A [=Referencing Object Map=] allows using the subject generated by the [=Subject Map=] (`rml:SubjectMap`) of the referenced [=Triples Map=] (`rml:TriplesMap`). +Since the two [=triples maps=] may be based on different [=logical sources=] (`rml:LogicalSource`), this may require a [=join=] (`rml:Join`) between the [=logical sources=]. This is not restricted to 1:1 joins. ## Referencing Object Map -A [Referencing Object Map] (`rml:ReferencingObjectMap`) is represented by a resource that: +A Referencing Object Map (`rml:ReferencingObjectMap`) is represented by a resource that: -* has exactly one [Parent Triples Map]() (`rml:parentTriplesMap`) property, - whose value MUST be a Triples Map (`rml:TriplesMap`). -* MAY have one or more [Join Conditions]() (`rml:joinCondition`) properties. +* has exactly one [=parent triples map=] (`rml:parentTriplesMap`) property, + whose value MUST be a [=triples map=], known as the referencing object map's parent triples map. +* MUST have one or more [=join Conditions=] (`rml:joinCondition`) properties. -The [Referencing Object Map]() (`rml:ReferencingObjectMap`) -is constructed with the subject of the [Parent Triples Map]() (`rml:parentTriplesMap`). +The [=referencing object map=] caused the generation of new [=object=] which is constructed with the [=subject=] generated by evaluating the [=parent triples map=]. + ## Join Condition -A [Join Condition]() is represented by a resource that -has exactly one value for each of the following two properties: +A Join Condition is represented by a resource that 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]() - or it should have a constant value. +* a child map (`rml:childMap`) property, whose value is a [=child map=]. A child map (`rml:ChildMap`) is an [=expression map=], which MUST include [=references=] that exist in the [=logical source=] of the [=parent 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]() - of the [Referencing Object Map]()'s [Parent Triples Map]() - or it should have a constant value. +* a parent map (`rml:parentMap`) property, whose value is a [=parent map=]. A parent map (`rml:ParentMap`) is an [=expression map=], which MUST include references that exist in the [=logical source=] of the [=referencing object map=]'s [=parent triples map=], or it should have a [=constant value=]. -``` -<#TM1> - rml:logicalSource ; - rml:subjectMap <#SM1> ; - rml:predicateObjectMap [ - rml:predicateMap <#PM1> ; - rml:objectMap [ - rml:parentTriplesMap <#TM2> ; - rml:joinCondition [ - rml:childMap [ rml:reference "..."]; - rml:parentMap [ rml:template "..."]; - ] ] ]. - -<#TM2> - rml:logicalSource ; - rml:subjectMap <#SM2> . + -Similarly, if the [Parent Map]() (`rml:ParentMap`) is a reference-valued [Expression Map]() (`rml:ExpressionMap`), -then the `rml:child` shortcut could be used. +### Shortcuts for reference-valued child map and parent map +If the [=child map=] is a [=reference-valued expression map=], then the `rml:child` shortcut could be used. + +Similarly, if the [=parent map=] is a [=reference-valued expression map=], then the `rml:parent` shortcut could be used. + +Occurrences of these properties MUST be treated exactly as if the following triples were present in the [=mapping graph=] instead: + +| Triple involving reference shortcut property | Replacement triples | +| :--------------------------------------------| :----------------------------------------| +| `?x rml:child ?y.` | `?x rml:childMap [ rml:reference ?y ].` | +| `?x rml:parent ?y.` | `?x rml:parentMap [ rml:reference ?y ].` | + + + diff --git a/spec/docs/mapping.md b/spec/docs/mapping.md index 09e55b0..583fa7f 100644 --- a/spec/docs/mapping.md +++ b/spec/docs/mapping.md @@ -9,17 +9,17 @@ A [=triples map=] is represented by a resource that references the following oth * 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](). +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 MAY have zero or more predicate-object maps (`rml:predicateObjectMap`) properties, +* 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. +may form one or more [=RDF triples=] for each iteration. ``` <#TM> @@ -28,6 +28,10 @@ may form one or more [RDF triples]() for each iteration. rml:predicateObjectMap <#POM1>, <#POM2>, ..., <#POMn> . ``` + + # Term Maps -The referenced data of all [term maps]() of a [=triples map=] -([=subject map=], [=predicate maps=], [=object maps=], [graph maps]()) +The referenced data of all [=term maps=] of a [=triples map=] +([=subject map=], [=predicate maps=], [=object maps=], [=graph maps=]) MUST be references that exist in the [=term map=]'s logical source.