Skip to content

Commit 2bd0ec3

Browse files
pmariaandimou
andauthored
use list instead of set to define the result of expression and define empty value handling (#121 & #16) (#128)
* clarified NULL values, cartesian product for templates and term types of term maps * added a first draft for base IRIs * cleaning * constant-valued term maps * all clarifications wrt empty and multiple values related to #13 and #16 should be clarified for the expression and term map. * added clarification for LS cardinality and exception according to #57 * use list instead of set to define the result of expression (#121) * fixes after merge of branch * improve example styling * fix template example * apply example styling on all examples and some small fixes * spelling fix * fix draft link --------- Co-authored-by: Anastasia Dimou <[email protected]>
1 parent 4fd1780 commit 2bd0ec3

File tree

8 files changed

+510
-253
lines changed

8 files changed

+510
-253
lines changed

spec/docs/config.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
async function loadTurtle() {
2+
//this is the function you call in 'preProcess', to load the highlighter
3+
const worker = await new Promise(resolve => {
4+
require(["core/worker"], ({ worker }) => resolve(worker));
5+
});
6+
const action = "highlight-load-lang";
7+
const langURL =
8+
"https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js";
9+
const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded
10+
const lang = "turtle"; // this is the class you use to identify the language
11+
worker.postMessage({ action, langURL, propName, lang });
12+
return new Promise(resolve => {
13+
worker.addEventListener("message", function listener({ data }) {
14+
const { action: responseAction, lang: responseLang } = data;
15+
if (responseAction === action && responseLang === lang) {
16+
worker.removeEventListener("message", listener);
17+
resolve();
18+
}
19+
});
20+
});
21+
}
22+
23+
var respecConfig = {
24+
// check https://respec.org/docs/ for the meaning of these keys
25+
preProcess: [loadTurtle],
26+
authors: [
27+
{
28+
name: "Pano Maria",
29+
company: "Skemu",
30+
url: "https://skemu.com",
31+
orcid: "0009-0000-2598-1894",
32+
companyURL: "https://skemu.com"
33+
},
34+
{
35+
name: "Anastasia Dimou",
36+
mailto: "[email protected]",
37+
company: "KU Leuven",
38+
orcid: "0000-0003-2138-7972",
39+
companyURL: "https://dtai.cs.kuleuven.be/"
40+
},
41+
],
42+
edDraftURI: "https://w3id.org/rml/core/spec",
43+
editors: [
44+
{
45+
name: "Pano Maria",
46+
company: "Skemu",
47+
url: "https://skemu.com",
48+
orcid: "0009-0000-2598-1894",
49+
companyURL: "https://skemu.com"
50+
},
51+
{
52+
name: "Anastasia Dimou",
53+
mailto: "[email protected]",
54+
company: "KU Leuven",
55+
orcid: "0000-0003-2138-7972",
56+
companyURL: "https://dtai.cs.kuleuven.be/"
57+
},
58+
],
59+
formerEditors: [
60+
],
61+
github: "https://github.com/kg-construct/rml-core",
62+
license: "w3c-software-doc",
63+
localBiblio: {
64+
RML: {
65+
title: "RDF Mapping Language (RML)",
66+
href: "https://rml.io/specs/rml/",
67+
status: "Unofficial Draft",
68+
publisher: "",
69+
date: "",
70+
},
71+
},
72+
otherLinks: [
73+
{
74+
key: "Website",
75+
data: [{
76+
value: "https://rml.io",
77+
href: "https://rml.io"
78+
},
79+
{
80+
value: "https://fno.io",
81+
href: "https://fno.io"
82+
}]
83+
},
84+
],
85+
shortName: "RML-Core",
86+
specStatus: "CG-DRAFT",
87+
// W3C config
88+
copyrightStart: "2021",
89+
doJsonLd: true,
90+
group: "kg-construct",
91+
};

spec/docs/expressions.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,33 @@
44

55
## Expression map (`rml:ExpressionMap`)
66

7-
An <dfn>expression map</dfn> (`rml:ExpressionMap`) is an abstract class, that is specialized by other RML classes. An [=expression map=] MAY have one the following properties:
7+
An <dfn>expression map</dfn> (`rml:ExpressionMap`) is an abstract class, that is specialized by other RML classes. An [=expression map=] MUST have one the following properties:
88
* 0 or 1 `rml:constant`, or
99
* 0 or 1 `rml:reference`, or
10-
* 0 or 1 `rml:template`.
10+
* 0 or 1 `rml:template`, or
11+
* another property, or properties, defined by a subclass of `rml:ExpressionMap`.
1112

12-
Each of these properties specifies an [=expression=] which, upon evaluation, results in a set of values.
13+
Each of these properties specifies an [=expression=] which, upon evaluation, results in an ordered list of values.
1314

14-
The <dfn>reference expression set</dfn> of an [=expression map=] ar the set of expressions which are evaluated on a [=logical iteration=].
15+
The <dfn>reference expression set</dfn> of an [=expression map=] is the set of expressions which are evaluated on a [=logical iteration=].
1516

1617
### Constant expression (`rml:constant`)
1718

18-
A <dfn>constant-valued expression map</dfn> 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 <dfn>constant expression</dfn>.
19+
A <dfn>constant-valued expression map</dfn> 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 <dfn>constant expression</dfn>.
1920

20-
The <dfn>constant value</dfn> is a singleton set containing the [=constant expression=].
21+
The <dfn>constant value</dfn> is a singleton list containing the [=constant expression=].
2122

22-
The [=reference expressions=] of a [constant-valued expression map=] is the empty set.
23+
The [=reference expressions=] of a [constant-valued expression map=] is an empty list.
2324

2425
### Reference (`rml:reference`)
2526
A <dfn>reference-valued expression map</dfn> is an [=expression map=] that is represented by a resource that has exactly one `rml:reference` property, the value of which is called a <dfn>reference expression</dfn>.
2627

2728
The [=reference expression=] MUST be a valid [=expression=] according to the defined [=reference formulation=] in the [=logical source=].
2829

29-
The [=reference expression set=] of a [reference-valued expression map=] is the singleton set containing the [=reference expression=].
30+
The [=reference expression set=] of a [=reference-valued expression map=] is the singleton set containing the [=reference expression=].
3031

31-
The <dfn>reference value</dfn> is a set of values obtained by evaluating the [=reference expression=] against a given [=logical iteration=].
32+
The <dfn>reference value</dfn> is an ordered list of values obtained by evaluating the [=reference expression=] against a given [=logical iteration=].
33+
For each value in the ordered list, an expression is created.
3234

3335
### Template (`rml:template`)
3436
A <dfn>template-valued expression map</dfn> is an [=expression map=] that is represented by a resource that has exactly one `rml:template` property, the value of which is called a <dfn>template expression</dfn>. The [=template expression=] MUST be a valid [=string template=].
@@ -48,7 +50,7 @@ The <dfn>template value</dfn> when evaluating a [=string template=] for a given
4850
1. Let `result` be the [=reference expression set=] of the [=string template=]
4951
2. For each [=reference expression=] in `result`:
5052
1. Let `values` be the [=reference value=] of the [=reference expression=] that is enclosed in the curly braces
51-
2. If `values` is an empty set, then return `NULL`
53+
2. If `values` is an empty list, then return `NULL`
5254
3. For each `value` in `values`:
5355
1. Let `value` be the [=natural RDF lexical form=] corresponding to `value`
5456
3. Let `result` be the [=n-ary Cartesian product=] of `result`

spec/docs/index.html

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,74 +5,78 @@
55
<title>RML-Core</title>
66
<meta charset="utf-8">
77
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer></script>
8-
<script class="remove">
9-
var respecConfig = {
10-
// check https://respec.org/docs/ for the meaning of these keys
11-
authors: [
12-
{
13-
name: "Pano Maria",
14-
company: "Skemu",
15-
url: "https://panomaria.com",
16-
companyURL: "https://skemu.com"
17-
},
18-
{
19-
name: "Anastasia Dimou",
20-
mailto: "[email protected]",
21-
company: "KU Leuven",
22-
orcid: "0000-0003-2138-7972",
23-
companyURL: "https://dtai.cs.kuleuven.be/"
24-
},
25-
],
26-
edDraftURI: "https://w3id.org/rml/spec",
27-
editors: [
28-
{
29-
name: "Pano Maria",
30-
company: "Skemu",
31-
url: "https://panomaria.com",
32-
companyURL: "https://skemu.com"
33-
},
34-
{
35-
name: "Anastasia Dimou",
36-
mailto: "[email protected]",
37-
company: "KU Leuven",
38-
orcid: "0000-0003-2138-7972",
39-
companyURL: "https://dtai.cs.kuleuven.be/"
40-
},
41-
],
42-
formerEditors: [
43-
],
44-
github: "https://github.com/kg-construct/rml-core",
45-
license: "w3c-software-doc",
46-
localBiblio: {
47-
RML: {
48-
title: "RDF Mapping Language (RML)",
49-
href: "https://rml.io/specs/rml/",
50-
status: "Unofficial Draft",
51-
publisher: "",
52-
date: "",
53-
},
54-
},
55-
otherLinks: [
56-
{
57-
key: "Website",
58-
data: [{
59-
value: "https://rml.io",
60-
href: "https://rml.io"
61-
},
62-
{
63-
value: "https://fno.io",
64-
href: "https://fno.io"
65-
}]
66-
},
67-
],
68-
shortName: "RML-Core",
69-
specStatus: "CG-DRAFT",
70-
// W3C config
71-
copyrightStart: "2021",
72-
doJsonLd: true,
73-
group: "kg-construct",
74-
};
75-
</script>
8+
<style type="text/css">
9+
/* Adapted from R2RML */
10+
aside.ex-input,
11+
aside.ex-mapping,
12+
aside.ex-output {
13+
word-wrap:normal;
14+
margin-top: 1.5em;
15+
padding: 1em;
16+
font-size: 80%;
17+
}
18+
aside.ex-input:before,
19+
aside.ex-mapping:before,
20+
aside.ex-output:before {
21+
background: white;
22+
display: block;
23+
font-family: sans-serif;
24+
font-size: 90%;
25+
margin: -1.5em 0 0.5em 0;
26+
padding: 0.4em 0.4em;
27+
width: 18em;
28+
}
29+
/* Input data example */
30+
aside.ex-input {
31+
background: #cee;
32+
}
33+
aside.ex-input,
34+
aside.ex-input:before {
35+
border: 1px solid #acc;
36+
overflow: auto;
37+
}
38+
aside.ex-input:before {
39+
content: "Example input data";
40+
}
41+
/* RML mapping example */
42+
aside.ex-mapping {
43+
background: #eeb;
44+
}
45+
aside.ex-mapping,
46+
aside.ex-mapping:before {
47+
border: 1px solid #cc9;
48+
overflow: auto;
49+
}
50+
aside.ex-mapping:before {
51+
content: "Example RML mapping";
52+
}
53+
/* Output RDF example */
54+
aside.ex-output {
55+
background: #cfc;
56+
}
57+
aside.ex-output,
58+
aside.ex-output:before {
59+
border: 1px solid #aca;
60+
overflow: auto;
61+
}
62+
aside.ex-output:before {
63+
content: "Example output data";
64+
}
65+
table, th, td {
66+
background: white;
67+
border-collapse: collapse;
68+
border: 1px solid;
69+
}
70+
th, td {
71+
padding: 5px;
72+
text-align: left;
73+
}
74+
th {
75+
font-weight: bold;
76+
}
77+
</style>
78+
<script src = config.js class="remove">
79+
</script>
7680
</head>
7781

7882
<body>

spec/docs/introduction.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Base IRIs
2+
The base IRI of the [=mapping document=] is used to resolve relative IRIs in the RML document following the specification of the Turtle serialisaiton.
23

34
## Base IRI for mapping rules
45

5-
## Base IRI for vocabulary
6+
The [=base IRI=] of the [=Triples Map=] is used in resolving relative IRIs produced by the [=RML mapping=].
7+
8+
9+
<pre class="ex-mapping nohighlight">
10+
# Triples Map that has a declared base IRI
11+
<#TriplesMap>
12+
a rml:TriplesMap;
13+
rml:baseIri <http://example.com/> .
14+
</pre>
15+
16+
The [=base IRI=] MUST be a valid IRI. It SHOULD NOT contain question mark (“?”) or hash (“#”) characters and SHOULD end in a slash (“/”) character.
17+
18+
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:
19+
20+
1. The base IRI does not contain question marks or hashes,
21+
2. the base IRI ends in a slash,
22+
3. the relative IRI does not start with a slash, and
23+
4. the relative IRI does not contain any “.” or “..” path segments.
24+
25+

0 commit comments

Comments
 (0)