You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="copyright"><arel="license" href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br/>This work is licensed under a <arel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>
72
75
</div>
73
76
<hr/>
@@ -111,6 +114,11 @@ <h2>Document history</h2>
111
114
<td>2017-10-25</td>
112
115
<td>Add property xrr:pushDown in logical source and nested term map</td>
113
116
</tr>
117
+
<tr>
118
+
<td>5.1</td>
119
+
<td>2019-06-19</td>
120
+
<td>Add property xrr:languageReference to handle varialbe language tag</td>
121
+
</tr>
114
122
</tbody>
115
123
</table>
116
124
@@ -145,6 +153,7 @@ <h2>Table of Contents</h2>
145
153
3.2.1 <ahref="#_Toc466307463">xR2RML Term Maps</a><br/>
146
154
3.2.1.1 <ahref="#_Toc466307464">Constant-, Column-, Reference- and Template-valued Term Maps</a><br/>
147
155
3.2.1.2 <ahref="#_Toc466307465">Term Types of Term Maps</a><br/>
@@ -1018,8 +1021,67 @@ <h4 id="_Toc466307465">3.2.1.2 Term Types of Term Maps</h4>
1018
1021
</div>
1019
1022
1020
1023
1024
+
1025
+
<h4id="_TocLanguageTags">3.2.1.3 Language Tags</h4>
1026
+
1027
+
<p>Like in R2RML, xR2RML allows assigning language tags to literals. Language tags can be defined statically, but unlike R2RML they can also be defined dynamically using a path expression.</p>
1028
+
1029
+
<divclass="definition">
1030
+
<p>A term map or nested term map with an rr:Literal term type may have a specified language tag.
1031
+
It is represented statically by the <b>rr:language</b> property, or dynamically be the <b>xrr:languageReference</b> property.
1032
+
Both properties cause generated literals to be language-tagged plain literals.</p>
1033
+
1034
+
<p>rr:language and xrr:languageReference are not mutually exclusive.
1035
+
If only rr:language is present, the language tag is that given by the property.
1036
+
If xrr:languageReference is present, the language tag is the result of evaluating the path expression against the document of the current iteration. If the evaluation fails (no language tag is produced), then the language tag is that given by rr:language, if present.</p>
1037
+
1038
+
<p>If the evaluation of the path expression provided by xrr:languageReference fails, and there is no rr:language property, then the RDF term produced is a literal without language tag.</p>
1039
+
</div>
1040
+
1041
+
<p>Example:</p>
1042
+
1043
+
<table>
1044
+
<tbody>
1045
+
<tr>
1046
+
<td>Input data</td>
1047
+
<td><pre>
1048
+
{ "item": [
1049
+
{ "name":"football", "lang":"fr" },
1050
+
{ "name":"calcio", "lang":"it" },
1051
+
{ "name":"soccer" }
1052
+
]}
1053
+
</pre></td>
1054
+
</tr>
1055
+
<tr>
1056
+
<td>Term map</td>
1057
+
<td>The first xrr:reference selects all elements of the "item" array. Then, the nested term map selects each "name" field and assigns it the language tag provided in the "lang" field.
1058
+
<pre>
1059
+
[] rr:objectMap [
1060
+
xrr:reference "$.item.*";
1061
+
xrr:nestedTermMap [
1062
+
xrr:reference "$.name";
1063
+
rr:language "en";
1064
+
xrr:languageReference "$.lang"
1065
+
]
1066
+
];</pre></td>
1067
+
</tr>
1068
+
<tr>
1069
+
<td>Generated RDF terms</td>
1070
+
<td>
1071
+
<pre>
1072
+
"football"@en
1073
+
"calcio"@it
1074
+
"soccer"@en
1075
+
</pre>
1076
+
</td>
1077
+
</tr>
1078
+
1079
+
</tbody>
1080
+
</table>
1081
+
1082
+
1021
1083
1022
-
<h4id="_Toc466307466">3.2.1.3 Nested Term Maps</h4>
1084
+
<h4id="_Toc466307466">3.2.1.4 Nested Term Maps</h4>
1023
1085
1024
1086
<p>Hierarchical data such as JSON or XML documents commonly have more than one level of nesting, resulting in tree-like values that may need to be parsed in depth, e.g. to nest RDF collections and containers (build an RDF collection of RDF collections).</p>
1025
1087
@@ -1044,6 +1106,7 @@ <h4 id="_Toc466307466">3.2.1.3 Nested Term Maps</h4>
1044
1106
<li><b>xrr:pushDown</b> properties if and only if there exists an xrr:nestedTermMap property (see section <ahref="#_Toc496719460">3.2.2.4</a>).</li>
1045
1107
<li><b>rr:termType</b> bears the same semantics as in the context of a term map;</li>
1046
1108
<li><b>rr:language</b> bears the same semantics as defined in R2RML;</li>
1109
+
<li><b>xrr:languageReference</b> bears the semantics as defined in <ahref="#_TocLanguageTags">§3.2.1.3</a>;</li>
1047
1110
<li><b>rr:datatype</b> bears the same semantics as defined in R2RML.</li>
1048
1111
</ul>
1049
1112
<p>A <b>simple nested term map</b> is a nested term map that has no xrr:reference nor rr:template property. A simple nested term map is used to qualify terms of an RDF collection or container generated by its parent term map or nested term map, i.e. assign them an optional term type, data type or language tag.</p>
@@ -1083,10 +1146,10 @@ <h4 id="_Toc466307466">3.2.1.3 Nested Term Maps</h4>
1083
1146
</ul>
1084
1147
</div>
1085
1148
1086
-
<p>Finally, as defined in R2RML, properties rr:language and rr:datatype apply when generating literals only:</p>
1149
+
<p>Finally, properties rr:language, xrr:languageReference and rr:datatype apply when generating literals only:</p>
1087
1150
1088
1151
<divclass="definition">
1089
-
<p>A term map or nested term map may have an rr:language or rr:datatype property only if its term type is rr:Literal (either stated by property rr:termType or inferred as a default value).</p>
1152
+
<p>A term map or nested term map may have an rr:language, xrr:languageReference or rr:datatype property only if its term type is rr:Literal (either stated by property rr:termType or inferred as a default value).</p>
1090
1153
</div>
1091
1154
1092
1155
@@ -1849,9 +1912,9 @@ <h3 id="_Toc466307474">3.2.5 Default Term Types</h3>
1849
1912
<li>rr:Literal, if it is an object map and at least one of the following conditions is true:
1850
1913
<ul>
1851
1914
<li>It is a column-based term map.</li>
1852
-
<li>It has an rr:language property (and thus a specified language tag).</li>
1915
+
<li>It has an rr:language <spanclass="highlight">or xrr:languageReference</span>property (and thus a specified language tag).</li>
1853
1916
<li>It has an rr:datatype property (and thus a specified datatype).</li>
1854
-
<li><spanclass="highlight">It does not have an rr:language property and it has a nested term map that has an rr:language property.</span></li>
1917
+
<li><spanclass="highlight">It does not have an rr:language nor xrr:languageReference property and it has a nested term map that has an rr:language property.</span></li>
1855
1918
<li><spanclass="highlight">It does not have an rr:datatype property and it has a nested term map that has an rr:datatype property.</span></li>
0 commit comments