index.html
352 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>RIF Datatypes and Built-Ins 1.0</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.editsection { display: none; }
</style>
<link href="tr.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/W3C-REC" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="head">
<a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72" /></a><h1 id="title" style="clear:both"><span id="short-title">RIF Datatypes and Built-Ins 1.0</span></h1>
<h2 id="W3C-doctype">W3C Recommendation 22 June 2010</h2>
<!-- no inplace warning -->
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/" id="this-version-url">http://www.w3.org/TR/2010/REC-rif-dtb-20100622/</a></dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/rif-dtb/">http://www.w3.org/TR/rif-dtb/</a></dd>
<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2010/PR-rif-dtb-20100511/">http://www.w3.org/TR/2010/PR-rif-dtb-20100511/</a> (<a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/diff-from-20100511">color-coded diff</a>)</dd>
</dl>
<dl><dt>Editors:</dt><dd>Axel Polleres, DERI</dd>
<dd>Harold Boley, National Research Council Canada</dd>
<dd>Michael Kifer, State University of New York at Stony Brook</dd>
</dl>
<p>Please refer to the <a href="http://www.w3.org/2010/rif/errata"><strong>errata</strong></a> for this document, which may include some normative corrections.</p>
<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/2010/pdf/REC-rif-dtb-20100622.pdf">PDF version</a>.</p>
<p>See also <a href="http://www.w3.org/2010/rif/translation/rif-dtb">translations</a>.</p>
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
</div>
<hr />
<h2><a id="abstract" name="abstract">Abstract</a></h2>
<div>
<div>This document, developed by the <a class="external text" href="http://www.w3.org/2005/rules/wg.html" title="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a>, specifies a list of datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects such as the <a class="external text" href="http://www.w3.org/TR/rif-core/" title="http://www.w3.org/TR/rif-core/">RIF Core Dialect</a>, the <a class="external text" href="http://www.w3.org/TR/rif-bld/" title="http://www.w3.org/TR/rif-bld/">RIF Basic Logic Dialect</a>, and the <a class="external text" href="http://www.w3.org/TR/rif-prd/" title="http://www.w3.org/TR/rif-prd/">RIF Production Rules Dialect</a>. Each dialect supporting a superset or subset of the datatypes, built-in functions and built-in predicates defined here shall specify these additions or restrictions. Some of the datatypes are adapted from [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]. A large part of the definitions of the listed functions and operators are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. The <tt>rdf:PlainLiteral</tt> datatype as well as functions and operators associated with that datatype are adopted from [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].</div>
</div>
<h2 class="no-toc no-num">
<a id="w3c_status" name="w3c_status">Status of this Document</a>
</h2>
<h4 class="no-toc no-num" id="may-be">May Be Superseded</h4>
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
<h4 class="no-toc no-num" id="related">Set of Documents</h4>
<p>This document is being published as one of a set of 11 documents: </p>
<ol>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-overview-20100622/">RIF Overview</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">RIF Core Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">RIF Basic Logic Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">RIF Production Rule Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/">RIF Framework for Logic Dialects</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/">RIF Datatypes and Built-Ins 1.0</a> (this document)</li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/">RIF RDF and OWL Compatibility</a></li>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-owl-rl-20100622/">OWL 2 RL in RIF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/">RIF Combination with XML data</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-in-rdf-20100622/">RIF In RDF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-test-20100622/">RIF Test Cases</a></li>
</ol>
<!-- no eventStatusExtra -->
<!-- no statusExtra -->
<div>
<h4 class="no-toc no-num" id="sotd-xml-dep">XML Schema Datatypes Dependency</h4>
<p>RIF is defined to use datatypes defined in the <a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Definition Language (XSD)</a>. As of this writing, the latest W3C Recommendation for XSD is version 1.0, with <a href="http://www.w3.org/TR/xmlschema11-1/">version 1.1</a> progressing toward Recommendation. RIF has been designed to take advantage of the new datatypes and clearer explanations available in XSD 1.1, but for now those advantages are being partially put on hold. Specifically, until XSD 1.1 becomes a W3C Recommendation, the elements of RIF which are based on it should be considered <em>optional</em>, as detailed in <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#XML_Schema_Datatypes">Datatypes and Builtins, section 2.3</a>. Upon the publication of XSD 1.1 as a W3C Recommendation, those elements will cease to be optional and are to be considered required as otherwise specified.</p>
<p>We suggest that for now developers and users follow the <a href="http://www.w3.org/TR/2009/WD-xmlschema11-1-20091203/">XSD 1.1 Last Call Working Draft</a>. Based on discussions between the Schema, RIF and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation.</p>
</div>
<h4 class="no-toc no-num" id="status-changes">Document Unchanged</h4>
<p>There have been no changes to the body of this document since the <a href="http://www.w3.org/TR/2010/PR-rif-dtb-20100511/">previous version</a>. For details on earlier changes, see the <a href="#changelog">change log</a>.</p>
<h4 class="no-toc no-num" id="please">Please Send Comments</h4><p>Please send any comments to <a class="mailto" href="mailto:public-rif-comments@w3.org">public-rif-comments@w3.org</a>
(<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-comments/">public
archive</a>). Although work on this document by the <a href="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a> is complete, comments may be addressed in the <a href="http://www.w3.org/2010/rif/errata">errata</a> or in future revisions. Open discussion among developers is welcome at <a class="mailto" href="mailto:public-rif-dev@w3.org">public-rif-dev@w3.org</a> (<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-dev/">public archive</a>).</p>
<h4 class="no-toc no-num" id="endorsement">Endorsed By W3C</h4>
<p><em>This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</em></p>
<h4 class="no-toc no-num" id="patents">Patents</h4>
<p><em>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/38457/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent.</em></p>
<hr title="Separator After Status Section" />
<p><br />
</p><p><br />
</p>
<table class="toc" id="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a></li>
<li class="toclevel-1"><a href="#Constants.2C_Symbol_Spaces.2C_and_Datatypes"><span class="tocnumber">2</span> <span class="toctext">Constants, Symbol Spaces, and Datatypes</span></a>
<ul>
<li class="toclevel-2"><a href="#Constants_and_Symbol_Spaces"><span class="tocnumber">2.1</span> <span class="toctext">Constants and Symbol Spaces</span></a></li>
<li class="toclevel-2"><a href="#The_Base_and_Prefix_Directives"><span class="tocnumber">2.2</span> <span class="toctext">The Base and Prefix Directives</span></a>
<ul>
<li class="toclevel-3"><a href="#Symbol_Spaces"><span class="tocnumber">2.2.1</span> <span class="toctext">Symbol Spaces</span></a></li>
<li class="toclevel-3"><a href="#Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax"><span class="tocnumber">2.2.2</span> <span class="toctext">Shortcuts for Constants in RIF's Presentation Syntax</span></a></li>
<li class="toclevel-3"><a href="#Relative_IRIs"><span class="tocnumber">2.2.3</span> <span class="toctext">Relative IRIs</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Datatypes"><span class="tocnumber">2.3</span> <span class="toctext">Datatypes</span></a>
<ul>
<li class="toclevel-3"><a href="#XML_Schema_Datatypes"><span class="tocnumber">2.3.1</span> <span class="toctext">XML Schema Datatypes</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1"><a href="#Syntax_and_Semantics_of_Built-ins"><span class="tocnumber">3</span> <span class="toctext">Syntax and Semantics of Built-ins</span></a>
<ul>
<li class="toclevel-2"><a href="#Syntax__of_Built-ins"><span class="tocnumber">3.1</span> <span class="toctext">Syntax of Built-ins</span></a></li>
<li class="toclevel-2"><a href="#Semantics_of_Built-ins"><span class="tocnumber">3.2</span> <span class="toctext">Semantics of Built-ins</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#List_of_RIF_Built-in_Predicates_and_Functions"><span class="tocnumber">4</span> <span class="toctext">List of RIF Built-in Predicates and Functions</span></a>
<ul>
<li class="toclevel-2"><a href="#Predicates_for_all_Datatypes"><span class="tocnumber">4.1</span> <span class="toctext">Predicates for all Datatypes</span></a>
<ul>
<li class="toclevel-3"><a href="#Comparison_for_Literals"><span class="tocnumber">4.1.1</span> <span class="toctext">Comparison for Literals</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:literal-not-identical"><span class="tocnumber">4.1.1.1</span> <span class="toctext">pred:literal-not-identical</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Guard_Predicates_for_Datatypes"><span class="tocnumber">4.2</span> <span class="toctext">Guard Predicates for Datatypes</span></a></li>
<li class="toclevel-2"><a href="#Negative_Guard_Predicates_for_Datatypes"><span class="tocnumber">4.3</span> <span class="toctext">Negative Guard Predicates for Datatypes</span></a></li>
<li class="toclevel-2"><a href="#Datatype_Conversion_and_Casting"><span class="tocnumber">4.4</span> <span class="toctext">Datatype Conversion and Casting</span></a>
<ul>
<li class="toclevel-3"><a href="#Casting_to_XML_Schema_Datatypes"><span class="tocnumber">4.4.1</span> <span class="toctext">Casting to XML Schema Datatypes</span></a></li>
<li class="toclevel-3"><a href="#Casting_to_rdf:XMLLiteral"><span class="tocnumber">4.4.2</span> <span class="toctext">Casting to rdf:XMLLiteral</span></a></li>
<li class="toclevel-3"><a href="#Casting_to_rdf:PlainLiteral"><span class="tocnumber">4.4.3</span> <span class="toctext">Casting to rdf:PlainLiteral</span></a></li>
<li class="toclevel-3"><a href="#pred:iri-string"><span class="tocnumber">4.4.4</span> <span class="toctext">pred:iri-string</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Numeric_Functions_and_Predicates"><span class="tocnumber">4.5</span> <span class="toctext">Numeric Functions and Predicates</span></a>
<ul>
<li class="toclevel-3"><a href="#Numeric_Functions"><span class="tocnumber">4.5.1</span> <span class="toctext">Numeric Functions</span></a></li>
<li class="toclevel-3"><a href="#Numeric_Predicates"><span class="tocnumber">4.5.2</span> <span class="toctext">Numeric Predicates</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:numeric-equal_.28adapted_from_op:numeric-equal.29"><span class="tocnumber">4.5.2.1</span> <span class="toctext">pred:numeric-equal (adapted from op:numeric-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29"><span class="tocnumber">4.5.2.2</span> <span class="toctext">pred:numeric-less-than (adapted from op:numeric-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29"><span class="tocnumber">4.5.2.3</span> <span class="toctext">pred:numeric-greater-than (adapted from op:numeric-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-not-equal"><span class="tocnumber">4.5.2.4</span> <span class="toctext">pred:numeric-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-less-than-or-equal"><span class="tocnumber">4.5.2.5</span> <span class="toctext">pred:numeric-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-greater-than-or-equal"><span class="tocnumber">4.5.2.6</span> <span class="toctext">pred:numeric-greater-than-or-equal</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Boolean_Values"><span class="tocnumber">4.6</span> <span class="toctext">Functions and Predicates on Boolean Values</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Boolean_Values"><span class="tocnumber">4.6.1</span> <span class="toctext">Functions on Boolean Values</span></a>
<ul>
<li class="toclevel-4"><a href="#func:not__.28adapted_from_fn:not.29"><span class="tocnumber">4.6.1.1</span> <span class="toctext">func:not (adapted from fn:not)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Boolean_Values"><span class="tocnumber">4.6.2</span> <span class="toctext">Predicates on Boolean Values</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:boolean-equal__.28adapted_from_op:boolean-equal.29"><span class="tocnumber">4.6.2.1</span> <span class="toctext">pred:boolean-equal (adapted from op:boolean-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29"><span class="tocnumber">4.6.2.2</span> <span class="toctext">pred:boolean-less-than (adapted from op:boolean-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29"><span class="tocnumber">4.6.2.3</span> <span class="toctext">pred:boolean-greater-than (adapted from op:boolean-greater-than)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Strings"><span class="tocnumber">4.7</span> <span class="toctext">Functions and Predicates on Strings</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Strings"><span class="tocnumber">4.7.1</span> <span class="toctext">Functions on Strings</span></a>
<ul>
<li class="toclevel-4"><a href="#func:compare_.28adapted_from_fn:compare.29"><span class="tocnumber">4.7.1.1</span> <span class="toctext">func:compare (adapted from fn:compare)</span></a></li>
<li class="toclevel-4"><a href="#func:concat_.28adapted_from_fn:concat.29"><span class="tocnumber">4.7.1.2</span> <span class="toctext">func:concat (adapted from fn:concat)</span></a></li>
<li class="toclevel-4"><a href="#func:string-join_.28adapted_from_fn:string-join.29"><span class="tocnumber">4.7.1.3</span> <span class="toctext">func:string-join (adapted from fn:string-join)</span></a></li>
<li class="toclevel-4"><a href="#func:substring_.28adapted_from_fn:substring.29"><span class="tocnumber">4.7.1.4</span> <span class="toctext">func:substring (adapted from fn:substring)</span></a></li>
<li class="toclevel-4"><a href="#func:string-length_.28adapted_from_fn:string-length.29"><span class="tocnumber">4.7.1.5</span> <span class="toctext">func:string-length (adapted from fn:string-length)</span></a></li>
<li class="toclevel-4"><a href="#func:upper-case_.28adapted_from_fn:upper-case.29"><span class="tocnumber">4.7.1.6</span> <span class="toctext">func:upper-case (adapted from fn:upper-case)</span></a></li>
<li class="toclevel-4"><a href="#func:lower-case_.28adapted_from_fn:lower-case.29"><span class="tocnumber">4.7.1.7</span> <span class="toctext">func:lower-case (adapted from fn:lower-case)</span></a></li>
<li class="toclevel-4"><a href="#func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29"><span class="tocnumber">4.7.1.8</span> <span class="toctext">func:encode-for-uri (adapted from fn:encode-for-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29"><span class="tocnumber">4.7.1.9</span> <span class="toctext">func:iri-to-uri (adapted from fn:iri-to-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29"><span class="tocnumber">4.7.1.10</span> <span class="toctext">func:escape-html-uri (adapted from fn:escape-html-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:substring-before_.28adapted_from_fn:substring-before.29"><span class="tocnumber">4.7.1.11</span> <span class="toctext">func:substring-before (adapted from fn:substring-before)</span></a></li>
<li class="toclevel-4"><a href="#func:substring-after_.28adapted_from_fn:substring-after.29"><span class="tocnumber">4.7.1.12</span> <span class="toctext">func:substring-after (adapted from fn:substring-after)</span></a></li>
<li class="toclevel-4"><a href="#func:replace_.28adapted_from_fn:replace.29"><span class="tocnumber">4.7.1.13</span> <span class="toctext">func:replace (adapted from fn:replace)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Strings"><span class="tocnumber">4.7.2</span> <span class="toctext">Predicates on Strings</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:contains_.28adapted_from_fn:contains.29"><span class="tocnumber">4.7.2.1</span> <span class="toctext">pred:contains (adapted from fn:contains)</span></a></li>
<li class="toclevel-4"><a href="#pred:starts-with_.28adapted_from_fn:starts-with.29"><span class="tocnumber">4.7.2.2</span> <span class="toctext">pred:starts-with (adapted from fn:starts-with)</span></a></li>
<li class="toclevel-4"><a href="#pred:ends-with_.28adapted_from_fn:ends-with.29"><span class="tocnumber">4.7.2.3</span> <span class="toctext">pred:ends-with (adapted from fn:ends-with)</span></a></li>
<li class="toclevel-4"><a href="#pred:matches_.28adapted_from_fn:matches.29"><span class="tocnumber">4.7.2.4</span> <span class="toctext">pred:matches (adapted from fn:matches)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8</span> <span class="toctext">Functions and Predicates on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8.1</span> <span class="toctext">Functions on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-4"><a href="#func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29"><span class="tocnumber">4.8.1.1</span> <span class="toctext">func:year-from-dateTime (adapted from fn:year-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29"><span class="tocnumber">4.8.1.2</span> <span class="toctext">func:month-from-dateTime (adapted from fn:month-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29"><span class="tocnumber">4.8.1.3</span> <span class="toctext">func:day-from-dateTime (adapted from fn:day-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29"><span class="tocnumber">4.8.1.4</span> <span class="toctext">func:hours-from-dateTime (adapted from fn:hours-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29"><span class="tocnumber">4.8.1.5</span> <span class="toctext">func:minutes-from-dateTime (adapted from fn:minutes-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29"><span class="tocnumber">4.8.1.6</span> <span class="toctext">func:seconds-from-dateTime (adapted from fn:seconds-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:year-from-date_.28adapted_from_fn:year-from-date.29"><span class="tocnumber">4.8.1.7</span> <span class="toctext">func:year-from-date (adapted from fn:year-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:month-from-date_.28adapted_from_fn:month-from-date.29"><span class="tocnumber">4.8.1.8</span> <span class="toctext">func:month-from-date (adapted from fn:month-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:day-from-date_.28adapted_from_fn:day-from-date.29"><span class="tocnumber">4.8.1.9</span> <span class="toctext">func:day-from-date (adapted from fn:day-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-time_.28adapted_from_fn:hours-from-time.29"><span class="tocnumber">4.8.1.10</span> <span class="toctext">func:hours-from-time (adapted from fn:hours-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29"><span class="tocnumber">4.8.1.11</span> <span class="toctext">func:minutes-from-time (adapted from fn:minutes-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29"><span class="tocnumber">4.8.1.12</span> <span class="toctext">func:seconds-from-time (adapted from fn:seconds-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:years-from-duration_.28adapted_from_fn:years-from-duration.29"><span class="tocnumber">4.8.1.13</span> <span class="toctext">func:years-from-duration (adapted from fn:years-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:months-from-duration_.28adapted_from_fn:months-from-duration.29"><span class="tocnumber">4.8.1.14</span> <span class="toctext">func:months-from-duration (adapted from fn:months-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:days-from-duration_.28adapted_from_fn:days-from-duration.29"><span class="tocnumber">4.8.1.15</span> <span class="toctext">func:days-from-duration (adapted from fn:days-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29"><span class="tocnumber">4.8.1.16</span> <span class="toctext">func:hours-from-duration (adapted from fn:hours-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29"><span class="tocnumber">4.8.1.17</span> <span class="toctext">func:minutes-from-duration (adapted from fn:minutes-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29"><span class="tocnumber">4.8.1.18</span> <span class="toctext">func:seconds-from-duration (adapted from fn:seconds-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29"><span class="tocnumber">4.8.1.19</span> <span class="toctext">func:timezone-from-dateTime (adapted from fn:timezone-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29"><span class="tocnumber">4.8.1.20</span> <span class="toctext">func:timezone-from-date (adapted from fn:timezone-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29"><span class="tocnumber">4.8.1.21</span> <span class="toctext">func:timezone-from-time (adapted from fn:timezone-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29"><span class="tocnumber">4.8.1.22</span> <span class="toctext">func:subtract-dateTimes (adapted from op:subtract-dateTimes)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dates_.28adapted_from_op:subtract-dates.29"><span class="tocnumber">4.8.1.23</span> <span class="toctext">func:subtract-dates (adapted from op:subtract-dates)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-times_.28adapted_from_op:subtract-times.29"><span class="tocnumber">4.8.1.24</span> <span class="toctext">func:subtract-times (adapted from op:subtract-times)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29"><span class="tocnumber">4.8.1.25</span> <span class="toctext">func:add-yearMonthDurations (adapted from op:add-yearMonthDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29"><span class="tocnumber">4.8.1.26</span> <span class="toctext">func:subtract-yearMonthDurations (adapted from op:subtract-yearMonthDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29"><span class="tocnumber">4.8.1.27</span> <span class="toctext">func:multiply-yearMonthDuration (adapted from op:multiply-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29"><span class="tocnumber">4.8.1.28</span> <span class="toctext">func:divide-yearMonthDuration (adapted from op:divide-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29"><span class="tocnumber">4.8.1.29</span> <span class="toctext">func:divide-yearMonthDuration-by-yearMonthDuration (adapted from op:divide-yearMonthDuration-by-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29"><span class="tocnumber">4.8.1.30</span> <span class="toctext">func:add-dayTimeDurations (adapted from op:add-dayTimeDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29"><span class="tocnumber">4.8.1.31</span> <span class="toctext">func:subtract-dayTimeDurations (adapted from op:subtract-dayTimeDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29"><span class="tocnumber">4.8.1.32</span> <span class="toctext">func:multiply-dayTimeDuration (adapted from op:multiply-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29"><span class="tocnumber">4.8.1.33</span> <span class="toctext">func:divide-dayTimeDuration (adapted from op:divide-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29"><span class="tocnumber">4.8.1.34</span> <span class="toctext">func:divide-dayTimeDuration-by-dayTimeDuration (adapted from op:divide-dayTimeDuration-by-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29"><span class="tocnumber">4.8.1.35</span> <span class="toctext">func:add-yearMonthDuration-to-dateTime (adapted from op:add-yearMonthDuration-to-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29"><span class="tocnumber">4.8.1.36</span> <span class="toctext">func:add-yearMonthDuration-to-date (adapted from op:add-yearMonthDuration-to-date)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29"><span class="tocnumber">4.8.1.37</span> <span class="toctext">func:add-dayTimeDuration-to-dateTime (adapted from op:add-dayTimeDuration-to-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29"><span class="tocnumber">4.8.1.38</span> <span class="toctext">func:add-dayTimeDuration-to-date (adapted from op:add-dayTimeDuration-to-date)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29"><span class="tocnumber">4.8.1.39</span> <span class="toctext">func:add-dayTimeDuration-to-time (adapted from op:add-dayTimeDuration-to-time)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29"><span class="tocnumber">4.8.1.40</span> <span class="toctext">func:subtract-yearMonthDuration-from-dateTime (adapted from op:subtract-yearMonthDuration-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29"><span class="tocnumber">4.8.1.41</span> <span class="toctext">func:subtract-yearMonthDuration-from-date (adapted from op:subtract-yearMonthDuration-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29"><span class="tocnumber">4.8.1.42</span> <span class="toctext">func:subtract-dayTimeDuration-from-dateTime (adapted from op:subtract-dayTimeDuration-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29"><span class="tocnumber">4.8.1.43</span> <span class="toctext">func:subtract-dayTimeDuration-from-date (adapted from op:subtract-dayTimeDuration-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29"><span class="tocnumber">4.8.1.44</span> <span class="toctext">func:subtract-dayTimeDuration-from-time (adapted from op:subtract-dayTimeDuration-from-time)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8.2</span> <span class="toctext">Predicates on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29"><span class="tocnumber">4.8.2.1</span> <span class="toctext">pred:dateTime-equal (adapted from op:dateTime-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29"><span class="tocnumber">4.8.2.2</span> <span class="toctext">pred:dateTime-less-than (adapted from op:dateTime-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29"><span class="tocnumber">4.8.2.3</span> <span class="toctext">pred:dateTime-greater-than (adapted from op:dateTime-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-equal_.28adapted_from_op:date-equal.29"><span class="tocnumber">4.8.2.4</span> <span class="toctext">pred:date-equal (adapted from op:date-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-less-than_.28adapted_from_op:date-less-than.29"><span class="tocnumber">4.8.2.5</span> <span class="toctext">pred:date-less-than (adapted from op:date-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-greater-than_.28adapted_from_op:date-greater-than.29"><span class="tocnumber">4.8.2.6</span> <span class="toctext">pred:date-greater-than (adapted from op:date-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-equal_.28adapted_from_op:time-equal.29"><span class="tocnumber">4.8.2.7</span> <span class="toctext">pred:time-equal (adapted from op:time-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-less-than_.28adapted_from_op:time-less-than.29"><span class="tocnumber">4.8.2.8</span> <span class="toctext">pred:time-less-than (adapted from op:time-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-greater-than_.28adapted_from_op:time-greater-than.29"><span class="tocnumber">4.8.2.9</span> <span class="toctext">pred:time-greater-than (adapted from op:time-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:duration-equal_.28adapted_from_op:duration-equal.29"><span class="tocnumber">4.8.2.10</span> <span class="toctext">pred:duration-equal (adapted from op:duration-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29"><span class="tocnumber">4.8.2.11</span> <span class="toctext">pred:dayTimeDuration-less-than (adapted from op:dayTimeDuration-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29"><span class="tocnumber">4.8.2.12</span> <span class="toctext">pred:dayTimeDuration-greater-than (adapted from op:dayTimeDuration-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29"><span class="tocnumber">4.8.2.13</span> <span class="toctext">pred:yearMonthDuration-less-than (adapted from op:yearMonthDuration-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29"><span class="tocnumber">4.8.2.14</span> <span class="toctext">pred:yearMonthDuration-greater-than (adapted from op:yearMonthDuration-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-not-equal"><span class="tocnumber">4.8.2.15</span> <span class="toctext">pred:dateTime-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-less-than-or-equal"><span class="tocnumber">4.8.2.16</span> <span class="toctext">pred:dateTime-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-greater-than-or-equal"><span class="tocnumber">4.8.2.17</span> <span class="toctext">pred:dateTime-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-not-equal"><span class="tocnumber">4.8.2.18</span> <span class="toctext">pred:date-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-less-than-or-equal"><span class="tocnumber">4.8.2.19</span> <span class="toctext">pred:date-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-greater-than-or-equal"><span class="tocnumber">4.8.2.20</span> <span class="toctext">pred:date-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-not-equal"><span class="tocnumber">4.8.2.21</span> <span class="toctext">pred:time-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-less-than-or-equal"><span class="tocnumber">4.8.2.22</span> <span class="toctext">pred:time-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-greater-than-or-equal"><span class="tocnumber">4.8.2.23</span> <span class="toctext">pred:time-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:duration-not-equal"><span class="tocnumber">4.8.2.24</span> <span class="toctext">pred:duration-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-less-than-or-equal"><span class="tocnumber">4.8.2.25</span> <span class="toctext">pred:dayTimeDuration-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-greater-than-or-equal"><span class="tocnumber">4.8.2.26</span> <span class="toctext">pred:dayTimeDuration-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-less-than-or-equal"><span class="tocnumber">4.8.2.27</span> <span class="toctext">pred:yearMonthDuration-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-greater-than-or-equal"><span class="tocnumber">4.8.2.28</span> <span class="toctext">pred:yearMonthDuration-greater-than-or-equal</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_rdf:XMLLiterals"><span class="tocnumber">4.9</span> <span class="toctext">Functions and Predicates on rdf:XMLLiterals</span></a>
<ul>
<li class="toclevel-3"><a href="#pred:XMLLiteral-equal"><span class="tocnumber">4.9.1</span> <span class="toctext">pred:XMLLiteral-equal</span></a></li>
<li class="toclevel-3"><a href="#pred:XMLLiteral-not-equal"><span class="tocnumber">4.9.2</span> <span class="toctext">pred:XMLLiteral-not-equal</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_rdf:PlainLiteral"><span class="tocnumber">4.10</span> <span class="toctext">Functions and Predicates on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_rdf:PlainLiteral"><span class="tocnumber">4.10.1</span> <span class="toctext">Functions on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-4"><a href="#func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29"><span class="tocnumber">4.10.1.1</span> <span class="toctext">func:PlainLiteral-from-string-lang (adapted from plfn:PlainLiteral-from-string-lang)</span></a></li>
<li class="toclevel-4"><a href="#func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29"><span class="tocnumber">4.10.1.2</span> <span class="toctext">func:string-from-PlainLiteral (adapted from plfn:string-from-PlainLiteral)</span></a></li>
<li class="toclevel-4"><a href="#func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29"><span class="tocnumber">4.10.1.3</span> <span class="toctext">func:lang-from-PlainLiteral (adapted from plfn:lang-from-PlainLiteral)</span></a></li>
<li class="toclevel-4"><a href="#func:PlainLiteral-compare_.28adapted_from_plfn:compare.29"><span class="tocnumber">4.10.1.4</span> <span class="toctext">func:PlainLiteral-compare (adapted from plfn:compare)</span></a></li>
<li class="toclevel-4"><a href="#func:PlainLiteral-length_.28adapted_from_plfn:length.29"><span class="tocnumber">4.10.1.5</span> <span class="toctext">func:PlainLiteral-length (adapted from plfn:length)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_rdf:PlainLiteral"><span class="tocnumber">4.10.2</span> <span class="toctext">Predicates on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29"><span class="tocnumber">4.10.2.1</span> <span class="toctext">pred:matches-language-range (adapted from plfn:matches-language-range)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_RIF_Lists"><span class="tocnumber">4.11</span> <span class="toctext">Functions and Predicates on RIF Lists</span></a>
<ul>
<li class="toclevel-3"><a href="#Position_Numbering"><span class="tocnumber">4.11.1</span> <span class="toctext">Position Numbering</span></a></li>
<li class="toclevel-3"><a href="#Item_Comparison"><span class="tocnumber">4.11.2</span> <span class="toctext">Item Comparison</span></a></li>
<li class="toclevel-3"><a href="#Predicates_on_RIF_Lists"><span class="tocnumber">4.11.3</span> <span class="toctext">Predicates on RIF Lists</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:is-list"><span class="tocnumber">4.11.3.1</span> <span class="toctext">pred:is-list</span></a></li>
<li class="toclevel-4"><a href="#pred:list-contains"><span class="tocnumber">4.11.3.2</span> <span class="toctext">pred:list-contains</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Functions_on_RIF_Lists"><span class="tocnumber">4.11.4</span> <span class="toctext">Functions on RIF Lists</span></a>
<ul>
<li class="toclevel-4"><a href="#func:make-list"><span class="tocnumber">4.11.4.1</span> <span class="toctext">func:make-list</span></a></li>
<li class="toclevel-4"><a href="#func:count_.28adapted_from_fn:count.29"><span class="tocnumber">4.11.4.2</span> <span class="toctext">func:count (adapted from fn:count)</span></a></li>
<li class="toclevel-4"><a href="#func:get"><span class="tocnumber">4.11.4.3</span> <span class="toctext">func:get</span></a></li>
<li class="toclevel-4"><a href="#func:sublist_.28adapted_from_fn:subsequence.29"><span class="tocnumber">4.11.4.4</span> <span class="toctext">func:sublist (adapted from fn:subsequence)</span></a></li>
<li class="toclevel-4"><a href="#func:append"><span class="tocnumber">4.11.4.5</span> <span class="toctext">func:append</span></a></li>
<li class="toclevel-4"><a href="#func:concatenate_.28adapted_from_fn:concatenate.29"><span class="tocnumber">4.11.4.6</span> <span class="toctext">func:concatenate (adapted from fn:concatenate)</span></a></li>
<li class="toclevel-4"><a href="#func:insert-before_.28adapted_from_fn:insert-before.29"><span class="tocnumber">4.11.4.7</span> <span class="toctext">func:insert-before (adapted from fn:insert-before)</span></a></li>
<li class="toclevel-4"><a href="#func:remove_.28adapted_from_fn:remove.29"><span class="tocnumber">4.11.4.8</span> <span class="toctext">func:remove (adapted from fn:remove)</span></a></li>
<li class="toclevel-4"><a href="#func:reverse_.28adapted_from_fn:reverse.29"><span class="tocnumber">4.11.4.9</span> <span class="toctext">func:reverse (adapted from fn:reverse)</span></a></li>
<li class="toclevel-4"><a href="#func:index-of_.28adapted_from_fn:index-of.29"><span class="tocnumber">4.11.4.10</span> <span class="toctext">func:index-of (adapted from fn:index-of)</span></a></li>
<li class="toclevel-4"><a href="#func:union_.28inspired_by_fn:union.29"><span class="tocnumber">4.11.4.11</span> <span class="toctext">func:union (inspired by fn:union)</span></a></li>
<li class="toclevel-4"><a href="#func:distinct-values_.28adapted_from_fn:distinct-values.29"><span class="tocnumber">4.11.4.12</span> <span class="toctext">func:distinct-values (adapted from fn:distinct-values)</span></a></li>
<li class="toclevel-4"><a href="#func:intersect_.28inspired_by_fn:intersect.29"><span class="tocnumber">4.11.4.13</span> <span class="toctext">func:intersect (inspired by fn:intersect)</span></a></li>
<li class="toclevel-4"><a href="#func:except_.28inspired_by_fn:except.29"><span class="tocnumber">4.11.4.14</span> <span class="toctext">func:except (inspired by fn:except)</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1"><a href="#References"><span class="tocnumber">5</span> <span class="toctext">References</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Schemas_for_Externally_Defined_Terms"><span class="tocnumber">6</span> <span class="toctext">Appendix: Schemas for Externally Defined Terms</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010"><span class="tocnumber">7</span> <span class="toctext">Appendix: Changes from Candidate Recommendation Version of October 1, 2010</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a id="Overview" name="Overview"></a><h1> <span class="mw-headline">1 Overview </span></h1>
<p><span class="anchor" id="sec-overview"></span> This specification develops <i><b>RIF-DTB</b></i> (<b>D</b>ata<b>t</b>ypes and <b>B</b>uilt-Ins of the <b>R</b>ule <b>I</b>nterchange <b>F</b>ormat). It lists the datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects such as the <a class="external text" href="http://www.w3.org/TR/rif-core/" title="http://www.w3.org/TR/rif-core/">RIF Core Dialect</a>, the <a class="external text" href="http://www.w3.org/TR/rif-bld/" title="http://www.w3.org/TR/rif-bld/">RIF Basic Logic Dialect</a>, and the <a class="external text" href="http://www.w3.org/TR/rif-prd/" title="http://www.w3.org/TR/rif-prd/">RIF Production Rules Dialect</a>.
</p><p>Some of the datatypes are adapted from [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]. A large part of the definitions of the listed functions and operators are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. The <tt>rdf:PlainLiteral</tt> datatype as well as functions and operators associated with that datatype are adopted from [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>]. Unlike the earlier SWRL built-ins [<a href="#ref-swrl" title="">SWRL</a>], which write n-ary functions as (1+n)-ary relations, functional RIF-DTB built-ins remain functions.
</p><p>Currently in 1.0, RIF-DTB can also help in the interoperation of RIF with other (Semantic) Web formalisms by providing a general infrastructure of datatypes and built-ins.
</p>
<a id="Constants.2C_Symbol_Spaces.2C_and_Datatypes" name="Constants.2C_Symbol_Spaces.2C_and_Datatypes"></a><h1> <span class="mw-headline">2 <span class="anchor" id="sec-constants"> Constants, Symbol Spaces, and Datatypes </span> </span></h1>
<a id="Constants_and_Symbol_Spaces" name="Constants_and_Symbol_Spaces"></a><h2> <span class="mw-headline">2.1 <span class="anchor" id="sec-symbol-spaces">Constants and Symbol Spaces</span> </span></h2>
<p>Each constant (that is, each non-keyword symbol) in RIF belongs to a particular symbol space. A constant in a particular RIF symbol space has the following presentation syntax:
</p>
<p><tt>"<i>literal</i>"^^<<i>symbolSpaceIri</i>></tt></p>
<p>where <tt><i>literal</i></tt> is called the <i><b>lexical part</b></i> of the symbol, and <tt><i>symbolSpaceIri</i></tt> is the (absolute or relative) IRI identifying the <i><b>symbol space</b></i>. Here <tt>literal</tt> is a Unicode string that must be an element in the lexical space of the symbol space identified by the IRI <i>symbolSpaceIri</i>.
</p>
<a id="The_Base_and_Prefix_Directives" name="The_Base_and_Prefix_Directives"></a><h2> <span class="mw-headline">2.2 <span class="anchor" id="sec-base">The Base and Prefix Directives</span> </span></h2>
<p>Since IRIs typically require long strings of characters, many Web languages have special provisions for abbreviating these strings. One well-known technique is called <i>compact URI</i> [<a href="#ref-curie" title="">CURIE</a>], and RIF uses a similar technique by allowing RIF documents to have the directives <tt>Base</tt> and <tt>Prefix</tt>.
</p>
<ul>
<li>
A <i><b>base directive</b></i> has the form <tt>Base(<iri>)</tt>, where <tt>iri</tt> is a Unicode string in the form of an <i><b>absolute</b></i> IRI [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
<p>
The <tt>Base</tt> directive defines a syntactic shortcut for expanding
relative IRIs into full IRIs.
</p>
</li>
<li>
A <i><b>prefix directive</b></i> has the form <tt>Prefix(p <v>)</tt>, where <tt>p</tt> is called a <i><b>prefix</b></i> and <tt>v</tt> is its <i><b>expansion</b></i>.
The prefix p is an alphanumeric string and the expansion v is a string that forms an IRI.
(An alphanumeric string is a sequence of ASCII characters, where each character is a letter, a digit, or an underscore "_", and the first character is a letter.)
<p>
The basic idea is that in certain contexts prefixes can be used instead of their much longer expansions, and this provides for a much more concise and simple notation.
</p>
</li>
</ul>
<p>
The precise way in which these directives work is explained in Section <a href="#sec-shortcuts-constants" title="">Shortcuts for Constants in RIF's Presentation Syntax</a>.
</p>
<p>To avoid writing down long IRIs, this document will
assume that the following <tt>Prefix</tt> directives have been specified in all the RIF documents under consideration:
</p>
<ul><li> <tt>Prefix( xs <http://www.w3.org/2001/XMLSchema#> )</tt>. This prefix stands for the XML Schema namespace URI.
</li><li> <tt>Prefix( rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#> )</tt>. This prefix stands for the RDF URI.
</li><li> <tt>Prefix( rif <http://www.w3.org/2007/rif#> )</tt>. The <tt>rif</tt> prefix stands for the RIF URI.
</li><li> <tt>Prefix( func <http://www.w3.org/2007/rif-builtin-function#> )</tt>. This prefix expands into a URI used for RIF builtin functions.
</li><li> <tt>Prefix( pred <http://www.w3.org/2007/rif-builtin-predicate#> )</tt>. This is the prefix used for RIF builtin predicates.
</li></ul>
<p>Using these prefixes and the shorthand mechanism defined in Section <a href="#sec-shortcuts-constants" title="">Shortcuts for Constants in RIF's Presentation Syntax</a>, we can, for example, abbreviate a
constant such as <tt>"http://www.example.org"^^<http://www.w3.org/2007/rif#iri></tt> into <tt>"http://www.example.org"^^rif:iri</tt>.
</p>
<a id="Symbol_Spaces" name="Symbol_Spaces"></a><h3> <span class="mw-headline">2.2.1 Symbol Spaces </span></h3>
<p>Formally, we define symbol spaces as follows.
</p><p><span class="anchor" id="def-symspace"></span>
<b>Definition (Symbol space).</b>
A <i><b>symbol space</b></i> is a named subset of the set of all constants, <tt>Const</tt> in RIF. Each symbol in <tt>Const</tt> belongs to exactly one symbol space.
</p><p>Each symbol space has an associated lexical space, a unique IRI identifying it and a short name. More precisely,
</p>
<ul><li> <span class="anchor" id="def-lexical-space"></span> The <i><b>lexical space</b></i> of a symbol space is a non-empty set of Unicode character strings.
</li><li> <span class="anchor" id="def-symspace-identifier"></span> The <i><b>identifier</b></i> of a symbol space is a sequence of Unicode characters that form an absolute IRI.
</li><li> Different symbol spaces supported by a dialect cannot share the same identifier or short name.
</li></ul>
<p>The identifiers of symbol spaces are <b>not</b> themselves constant symbols in RIF.
</p>
<p>
For convenience we will often use symbol space identifiers to refer to the actual symbol spaces (for instance, we may use "symbol space <tt>xs:string</tt>" instead of "symbol space <i>identified by</i> <tt>xs:string</tt>").
</p>
<p>RIF dialects are expected to include the symbol spaces listed in the following. However, rule sets that are exchanged through RIF can use additional symbol spaces.
</p>
<p><span class="anchor" id="def-shortname"></span>
</p>
<p>In the following list we introduce <i><b>short name</b></i>s for some of the symbol spaces. Short names are <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCNames</a>, typically the character sequence after the last '/' or '#' in the symbol space IRI (similar to the <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-LocalPart" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-LocalPart">XML local name</a> part of a <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-QName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-QName">QName</a>). Short names are used for the predicates in Sections <a href="#Guard_Predicates_for_Datatypes" title="">Guard Predicates for Datatypes</a> and <a href="#Negative_Guard_Predicates_for_Datatypes" title="">Negative Guard Predicates for Datatypes</a> below.
</p>
<ul>
<li><tt>xs:anyURI</tt> (<tt>http://www.w3.org/2001/XMLSchema#anyURI</tt>), short name: <tt>anyURI</tt></li>
<li><tt>xs:base64Binary</tt> (<tt>http://www.w3.org/2001/XMLSchema#base64Binary</tt>), short name: <tt>base64Binary</tt></li>
<li><tt>xs:boolean</tt> (<tt>http://www.w3.org/2001/XMLSchema#boolean</tt>), short name: <tt>boolean</tt></li>
<li><tt>xs:date</tt> (<tt>http://www.w3.org/2001/XMLSchema#date</tt>), short name: <tt>date</tt></li>
<li><tt>xs:dateTime</tt> (<tt>http://www.w3.org/2001/XMLSchema#dateTime</tt>), short name: <tt>dateTime</tt></li>
<li><tt>xs:dateTimeStamp</tt> (<tt>http://www.w3.org/2001/XMLSchema#dateTimeStamp</tt>), short name: <tt>dateTimeStamp</tt></li>
<li><tt>xs:double</tt> (<tt>http://www.w3.org/2001/XMLSchema#double</tt>), short name: <tt>double</tt></li>
<li><tt>xs:float</tt> (<tt>http://www.w3.org/2001/XMLSchema#float</tt>), short name: <tt>float</tt></li>
<li><tt>xs:hexBinary</tt> (<tt>http://www.w3.org/2001/XMLSchema#hexBinary</tt>), short name: <tt>hexBinary</tt></li>
<li><tt>xs:decimal</tt> (<tt>http://www.w3.org/2001/XMLSchema#decimal</tt>), short name: <tt>decimal</tt></li>
<li><span class="anchor" id="xs-integer-space"><tt>xs:integer</tt></span> (<tt>http://www.w3.org/2001/XMLSchema#integer</tt>), short name: <tt>integer</tt></li>
<li><tt>xs:long</tt> (<tt>http://www.w3.org/2001/XMLSchema#long</tt>), short name: <tt>long</tt></li>
<li><tt>xs:int</tt> (<tt>http://www.w3.org/2001/XMLSchema#int</tt>), short name: <tt>int</tt></li>
<li><tt>xs:short</tt> (<tt>http://www.w3.org/2001/XMLSchema#short</tt>), short name: <tt>short</tt></li>
<li><tt>xs:byte</tt> (<tt>http://www.w3.org/2001/XMLSchema#byte</tt>), short name:<tt>byte</tt></li>
<li><tt>xs:nonNegativeInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</tt>), short name: <tt>nonNegativeInteger</tt></li>
<li><tt>xs:positiveInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#positiveInteger</tt>), short name: <tt>positiveInteger</tt></li>
<li><tt>xs:unsignedLong</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedLong</tt>), short name: <tt>unsignedLong</tt></li>
<li><tt>xs:unsignedInt</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedInt</tt>), short name: <tt>unsignedInt</tt></li>
<li><tt>xs:unsignedShort</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedShort</tt>), short name: <tt>unsignedShort</tt></li>
<li><tt>xs:unsignedByte</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedByte</tt>), short name: <tt>unsignedByte</tt></li>
<li><tt>xs:nonPositiveInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#nonPositiveInteger</tt>), short name: <tt>nonPositiveInteger</tt></li>
<li><tt>xs:negativeInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#negativeInteger</tt>), short name: <tt>negativeInteger</tt></li>
<li><span class="anchor" id="xs-string-space"><tt>xs:string</tt></span> (<tt>http://www.w3.org/2001/XMLSchema#string</tt>), short name: <tt>string</tt></li>
<li><tt>xs:normalizedString</tt> (<tt>http://www.w3.org/2001/XMLSchema#normalizedString</tt>), short name: <tt>normalizedString</tt></li>
<li><tt>xs:token</tt> (<tt>http://www.w3.org/2001/XMLSchema#token</tt>), short name: <tt>token</tt></li>
<li><tt>xs:language</tt> (<tt>http://www.w3.org/2001/XMLSchema#language</tt>), short name: <tt>language</tt></li>
<li><tt>xs:Name</tt> (<tt>http://www.w3.org/2001/XMLSchema#Name</tt>), short name: <tt>Name</tt></li>
<li><tt>xs:NCName</tt> (<tt>http://www.w3.org/2001/XMLSchema#NCName</tt>), short name: <tt>NCName</tt></li>
<li><tt>xs:NMTOKEN</tt> (<tt>http://www.w3.org/2001/XMLSchema#NMTOKEN</tt>), short name: <tt>NMTOKEN</tt></li>
<li><tt>xs:time</tt> (<tt>http://www.w3.org/2001/XMLSchema#time</tt>), short name: <tt>time</tt></li>
</ul>
<p>The lexical spaces of the above symbol spaces are defined in the document [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].</p>
<ul>
<li><tt>xs:dayTimeDuration</tt> (<tt>http://www.w3.org/2001/XMLSchema#dayTimeDuration</tt>), short name: <tt>dayTimeDuration</tt></li>
<li><tt>xs:yearMonthDuration</tt> (<tt>http://www.w3.org/2001/XMLSchema#yearMonthDuration</tt>), short name: <tt>yearMonthDuration</tt></li>
</ul>
<p>These two symbol spaces represent two subtypes of the XML Schema datatype <tt>xs:duration</tt>. The lexical spaces of the above symbol spaces are defined in the document [<a href="#ref-xdm" title="">XDM</a>].</p>
<ul>
<li><span class="anchor" id="rdf-PlainLiteral-space"><tt>rdf:PlainLiteral</tt></span> (<tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#text</tt>), short name: <tt>text</tt>.</li>
</ul>
<p>The <tt>rdf:PlainLiteral</tt> symbol space represents text strings with a language tag attached. The lexical space of <tt>rdf:PlainLiteral</tt> is defined in the document [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].</p>
<ul>
<li><span id="rif-xmlliteral-space"><span class="anchor" id="rdf-xmlliteral-space"><tt>rdf:XMLLiteral</tt></span></span> (<tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral</tt>), short name: <tt>XMLLiteral</tt>.
</li>
</ul>
<p>The <tt>rdf:XMLLiteral</tt> symbol space represents XML content. The lexical space of <tt>rdf:XMLLiteral</tt> is defined in the document [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>].</p>
<ul>
<li><span class="anchor" id="rif-iri-space"><tt>rif:iri</tt></span> (<tt>http://www.w3.org/2007/rif#iri</tt>), for <i><b>internationalized resource identifiers</b></i> or <i><b>IRI</b></i>s.
</li>
</ul>
<p>Constants in the <tt>rif:iri</tt> symbol space are intended to be used in a way similar to RDF resources [<a href="#ref-rdf-schema" title="">RDF-SCHEMA</a>]. The lexical space consists of all absolute IRIs as specified in [<a href="#ref-rfc-3987" title="">RFC-3987</a>]; it is unrelated to the XML primitive type <tt>xs:anyURI</tt>.</p>
<ul>
<li><span class="anchor" id="rif-local-space"><tt>rif:local</tt></span> (<tt>http://www.w3.org/2007/rif#local</tt>), for constant symbols that are not visible outside of the RIF document in which they occur.</li>
</ul>
<p>Constants in the <tt>rif:local</tt> symbol space are local to the RIF documents in which they occur. This means that occurrences of the same <tt>rif:local</tt> constant in different documents are viewed as unrelated distinct constants, but occurrences of the same <tt>rif:local</tt> constant in the same document must refer to the same object. The lexical space of <tt>rif:local</tt> is the same as the lexical space of <tt>xs:string</tt>.</p>
<p><br />
</p>
<p>Note that, by the associated lexical space, not all Unicode strings are syntactically valid lexical parts for all symbol spaces. That is, for instance, <tt>"1.2"^^xs:decimal</tt> and <tt>"1"^^xs:integer</tt> are syntactically valid constant because 1.2 and 1 are members of the lexical space of symbol spaces <tt>xs:decimal</tt> and <tt>xs:integer</tt>, respectively. On the other hand, <tt>"a+2"^^xs:decimal</tt> is not a syntactically valid constant, since <tt>a+2</tt> is not part of the lexical space of <tt>xs:decimal</tt>.</p>
<p>We will often refer to constant symbols that come from a particular symbol space, <tt>X</tt>, as <tt>X</tt> <i><b>constants</b></i>, where <tt>X</tt> is the (short) name of the respective symbol space. For instance, the constants in the symbol space <tt>rif:iri</tt> will be referred to as <i><b>IRI constants</b></i> or <tt>rif:iri</tt> <i><b>constants</b></i> and the constants found in the symbol space <tt>rif:local</tt> as <i><b>local constants</b></i>
or <tt>rif:local</tt> <i><b>constants</b></i>.</p>
<a id="Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax" name="Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax"></a><h3> <span class="mw-headline">2.2.2 <span class="anchor" id="sec-shortcuts-constants">Shortcuts for Constants in RIF's Presentation Syntax</span> </span></h3>
<p>Besides the basic notion
</p>
<p><tt>"<i>literal</i>"^^<<i>identifier</i>></tt></p>
<p>RIF's presentation syntax introduces several shortcuts for particular symbol spaces, in order to make the presentation syntax more readable. RIF's presentation syntax for constants is defined by the following EBNF.
</p>
<pre> ANGLEBRACKIRI ::= <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF" title="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF">IRI_REF</a>
SYMSPACE ::= ANGLEBRACKIRI | CURIE
CURIE ::= <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN">PNAME_LN</a> | <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS">PNAME_NS</a>
Const ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
CONSTSHORT ::= ANGLEBRACKIRI // <i><b>shortcut for</b></i> "..."^^rif:iri
| CURIE // <i><b>shortcut for</b></i> "..."^^rif:iri
| '"' UNICODESTRING '"' // <i><b>shortcut for</b></i> "..."^^xs:string
| <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">NumericLiteral</a> // <i><b>shortcut for</b></i> "..."^^xs:integer,xs:decimal,xs:double
| '_' <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a> // <i><b>shortcut for</b></i> "..."^^rif:local
| '"' UNICODESTRING '"' '@' <a class="external text" href="http://tools.ietf.org/html/bcp47#section-2.1" title="http://tools.ietf.org/html/bcp47#section-2.1">langtag</a> // <i><b>shortcut for</b></i> "...@..."^^rdf:PlainLiteral
</pre>
<p>The EBNF grammar relies on reuse of nonterminals defined in the following grammar productions from other documents:
</p>
<ul>
<li><tt>IRI_REF</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF" title="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF">http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF</a></li>
<li><tt>PNAME_LN</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN">http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN</a></li>
<li><tt>PNAME_NS</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS">http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS</a></li>
<li><tt>NumericLiteral</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral</a></li>
<li><tt>NCName</tt>, cf. <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName</a></li>
<li><tt>UNICODESTRING</tt>, any Unicode string where quotes are escaped and additionally all the other escape sequences defined in <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes" title="http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes">http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes</a> and <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#codepointEscape" title="http://www.w3.org/TR/rdf-sparql-query/#codepointEscape">http://www.w3.org/TR/rdf-sparql-query/#codepointEscape</a> are allowed.</li>
<li><tt>langtag</tt>, cf. [<a href="#ref-bcp-47" title="">BCP-47</a>]</li>
</ul>
<p>In this grammar, <tt>CURIE</tt> stands for <i>compact IRIs</i> [<a href="#ref-curie" title="">CURIE</a>], which
are used to abbreviate symbol space IRIs. For instance, one can write <tt>"http://www.example.org"^^rif:iri</tt> instead of <tt>"http://www.example.org"^^<http://www.w3.org/2007/rif#iri></tt>, where <tt>rif</tt> is a prefix defined in Section <a href="#sec-base" title="">Base and Prefix Directives</a>.
</p>
<p>Apart from compact IRIs, there exist convenient shortcut notations for constants in specific symbol spaces, namely for constants in the symbol spaces <tt>rif:iri</tt>, <tt>xs:string</tt>, <tt>xs:integer</tt>, <tt>xs:decimal</tt>, <tt>xs:double</tt>, and <tt>rif:local</tt>:</p>
<ul>
<li>
<p>Constants in the the symbol space <tt>rif:iri</tt> can be abbreviated in two ways, either by simply using an absolute or relative IRI enclosed in angle brackets, or by writing a compact IRI. The symbol space identifier is dropped in both of these alternatives. For instance, <tt><http://www.example.org/xyz></tt> is a valid abbreviation for <tt>"http://www.example.org/xyz"^^rif:iri</tt>, and <tt>ex:xyz</tt> is a valid abbreviation for this constant, if the directive</p>
<p>
<tt>Prefix(ex <http://www.example.org/> )</tt>
</p>
<p>is present in the RIF document in question.</p>
</li>
<li>
Constants in the symbol space <tt>xs:string</tt> can be abbreviated by simply using quoted strings, i.e. <tt>"My String!"</tt> is a valid abbreviation for the constant <tt>"My String!"^^xs:string</tt> (which in turn is itself an abbreviation for <tt>"My String!"^^<http://www.w3.org/2001/XMLSchema#string></tt>).
</li>
<li>Numeric constants can be abbreviated using the grammar rules for <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">NumericLiteral</a>s from the [<a href="#ref-sparql" title="">SPARQL</a>] grammar: Integers can be written directly (without quotation marks and explicit symbol space identifier) and are interpreted as constants in the symbol space <tt>xs:integer</tt>; decimal numbers for which there is '.' in the number but no exponent are interpreted as constants in the symbol space <tt>xs:decimal</tt>; and numbers with exponents are interpreted as <tt>xs:double</tt>. For instance, one could use <tt>1.2</tt> and <tt>1</tt> as shortcuts for <tt>"1.2"^^xs:decimal</tt> and <tt>"1"^^xs:integer</tt>, respectively. However, there is no shortcut for <tt>"1"^^xs:decimal</tt>.
</li>
<li>The shortcut notation for <tt>rif:local</tt> applies to only a subset of the lexical space of syntactically valid lexical parts of constants in this symbol space: We allow "_"-prefixed Unicode strings which are also valid XML <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a>s as defined in [<a href="#ref-xml-ns" title="">XML-NS</a>]. For other constants in the <tt>rif:local</tt> symbol space one has to use the long notation.
That is, for instance, <tt>_myLocalConstant</tt> is a valid abbreviation for the constant <tt>"myLocalConstant"^^rif:local</tt>, whereas <tt>"http://www.example.org"^^rif:local</tt> cannot be abbreviated.
</li>
</ul>
<a id="Relative_IRIs" name="Relative_IRIs"></a><h3> <span class="mw-headline">2.2.3 Relative IRIs </span></h3>
<p>
Relative IRIs in RIF documents are resolved with respect to the <i><b>base IRI</b></i>. Relative IRIs are combined with base IRIs as per <a class="external text" href="http://www.ietf.org/rfc/rfc3986.txt" title="http://www.ietf.org/rfc/rfc3986.txt">Uniform Resource Identifier (URI): Generic Syntax</a> [<a href="#ref-rfc-3986" title="">RFC-3986</a>] using only the basic algorithm in Section 5.2. Neither Syntax-Based Normalization nor Scheme-Based Normalization (described in Sections 6.2.2 and 6.2.3 of RFC-3986) are performed. Characters additionally allowed in IRI references are treated in the same way that unreserved characters are treated in URI references, per Section 6.5 of <a class="external text" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource Identifiers (IRIs)</a> [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
</p>
<p>
Base IRIs are specified using the <tt>Base</tt> directive described in Section <a href="#sec-base" title="">Base and Prefix Directives</a>. At most one base directive per document is allowed. In the XML syntax, base IRIs are specified using the attribute <tt>xml:base</tt>.
</p>
<p>
For instance, the constant <./xyz> or "./xyz"^^rif:iri are both valid abbreviations in RIF for the constant <tt>http://www.example.org/xyz"^^rif:iri</tt>, if the following directive is present in the document:
</p>
<p>
<tt>Base(<http://www.example.org>)</tt>
</p>
<a id="Datatypes" name="Datatypes"></a><h2> <span class="mw-headline">2.3 <span class="anchor" id="sec-data-types">Datatypes</span> </span></h2>
<p>Datatypes in RIF are symbol spaces which have special semantics. That is, each datatype is characterized by a fixed lexical space, value space and lexical-to-value-mapping.
</p><p><span class="anchor" id="def-datatype"></span>
<b>Definition (Datatype).</b>
A <i><b>datatype</b></i> is a symbol space that has
</p>
<ul><li> an associated set, called the <i><b>value space</b></i>, and
</li><li> a mapping from the lexical space of the symbol space to the value space, called <i><b>lexical-to-value-space mapping</b></i>. ☐
</li></ul>
<p>Semantic structures are always defined with respect to a particular set of datatypes, denoted by <i><b>DTS</b></i>. In a concrete dialect, <i><b>DTS</b></i> always includes the datatypes supported by that dialect. <span class="anchor" id="def-required-datatypes">RIF dialects are expected to support the following datatypes. However, RIF dialects may include additional datatypes. Subitems in the following lists indicate <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#derivation" title="http://www.w3.org/TR/xmlschema11-2/#derivation">derived</a> datatypes.</span>
</p>
<ul><li> <tt>xs:anyURI</tt>
</li><li> <tt>xs:base64Binary</tt>
</li><li> <tt>xs:boolean</tt>
</li><li> <tt>xs:date</tt>
</li><li> <tt>xs:dateTime</tt>
<ul><li> <tt>xs:dateTimeStamp</tt>
</li></ul>
</li><li> <tt>xs:double</tt>
</li><li> <tt>xs:float</tt>
</li><li> <tt>xs:hexBinary</tt>
</li><li> <tt>xs:decimal</tt>
<ul><li> <tt>xs:integer</tt>
<ul><li> <tt>xs:long</tt>
<ul><li> <tt>xs:int</tt>
<ul><li> <tt>xs:short</tt>
<ul><li> <tt>xs:byte</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:nonNegativeInteger</tt>
<ul><li> <tt>xs:positiveInteger</tt>
</li><li> <tt>xs:unsignedLong</tt>
<ul><li> <tt>xs:unsignedInt</tt>
<ul><li> <tt>xs:unsignedShort</tt>
<ul><li> <tt>xs:unsignedByte</tt>
</li></ul>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:nonPositiveInteger</tt>
<ul><li> <tt>xs:negativeInteger</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:string</tt>
<ul><li> <tt>xs:normalizedString</tt>
<ul><li> <tt>xs:token</tt>
<ul><li> <tt>xs:language</tt>
</li><li> <tt>xs:Name</tt>
<ul><li> <tt>xs:NCName</tt>
</li></ul>
</li><li> <tt>xs:NMTOKEN</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:time</tt>
</li><li> <tt>xs:dayTimeDuration</tt>
</li><li> <tt>xs:yearMonthDuration</tt>
</li><li> <tt>rdf:PlainLiteral</tt>
</li><li> <tt>rdf:XMLLiteral</tt>
</li></ul>
<p>Their value spaces and the lexical-to-value-space mappings are defined as follows:
</p>
<ul><li> For the XML Schema datatypes of RIF, namely all RIF datatypes within the <tt>xs:</tt> namespace, except <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt>, the value spaces and the lexical-to-value-space mappings are defined in the XML Schema specification [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</li><li> The value spaces and the lexical-to-value-space mappings for the datatypes <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt> are defined in the XQuery 1.0 and XPath 2.0 Data Model [<a href="#ref-xdm" title="">XDM</a>].
</li><li> The value space and the lexical-to-value-space mapping for <tt>rdf:PlainLiteral</tt> are defined in the document [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].
</li><li> The value space and lexical-to-value-space mapping for the datatype <tt>rdf:XMLLiteral</tt> is defined in RDF [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>].
</li></ul>
<a id="XML_Schema_Datatypes" name="XML_Schema_Datatypes"></a><h3> <span class="mw-headline">2.3.1 XML Schema Datatypes </span></h3>
<p>As of the publication of this document, XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] is not yet a W3C Recommendation. Both the RIF Working Group and the XML Schema Working Group are confident that there will be only minor changes before it becomes a W3C Recommendation. In order to take advantage of the anticipated corrections and new features sooner, while also providing stability in case the specification does not advance as expected, conformance to RIF as it relates to XML Schema Datatypes is defined as follows:
</p>
<ul><li> If [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] becomes a W3C Recommendation, all references in RIF to XML Schema Datatype features will be normative references to the 1.1 Recommendation.
</li><li> Until that time, references in RIF to XML Schema Datatype features operate as follows:
<ul><li> If <a class="external text" href="http://www.w3.org/TR/xmlschema-2/" title="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2: Datatypes Second Edition</a> (XSD 1.0) defines the features, then the reference is normative to the 1.0 definition;
</li><li> otherwise, the feature is optional in RIF and the reference is informative only.
</li></ul>
</li></ul>
<p>This "change in normative reference" is effective as of the publication of XSD 1.1 as a W3C Recommendation. However, W3C expects to publish a new edition of RIF Datatypes and Built-Ins 1.0 once XSD 1.1 becomes a Recommendation to update the reference explicitly.
</p>
<a id="Syntax_and_Semantics_of_Built-ins" name="Syntax_and_Semantics_of_Built-ins"></a><h1> <span class="mw-headline">3 Syntax and Semantics of Built-ins </span></h1>
<a id="Syntax__of_Built-ins" name="Syntax__of_Built-ins"></a><h2> <span class="mw-headline">3.1 Syntax of Built-ins </span></h2>
<p>A RIF built-in function or predicate is a special case of externally defined terms, which are defined in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-terms" title="FLD">RIF Framework for Logic Dialects</a> and also reproduced in the direct definition of <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-terms" title="BLD">RIF Basic Logic Dialect</a> (RIF-BLD).
</p><p>In RIF's presentation syntax built-in predicates and functions are syntactically represented as external terms of the form:
</p>
<p><tt>'External' '(' Expr ')'</tt></p>
<p>where <tt>Expr</tt> is a positional term as defined in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-terms" title="FLD">RIF Framework for Logic Dialects</a> (see also in <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-terms" title="BLD">RIF Basic Logic Dialect</a>). For RIF's normative syntax, see the <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#XML_Serialization_Framework" title="FLD">XML Serialization Framework </a> in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a>, or, specifically for <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a>, see <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-xml-bld" title="BLD">XML Serialization Syntax for RIF-BLD</a>.
</p><p><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a> introduces the notion of an <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-formal-external-schema" title="FLD">external schema</a> to describe both the syntax and semantics of exernally defined terms. In the special case of a RIF built-in, external schemas have an especially simple form. A built-in named <tt>f</tt> that takes <tt>n</tt> arguments has the schema
</p>
<p><tt>( ?X<sub>1</sub> ... ?X<sub>n</sub>; f(?X<sub>1</sub> ... ?X<sub>n</sub>) )</tt></p>
<p>Here <tt>f(?X<sub>1</sub> ... ?X<sub>n</sub>)</tt> is the actual positional term that is used to refer to the built-in (in expressions of the form <tt>External(f(?X<sub>1</sub> ... ?X<sub>n</sub>))</tt>) and <tt>?X<sub>1</sub> ... ?X<sub>n</sub></tt> is the list of all variables in that term.
</p><p>Note that <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a> allows additional forms of built-ins, which includes named-argument terms.
</p><p>RIF-FLD defines a <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-formal-external-schema" title="FLD">very general notion of external terms and schemas</a>, but RIF-BLD and the present document use more restricted notions.
For convenience, we present a complete definition of these restricted notions in <a href="#app-external-schema" title="">Appendix: Schemas for Externally Defined Terms</a>.
</p>
<a id="Semantics_of_Built-ins" name="Semantics_of_Built-ins"></a><h2> <span class="mw-headline">3.2 <span class="anchor" id="sec-semantics-builtin">Semantics of Built-ins</span> </span></h2>
<p>The semantics of external terms is defined using two mappings: <i><b>I</b></i><sub>external</sub> and <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>.
</p>
<ul>
<li>
<i><b>I</b></i><sub>external</sub>. This mapping takes an external schema, <tt>σ</tt>, and returns a mapping, <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>).
<p>
If <tt>σ</tt> represents a built-in function, <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) must be that function.
</p>
<p>
For each built-in function with external schema <tt>σ</tt>, the present document specifies the mapping <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>).
</p>
</li>
<li>
<i><b>I</b></i><sub>truth</sub>. This mapping takes an element of the domain of interpretation and returns a truth value.
<p>
In RIF logical semantics, this mapping is used to assign truth values to formulas. In the special case of RIF built-ins, it is used to assign truth values to RIF built-in predicates. The built-in predicates can have the truth values <b>t</b> or <b>f</b> only.
</p>
<p>
For a built-in predicate with schema <tt>σ</tt>, RIF-FLD and RIF-BLD require that the truth-valued mapping <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) must agree with the specification of the corresponding built-in predicate.
</p>
<p>
For each RIF built-in predicate with schema <tt>σ</tt>, the present document specifies <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>(<tt>σ</tt>).
</p>
</li>
</ul>
<a id="List_of_RIF_Built-in_Predicates_and_Functions" name="List_of_RIF_Built-in_Predicates_and_Functions"></a><h1> <span class="mw-headline">4 List of RIF Built-in Predicates and Functions</span></h1>
<p>This section provides a catalogue defining the syntax and semantics of a list of built-in predicates and functions in RIF. For each built-in, the following is defined:
</p>
<ol>
<li>
The <i><b>name</b></i> of the built-in.
</li>
<li>
The <i><b>external schema</b></i> of the built-in.
</li>
<li>
For a built-in function, how it maps its arguments into a result.
<p>
As explained in Section <a href="#sec-semantics-builtin" title="">Semantics of Built-ins</a>, this corresponds to the mapping <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) in the formal semantics of <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#def-fld-truth" title="FLD">RIF-FLD</a> and <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-bld-truth" title="BLD">RIF-BLD</a>, where <tt>σ</tt> is the external schema of the built-in.
</p>
</li>
<li>
For a built-in predicate, its truth value when the arguments are substituted with values in the domain.
<p>
As explained in Section <a href="#sec-semantics-builtin" title="">Semantics of Built-ins</a>, this corresponds to the mapping <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) in the formal semantics of <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#def-fld-truth" title="FLD">RIF-FLD</a> and <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-bld-truth" title="BLD">RIF-BLD</a>, where <tt>σ</tt> is the external schema of the built-in.
</p>
</li>
<li>
The <i><b>domains</b></i> for the arguments of the built-in.
<p>
Typically, built-in functions and predicates are defined over the value spaces of appropriate datatypes, i.e. the domains of the arguments. When an argument falls outside of its domain, it is understood as an error. Since this document defines a model-theoretic semantics for RIF built-ins, which does not support the notion of an error, the definitions leave the values of the built-in predicates and functions <b>unspecified</b> in such cases. This means that if one or more of the arguments is not in its domain, the value of <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>)(<tt>a<sub>1</sub> ... a<sub>n</sub></tt>) is unspecified. In particular, this
means it can vary from one implementation to another. Similarly, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>(<tt>σ</tt>)(<tt>a<sub>1</sub> ... a<sub>n</sub></tt>) is unspecified when an argument is not in its domain.
</p>
<p>
This indeterminacy in case of an error implies that applications should not make any assumptions about the values of built-ins in such situations. Implementations are even allowed to abort in such cases and the only safe way to communicate rule sets that contain built-ins among RIF-compliant systems is to use <a href="#sec-guard" title="">datatype guards</a>.
</p>
</li>
</ol>
<p><br />
Many built-in functions and predicates described below are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] and, when appropriate, we will refer to the definitions in that specification in order to avoid copying them. The differences from the original [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] include the handling of errors, the differentiation between predicates and functions, and a few specific differences noted in the definitions below.
</p><p><br />
</p>
<a id="Predicates_for_all_Datatypes" name="Predicates_for_all_Datatypes"></a><h2> <span class="mw-headline">4.1 <span class="anchor" id="sec-guard">Predicates for all Datatypes</span> </span></h2>
<a id="Comparison_for_Literals" name="Comparison_for_Literals"></a><h3> <span class="mw-headline">4.1.1 Comparison for Literals </span></h3>
<p>RIF supports identity for typed literals through the "=" predicate in all dialects that extend RIF-Core. Identity for typed literals is defined as being the same point in the value space for that type. Certain datatypes use more specific notions of equality that allow for multiple points in the value space to be considered equal. For each datatype specific notion of equality we refer to the supported predicate for that datatype.
</p><p>Since the basic RIF dialects do not support negation, dialects that extend RIF-Core define a built-in for checking the non-identity of two typed literals.
</p>
<a id="pred:literal-not-identical" name="pred:literal-not-identical"></a><h4> <span class="mw-headline">4.1.1.1 <tt>pred:literal-not-identical</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:literal-not-identical(
?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
This predicate does not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt>
ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub>
?arg<sub>2</sub>; pred:literal-not-identical( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if s<sub>1</sub> and s<sub>2</sub> are both in the value spaces of some datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a> and s<sub>1</sub> ≠ s<sub>2</sub>. This includes the case where s<sub>1</sub> and s<sub>2</sub> are of disjoint types.</p>
<p>
<i><b>I</b></i><sub>truth</sub><tt>
ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub>
?arg<sub>2</sub>; pred:literal-not-identical( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>f</b> otherwise. This includes the case where s<sub>1</sub> or s<sub>2</sub> are not in the value spaces of datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a>. </p>
</li>
</ul>
<a id="Guard_Predicates_for_Datatypes" name="Guard_Predicates_for_Datatypes"></a><h2> <span class="mw-headline">4.2 Guard Predicates for Datatypes </span></h2>
<p>RIF defines guard predicates for all datatypes in Section <a href="#Datatypes" title="">Datatypes</a>.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for these predicates have the general form
<p><tt>
( ?arg<sub>1</sub>; pred:is-literal-<i>DATATYPE</i> ( ?arg<sub>1</sub> ) )
</tt></p>
<p>Here, <i>DATATYPE</i> is the <a href="#def-shortname" title="">short name</a> for a datatype. For instance, we use <tt>pred:is-literal-string</tt> for the guard predicate for <tt>xs:string</tt>, <tt>pred:is-literal-PlainLiteral</tt> for the guard predicate for <tt>rdf:PlainLiteral</tt>, or <tt>pred:is-literal-XMLLiteral</tt> for the guard predicate for<tt>rdf:XMLLiteral</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own guard predicates for these datatypes. Labels used for such additional guard predicates for datatypes not mentioned in the present document MAY follow a similar naming convention where applicable without creating ambiguities with predicate names defined in the present document. Particularly, upcoming W3C specifications MAY - but 3rd party dialects MUST NOT - reuse the <tt>pred:</tt> namespace for such guard predicates.</p>
</li>
<li>
<em>Domain</em>:
<p>
Guard predicates do not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub>; pred:is-literal-<i>DATATYPE</i> ( ?arg<sub>1</sub> ) )(s<sub>1</sub>) = <b>t</b> if and only if s<sub>1</sub> is in the value space of <i>DATATYPE</i> and <b>f</b> otherwise.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined.
</p>
<ul>
<li><span class="anchor" id="is-literal-anyURI"><tt>
( ?arg<sub>1</sub>; pred:is-literal-anyURI( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-base64Binary"><tt>
( ?arg<sub>1</sub>; pred:is-literal-base64Binary( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-boolean"><tt>
( ?arg<sub>1</sub>; pred:is-literal-boolean( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-date"><tt>
( ?arg<sub>1</sub>; pred:is-literal-date ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-dateTime">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-dateTime ( ?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li>
<span class="anchor" id="is-literal-dateTimeStamp">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-dateTimeStamp ( ?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li><span class="anchor" id="is-literal-double"><tt>
( ?arg<sub>1</sub>; pred:is-literal-double ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-float"><tt>
( ?arg<sub>1</sub>; pred:is-literal-float ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-hexBinary"><tt>
( ?arg<sub>1</sub>; pred:is-literal-hexBinary ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-decimal">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-decimal ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-integer"><tt>
( ?arg<sub>1</sub>; pred:is-literal-integer( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-long"><tt>
( ?arg<sub>1</sub>; pred:is-literal-long ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-int">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-int( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-short"><tt>
( ?arg<sub>1</sub>; pred:is-literal-short( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-byte"><tt>
( ?arg<sub>1</sub>; pred:is-literal-byte( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-nonNegativeInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-nonNegativeInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-positiveInteger">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-positiveInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedLong">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-unsignedLong( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedInt">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-unsignedInt( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedShort">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-unsignedShort( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-unsignedByte">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-unsignedByte( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-nonPositiveInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-nonPositiveInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-negativeInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-negativeInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-PlainLiteral"><tt>
( ?arg<sub>1</sub>; pred:is-literal-PlainLiteral ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-string"><tt>
( ?arg<sub>1</sub>; pred:is-literal-string ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-normalizedString"><tt>
( ?arg<sub>1</sub>; pred:is-literal-normalizedString ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-token">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-token ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-language">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-language ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-Name"><tt>
( ?arg<sub>1</sub>; pred:is-literal-Name ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-NCName">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-NCName ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-NMTOKEN">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-NMTOKEN ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-time"><tt>
( ?arg<sub>1</sub>; pred:is-literal-time ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-dayTimeDuration">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-dayTimeDuration ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-yearMonthDuration"><tt>
( ?arg<sub>1</sub>; pred:is-literal-yearMonthDuration ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-XMLLiteral"><tt>
( ?arg<sub>1</sub>; pred:is-literal-XMLLiteral ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
</ul>
<p>Future dialects may extend this list of guards to other datatypes, but
RIF does not require guards for all datatypes.
</p>
<a id="Negative_Guard_Predicates_for_Datatypes" name="Negative_Guard_Predicates_for_Datatypes"></a><h2> <span class="mw-headline">4.3 Negative Guard Predicates for Datatypes </span></h2>
<p>Likewise, RIF defines negative guard predicates for all datatypes in Section <a href="#Datatypes" title="">Datatypes</a>.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for negative guards have the general form
<p><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-<i>DATATYPE</i> ( ?arg<sub>1</sub> ) )
</tt></p>
<p>Here, <i>DATATYPE</i> is the <a href="#def-shortname" title="">short name</a> for one of the datatypes mentioned in this document. For instance, we use <tt>pred:is-literal-not-String</tt> for the negative guard predicate for <tt>xs:string</tt>, <tt>pred:is-literal-not-PlainLiteral</tt> for the negative guard predicate for <tt>rdf:PlainLiteral</tt>, or <tt>pred:is-literal-not-XMLLiteral</tt> for the negative guard predicate for <tt>rdf:XMLLiteral</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own negative guard predicates for these datatypes. Labels used for such additional negative guard predicates for datatypes not mentioned in the present document MAY follow a similar naming convention where applicable without creating ambiguities with predicate names defined in the present document. Particularly, upcoming W3C specifications MAY, but 3rd party dialects MUST NOT reuse, the <tt>pred:</tt> namespace for such negative guard predicates.</p>
<p><br />
</p>
</li>
<li>
<em>Domain</em>:
<p>
Negative guard predicates do not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub>; pred:is-literal-not-<i>DATATYPE</i> ( ?arg<sub>1</sub> ) )(s<sub>1</sub>) = <b>t</b> if and only if s<sub>1</sub> is in the value space of one of the datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a> but not in the value space of the datatype with shortname <i>DATATYPE</i>, and <b>f</b> otherwise.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined.
</p>
<ul>
<li><span class="anchor" id="is-literal-not-anyURI"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-anyURI( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-base64Binary"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-base64Binary( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-boolean"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-boolean( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-date"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-date ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-dateTime">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-dateTime ( ?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li>
<span class="anchor" id="is-literal-not-dateTimeStamp">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-dateTimeStamp ( ?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li><span class="anchor" id="is-literal-not-double"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-double ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-float"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-float ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-hexBinary"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-hexBinary ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-decimal">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-decimal ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-integer"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-integer( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-long"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-long ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-int">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-int( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-short"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-short( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-byte"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-byte( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-nonNegativeInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-nonNegativeInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-positiveInteger">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-positiveInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedLong">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-unsignedLong( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedInt">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-unsignedInt( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedShort">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-unsignedShort( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-unsignedByte">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-unsignedByte( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-nonPositiveInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-nonPositiveInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-negativeInteger"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-negativeInteger( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-PlainLiteral"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-PlainLiteral ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-string"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-string ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-normalizedString"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-normalizedString ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-token">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-token ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-language">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-language ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-Name"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-Name ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-NCName">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-NCName ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-NMTOKEN">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-NMTOKEN ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-time"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-time ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-dayTimeDuration">
<tt>
( ?arg<sub>1</sub>; pred:is-literal-not-dayTimeDuration ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-yearMonthDuration"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-yearMonthDuration ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-XMLLiteral"><tt>
( ?arg<sub>1</sub>; pred:is-literal-not-XMLLiteral ( ?arg<sub>1</sub> ) )
</tt></span>
</li>
</ul>
<p>Future dialects may extend this list of negative guards to other datatypes, but
RIF does not require negative guards for all datatypes.
</p><p><i>Note:</i> The semantics of negative guards may be surprising. The is-literal-not-String guard essentially asks, "Is this a literal, <i>and</i> (if it is) is it something other than a String?" It could also be read as "Is this a decimal or a float or a double or a date or a dateTime, etc, [for every datatype except string] ?". The negative guards are formulated like this to allow for rules which detect, for instance, some kinds of bad inputs, while still using the open world assumption of some RIF dialects.
</p><p><span class="anchor" id="sec-casts"></span>
</p>
<a id="Datatype_Conversion_and_Casting" name="Datatype_Conversion_and_Casting"></a><h2> <span class="mw-headline">4.4 Datatype Conversion and Casting </span></h2>
<p>In the following, we adapt several cast functions according to the conversions defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. Note that some of these conversions are only partially defined, which affects the domains of these cast functions.</p>
<p>Likewise we define a conversion predicate useful for converting between <tt>rif:iri</tt> constants and strings, as well as a predicate to check the datatype of a constant.</p>
<a id="Casting_to_XML_Schema_Datatypes" name="Casting_to_XML_Schema_Datatypes"></a><h3> <span class="mw-headline">4.4.1 Casting to XML Schema Datatypes </span></h3>
<p>The casting functions in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] define mappings from source values <i>SV</i>, which are data values, annotated with source types <i>ST</i>, to target values <i>TV</i>, annotated with target types <i>TT</i>. The data values <i>V</i> we consider are not necessarily explicitly annotated with types. However, one can view the datatypes <i>D</i><sub>1</sub>,...,<i>D</i><sub>n</sub> whose value spaces include a data value <i>V</i> as the types of <i>V</i>. We assume in the following that any of the data types <i>D</i><sub>1</sub>,...,<i>D</i><sub>n</sub> is used as the annotation of the source value <i>SV</i>; the conversions in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] are defined equivalently for all such datatypes.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for casting functions have the general form
<p><tt>
( ?arg; <i>DATATYPE-IRI</i> ( ?arg ) )
</tt></p>
<p>Here, <i>DATATYPE-IRI</i> is the IRI identifying a datatype. For instance, we use <tt>xs:string(?V)</tt> for casting to <tt>xs:string</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own casting function for these datatypes. Labels used for such additional guard predicates for datatypes not mentioned in the present document MAY follow the same naming convention using the IRI identifying a datatype as function name for the casting function.</p>
</li>
<li>
<em>Domain</em>:
<p>The domain for casting functions to XML schema datatypes depends on where the casting is defined according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]:
for all the casting functions to XML schema datatypes the domain of <tt>?arg</tt> is at most the set of all data values in the value spaces of XML schema datatypes such that the conversion to <i>DATATYPE-IRI</i> does not raise a type error or an invalid value for cast/constructor error <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFORG0001" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFORG0001">[err:FORG0001</a>] or an invalid lexical value error <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFOCA0002" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFOCA0002">[err:FOCA0002</a>] according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
We will mention additional constraints on the domain for casts to specific datatypes below separately.
</p>
</li>
<li>
<em>Mapping:</em> The mappings for casting functions to XML schema datatypes are defined as follows:
<p>
<i><b>I</b></i><sub>external</sub>( ?arg; <i>DATATYPE-IRI</i> ( <tt>?arg</tt> ) )(<i>SV</i>) = <i>TV</i>, which is a value the value space of the datatype with IRI <i>DATATYPE-IRI</i> in derived from a type of <i>SV</i>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. We will mention additional constraints on the mappings for casts to specific datatypes below separately.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined:
</p>
<ul>
<li><span class="anchor" id="func-anyURI"><tt> ( ?arg; xs:anyURI ( ?arg ) ) </tt></span>
<p>
<em>Additional restriction on the Domain</em>:
Note that unlike [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] the extent to which an implementation validates the lexical form of <tt>xs:anyURI</tt>
is not implementation dependent, but RIF requires all lexical forms of <tt>xs:anyURI</tt> appearing as constants in the <tt>xs:string</tt> symbol space to be
castable to <tt>xs:anyURI</tt>.
</p>
</li>
<li><span class="anchor" id="func-base64Binary"><tt>( ?arg; xs:base64Binary( ?arg ) )</tt></span>
</li>
<li><span class="anchor" id="func-boolean"><tt>( ?arg; xs:boolean( ?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-date"><tt>( ?arg; xs:date ( ?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this function is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:date</tt> does not result in a value from the <tt>xs:date</tt> value space outside what [<a class="external free" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming</a>
minimal conformance] as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]
requires for <tt>xs:date</tt>.
</p>
</li>
<li><span class="anchor" id="func-dateTime"><tt>( ?arg; xs:dateTime ( ?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:date</tt> does not result in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:dateTime</tt>.
</p>
</li>
<li><span class="anchor" id="func-dateTimeStamp"><tt>( ?arg; xs:dateTimeStamp ( ?arg ) )</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
Since <tt>xs:dateTimeStamp</tt> is a derived type of <tt>dateTime</tt> the domain if this function is the same as for casting to <tt>xs:dateTime</tt>
with the additional restriction that casting to <tt>xs:dateTimeStamp</tt> is only defined for values such that the conversion to <tt>xs:dateTime</tt> has a non-empty
timezone component.
</p>
</li>
<li><span class="anchor" id="func-double"><tt>( ?arg; xs:double ( ?arg ) )</tt></span>
</li>
<li><span class="anchor" id="func-float"><tt>( ?arg; xs:float ( ?arg ) )</tt></span>
</li>
<li>
<span class="anchor" id="func-hexBinary"><tt>( ?arg; xs:hexBinary ( ?arg ) )</tt></span>
</li>
<li>
<span class="anchor" id="func-decimal">
<tt>
( ?arg; xs:decimal ( ?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:decimal</tt> does not result in a value from the <tt>xs:decimal</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:decimal</tt>.
</p>
</li>
<li>
<span class="anchor" id="func-integer"><tt>
( ?arg; xs:integer( ?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:integer</tt> does not result in a value from the <tt>xs:integer</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:integer</tt>.
</p>
</li>
<li>
<span class="anchor" id="func-long"><tt>
( ?arg; xs:long ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-int"><tt>
( ?arg; xs:int( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-short"><tt>
( ?arg; xs:short( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-byte"><tt>
( ?arg; xs:byte( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-nonNegativeInteger"><tt>
( ?arg; xs:nonNegativeInteger( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-positiveInteger"><tt>
( ?arg; xs:positiveInteger( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedLong"><tt>
( ?arg; xs:unsignedLong( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedInt"><tt>
( ?arg; xs:unsignedInt( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedShort"><tt>
( ?arg; xs:unsignedShort( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedByte"><tt>
( ?arg; xs:unsignedByte( ?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-nonPositiveInteger">
<tt>
( ?arg; xs:nonPositiveInteger( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-negativeInteger"><tt>
( ?arg; xs:negativeInteger( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-string"><tt>
( ?arg; xs:string ( ?arg ) )
</tt></span>
<p>
<em>Additional restrictions on the Domain</em>:
</p>
<ol>
<li>Note that conversions from <tt>xs:float</tt> and <tt>xs:double</tt> to <tt>xs:string</tt> according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-strings" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-strings">Section 17.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]
may vary between implementations. Thus, the domain where this functions is specified in RIF is further restricted for data values in the value spaces of
XML schema datatypes such that the conversion to
<tt>xs:string</tt> is non-ambiguous in a <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimally conformant</a> implementation as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</li>
<li>RIF additionally includes values in the <tt>rdf:XMLLiteral</tt> value space to the domain.
</li>
</ol>
<p>
<em>Additional remark on the mapping</em>:<br />
If <i>SV</i> is a value in the value space of <tt>rdf:XMLLiteral</tt>, then
<i><b>I</b></i><sub>external</sub>( ?arg; <tt>xs:string</tt>( <tt>?arg</tt> ) )(<i>SV</i>) = <i>TV</i> such that
<i>TV</i> is the string in the lexical space of rdf:XMLLiteral correspoding to <i>SV</i> (cf. [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>]).
</p>
</li>
<li>
<span class="anchor" id="func-normalizedString"><tt>
( ?arg; xs:normalizedString ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-token"><tt>
( ?arg; xs:token ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-language"><tt>
( ?arg; xs:language ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-Name"><tt>
( ?arg; xs:Name ( ?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-NCName"><tt>
( ?arg; xs:NCName ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-NMTOKEN"><tt>
( ?arg; xs:NMTOKEN ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-time"><tt>
( ?arg; xs:time ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-dayTimeDuration"><tt>
( ?arg; xs:dayTimeDuration ( ?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-yearMonthDuration"><tt>
( ?arg; xs:yearMonthDuration ( ?arg ) )
</tt></span>
</li>
</ul>
<a id="Casting_to_rdf:XMLLiteral" name="Casting_to_rdf:XMLLiteral"></a><h3> <span class="mw-headline">4.4.2 Casting to <tt>rdf:XMLLiteral</tt> </span></h3>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> ( ?arg; rdf:XMLLiteral ( ?arg ) ) </tt>
</p>
</li>
<li>
<em>Domain</em>:
<p>
The intersection of the value space of <tt>xs:string</tt> with the lexical space of <tt>rdf:XMLLiteral</tt>, i.e. an <tt>xs:string</tt> can be cast to <tt>rdf:XMLLiteral</tt> if and only if its value is in the lexical space of <tt>rdf:XMLLiteral</tt> as defined in <a class="external text" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">Resource Description Framework (RDF): Concepts and Abstract Syntax</a>
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; xs:XMLLiteral ( ?arg ) )(s) = s'
such that s' is the XMLLiteral corresponding to the given string s.</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Casting_to_rdf:PlainLiteral" name="Casting_to_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.4.3 Casting to <tt>rdf:PlainLiteral</tt> </span></h3>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> ( ?arg; rdf:PlainLiteral ( ?arg ) ) </tt>
</p>
</li>
<li>
<em>Domain</em>:
<p>The union of the value spaces of XML schema datatypes.
</p>
</li>
<li>
<em>Mapping:</em>
<p>Since the value space of <tt>xs:string</tt> is included in the value space of <tt>rdf:PlainLiteral</tt>, the mapping is defined in precisely the same way as for <a href="#func-string" title="">casts to <tt>xs:string</tt></a>.</p>
</li>
</ul>
<a id="pred:iri-string" name="pred:iri-string"></a><h3> <span class="mw-headline">4.4.4 <tt>pred:iri-string</tt> </span></h3>
<p>Conversions from <tt>rif:iri</tt> to <tt>xs:string</tt> and vice versa cannot be defined by the casting functions as above since <tt>rif:iri</tt> is not a datatype with a well-defined value space.
</p><p>To this end, since conversions from IRIs (resources) to strings are a needed feature, for instance, for conversions between RDF formats (see example below), we introduce a built-in predicate which supports such conversions.
</p>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> ( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:iri-string ( ?arg<sub>1</sub>, ?arg<sub>2</sub> ) ) </tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The first argument is not restricted by a specific domain, the second argument is the value space of <tt>xs:string</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:iri-string ( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(iri<sub>1</sub> str<sub>1</sub>) = <b>t</b> if and only if str<sub>1</sub> is a string in the lexical space of <tt>rif:iri</tt> and iri<sub>1</sub> is an element of the domain such that <i><b>I</b></i>( <tt>"</tt>str<sub>1</sub><tt>"^^rif:iri</tt> ) = iri<sub>1</sub> holds in the current interpretation.
</p>
<p>
Note that this definition restricts allowed RIF interpretations in such a way that the interpretation of <tt>pred:iri-string</tt> always needs to comply with respect to the symbols in the <tt>rif:iri</tt> symbol space for the first argument and elements of the <tt>xs:string</tt> value space for the second argument. The truth value of the predicate is left unspecified for other elements of the domain.
</p>
<p>
This predicate could be usable, for instance, to map telephone numbers between an RDF Format for vCard (<a class="external free" href="http://www.w3.org/TR/vcard-rdf" title="http://www.w3.org/TR/vcard-rdf">http://www.w3.org/TR/vcard-rdf</a>) and FOAF (<a class="external free" href="http://xmlns.com/foaf/0.1/" title="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>). vCard stores telephone numbers as string literals, whereas FOAF uses resources, i.e., URIs with the tel: URI-scheme. So, a mapping from FOAF to vCard would need to convert the <tt>tel:</tt> URI to a string and then cut off the first four characters ("tel:"). Such a mapping expressed in RIF could involve e.g. a rule as follows:</p>
<pre> ...
Prefix( VCard <<a class="external free" href="http://www.w3.org/TR/vcard-rdf" title="http://www.w3.org/TR/vcard-rdf#">http://www.w3.org/TR/vcard-rdf#</a>> )
Prefix( foaf <<a class="external free" href="http://xmlns.com/foaf/0.1/" title="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>> )
...
Forall ?X ?foafTelIri ?foafTelString (
?X[ VCard:tel -> External( func:substring( ?foafTelString 4 ) ] :-
And ( ?X[ foaf:phone -> ?foafTelIri ]
External( pred:iri-string( ?foafTelIri ?foafTelString ) ) )
</pre>
</li>
</ul>
<a id="Numeric_Functions_and_Predicates" name="Numeric_Functions_and_Predicates"></a><h2> <span class="mw-headline">4.5 Numeric Functions and Predicates </span></h2>
<p>The following functions and predicates are adapted from the respective numeric functions and operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Numeric_Functions" name="Numeric_Functions"></a><h3> <span class="mw-headline">4.5.1 Numeric Functions </span></h3>
<p>The following numeric binary built-in functions <tt>func:numeric-add</tt>, <tt>func:numeric-subtract</tt>, <tt>func:numeric-multiply</tt>, <tt>func:numeric-divide</tt>, <tt>func:numeric-integer-divide</tt>, and <tt>func:numeric-mod</tt> are defined in accordance with their corresponding operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<ul>
<li>
<em>Schema</em>:
<p>
The schemas for these functions have the general form
</p>
<p>
<tt>(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-<i>BINOP</i>(?arg<sub>1</sub> ?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>The domain of these functions is made up of pairs of values from value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments such that <tt>op:numeric-<i>BINOP</i></tt> as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] after type promotion does not result in a numeric operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOAR0002" title="http://www.w3.org/TR/xpath-functions/#ERRFOAR0002">err:FOAR0002</a>, division by zero error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOAR0001" title="http://www.w3.org/TR/xpath-functions/#ERRFOAR0001">err:FOAR0001</a>, or a value from the <tt>xs:decimal</tt> value spaces expressible with sixteen total digits, i.e., RIF requires <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-<i>BINOP</i>(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <i>res</i> such that <i>res</i> is the result of <tt>op:numeric-<i>BINOP</i></tt>(a<sub>1</sub>', a<sub>2</sub>') as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case both a<sub>1</sub> and a<sub>2</sub> belong to their domains. Here, a<sub>1</sub>' and a<sub>2</sub>' are obtained from a<sub>1</sub> and a<sub>2</sub> as follows:</p>
<ul><li> if a<sub>1</sub> and a<sub>2</sub> are both in the value space of <tt>xs:decimal</tt>, in the value space of <tt>xs:float</tt>, or in the value space of <tt>xs:double</tt>, a<sub>1</sub>' = a<sub>1</sub> and a<sub>2</sub>' = a<sub>2</sub>, else
</li><li> if neither a<sub>1</sub> nor a<sub>2</sub> is in the value space of <tt>xs:double</tt>, a<sub>1</sub>' and a<sub>2</sub>' are obtained by <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion">promoting</a> a<sub>1</sub> and a<sub>2</sub> to <tt>xs:float</tt>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion">Appendix B.1</a> of [<a href="#ref-xpath" title="">XPath</a>], else
</li><li> a<sub>1</sub>' and a<sub>2</sub>' are obtained by <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion">promoting</a> a<sub>1</sub> and a<sub>2</sub> to <tt>xs:double</tt>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion">Appendix B.1</a> of [<a href="#ref-xpath" title="">XPath</a>].
</li></ul>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p><br />
Accordingly, the following schemas are defined:
</p>
<ul>
<li><span class="anchor" id="func-numeric-add"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-add( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-add" title="http://www.w3.org/TR/xpath-functions/#func-numeric-add">op:numeric-add</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-subtract"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-subtract( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-subtract" title="http://www.w3.org/TR/xpath-functions/#func-numeric-subtract">op:numeric-subtract</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-multiply"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-multiply( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-multiply" title="http://www.w3.org/TR/xpath-functions/#func-numeric-multiply">op:numeric-multiply</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-divide"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-divide( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-divide" title="http://www.w3.org/TR/xpath-functions/#func-numeric-divide">op:numeric-divide</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-integer-divide"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-integer-divide( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-integer-divide" title="http://www.w3.org/TR/xpath-functions/#func-numeric-integer-divide">op:numeric-integer-divide</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-mod"><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; func:numeric-mod( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-mod" title="http://www.w3.org/TR/xpath-functions/#func-numeric-mod">op:numeric-integer-mod</a></tt>)
</li>
</ul>
<a id="Numeric_Predicates" name="Numeric_Predicates"></a><h3> <span class="mw-headline">4.5.2 Numeric Predicates </span></h3>
<p><span class="anchor" id="pred-numeric-equal"></span>
</p>
<a id="pred:numeric-equal_.28adapted_from_op:numeric-equal.29" name="pred:numeric-equal_.28adapted_from_op:numeric-equal.29"></a><h4> <span class="mw-headline">4.5.2.1 <tt>pred:numeric-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-equal" title="http://www.w3.org/TR/xpath-functions/#func-numeric-equal">op:numeric-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p>
<tt>(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-equal(?arg<sub>1</sub> ?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-equal(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-equal" title="http://www.w3.org/TR/xpath-functions/#func-numeric-equal">op:numeric-equal</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29" name="pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29"></a><h4> <span class="mw-headline">4.5.2.2 <tt>pred:numeric-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than">op:numeric-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-less-than(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than">op:numeric-less-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29" name="pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29"></a><h4> <span class="mw-headline">4.5.2.3 <tt>pred:numeric-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than">op:numeric-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than">op:numeric-greater-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-not-equal" name="pred:numeric-not-equal"></a><h4> <span class="mw-headline">4.5.2.4 <tt>pred:numeric-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-not-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is false and false otherwise.</p>
<a id="pred:numeric-less-than-or-equal" name="pred:numeric-less-than-or-equal"></a><h4> <span class="mw-headline">4.5.2.5 <tt>pred:numeric-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-less-than-or-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is true or <tt>pred:numeric-less-than</tt> is true and false otherwise.</p>
<a id="pred:numeric-greater-than-or-equal" name="pred:numeric-greater-than-or-equal"></a><h4> <span class="mw-headline">4.5.2.6 <tt>pred:numeric-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:numeric-greater-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-greater-than-or-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is true or <tt>pred:numeric-greater-than</tt> is true and false otherwise.</p>
<a id="Functions_and_Predicates_on_Boolean_Values" name="Functions_and_Predicates_on_Boolean_Values"></a><h2> <span class="mw-headline">4.6 Functions and Predicates on Boolean Values </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators on boolean values in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Functions_on_Boolean_Values" name="Functions_on_Boolean_Values"></a><h3> <span class="mw-headline">4.6.1 Functions on Boolean Values </span></h3>
<a id="func:not__.28adapted_from_fn:not.29" name="func:not__.28adapted_from_fn:not.29"></a><h4> <span class="mw-headline">4.6.1.1 <tt>func:not</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-not" title="http://www.w3.org/TR/xpath-functions/#func-not">fn:not</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg ; func:not( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:boolean</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg ; func:numeric-mod(?arg) )(a<sub>1</sub>) = <i>res</i> such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-not" title="http://www.w3.org/TR/xpath-functions/#func-not">fn:not</a>(a<sub>1</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case a<sub>1</sub> belongs to its domain.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_Boolean_Values" name="Predicates_on_Boolean_Values"></a><h3> <span class="mw-headline">4.6.2 Predicates on Boolean Values </span></h3>
<p><span class="anchor" id="pred-boolean-equal"></span>
</p>
<a id="pred:boolean-equal__.28adapted_from_op:boolean-equal.29" name="pred:boolean-equal__.28adapted_from_op:boolean-equal.29"></a><h4> <span class="mw-headline">4.6.2.1 <tt>pred:boolean-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-equal" title="http://www.w3.org/TR/xpath-functions/#func-boolean-equal">op:boolean-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p>
<tt>(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-equal(?arg<sub>1</sub> ?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-equal(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-equal" title="http://www.w3.org/TR/xpath-functions/#func-boolean-equal">op:boolean-equal</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<p>The following built-in predicates <tt>pred:boolean-less-than</tt> and <tt>pred:boolean-greater-than</tt> are defined analogously with respect to their corresponding operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29" name="pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29"></a><h4> <span class="mw-headline">4.6.2.2 <tt>pred:boolean-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than">op:boolean-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-less-than(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than">op:boolean-less-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29" name="pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29"></a><h4> <span class="mw-headline">4.6.2.3 <tt>pred:boolean-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than">op:boolean-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:boolean-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than">op:boolean-greater-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_Strings" name="Functions_and_Predicates_on_Strings"></a><h2> <span class="mw-headline">4.7 Functions and Predicates on Strings </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators on strings in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Functions_on_Strings" name="Functions_on_Strings"></a><h3> <span class="mw-headline">4.7.1 Functions on Strings </span></h3>
<a id="func:compare_.28adapted_from_fn:compare.29" name="func:compare_.28adapted_from_fn:compare.29"></a><h4> <span class="mw-headline">4.7.1.1 <tt>func:compare</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-compare" title="http://www.w3.org/TR/xpath-functions/#func-compare">fn:compare</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?comparand<sub>1</sub> ?comparand<sub>2</sub>; func:compare(?comparand<sub>1</sub> ?comparand<sub>2</sub>) )
</tt></p>
<p><tt>
( ?comparand<sub>1</sub> ?comparand<sub>2</sub> ?collation; func:compare(?comparand<sub>1</sub> ?comparand<sub>2</sub> ?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?comparand<sub>1</sub></tt> and <tt>?comparand<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?comparand<sub>1</sub> ?comparand<sub>2</sub>; func:compare(?comparand<sub>1</sub> ?comparand<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>
such that <i>res</i> = <tt>-1</tt>, <tt>0</tt>, or <tt>1</tt> (from the value space of <tt>xs:integer</tt>), depending on whether the value of the s<sub>1</sub> is respectively less than, equal to, or greater than the value of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. I.e., this function computes the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-compare" title="http://www.w3.org/TR/xpath-functions/#func-compare">fn:compare</a>(s<sub>1</sub>, s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains, where the default behavior in RIF is the <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a>.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:concat_.28adapted_from_fn:concat.29" name="func:concat_.28adapted_from_fn:concat.29"></a><h4> <span class="mw-headline">4.7.1.2 <tt>func:concat</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:concat(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
...
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ... ?arg<sub><i>n</i></sub>; func:concat(?arg<sub>1</sub> ?arg<sub>2</sub> ... ?arg<sub><i>n</i></sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
Following the definition of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a> this function casts its arguments to <tt>xs:string</tt>. Thus, the domain for all arguments is the union of all values castable to <tt>xs:string</tt> as defined in Section <a href="#sec-casts" title="">Datatype Conversion and Casting</a> above.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ... ?arg<sub><i>n</i></sub>; func:concat(?arg<sub>1</sub> ... ?arg<sub><i>n</i></sub>) )(s<sub>1</sub> ... s<sub><i>n</i></sub>) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a></tt>(s<sub>1</sub> ... s<sub><i>n</i></sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:string-join_.28adapted_from_fn:string-join.29" name="func:string-join_.28adapted_from_fn:string-join.29"></a><h4> <span class="mw-headline">4.7.1.3 <tt>func:string-join</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-join" title="http://www.w3.org/TR/xpath-functions/#func-string-join">fn:string-join</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:string-join(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ?arg<sub>3</sub>; func:string-join(?arg<sub>1</sub> ?arg<sub>2</sub> ?arg<sub>3</sub> ) )
</tt></p>
<p><tt>
...
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ... ?arg<sub><i>n-1</i></sub> ?arg<sub><i>n</i></sub>; func:string-join(?arg<sub>1</sub> ?arg<sub>2</sub> ... ?arg<sub><i>n-1</i></sub> ?arg<sub><i>n</i></sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for all arguments.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ... ?arg<sub><i>n-1</i></sub> ?arg<sub><i>n</i></sub>; func:string-join(?arg<sub>1</sub> ... ?arg<sub><i>n-1</i></sub> ?arg<sub><i>n</i></sub>) )(s<sub>1</sub> ... s<sub><i>n-1</i></sub> s<sub><i>n</i></sub>) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-join" title="http://www.w3.org/TR/xpath-functions/#func-string-join">fn:string-join</a></tt>((s<sub>1</sub> ... s<sub><i>n-1</i></sub> ) s<sub><i>n</i></sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:substring_.28adapted_from_fn:substring.29" name="func:substring_.28adapted_from_fn:substring.29"></a><h4> <span class="mw-headline">4.7.1.4 <tt>func:substring</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring" title="http://www.w3.org/TR/xpath-functions/#func-substring">fn:substring</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
( ?sourceString ?startingLoc; func:substring( ?sourceString ?startingLoc) )
</tt></p>
<p><tt>
( ?sourceString ?startingLoc ?length ; func:substring( ?sourceString ?startingLoc ?length) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for ?sourceString and the union of the value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt> and <tt>xs:decimal</tt> for the remaining two arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?sourceString ?startingLoc ?length; func:substring( ?sourceString ?startingLoc ?length ) )(src loc len) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring" title="http://www.w3.org/TR/xpath-functions/#func-substring">fn:substring</a></tt>(src loc len) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p>Note that, as in <a href="#ref-xpath-functions" title="">XPath-Functions</a>, the first character of a string is located at position 1, not position 0.
</p>
<a id="func:string-length_.28adapted_from_fn:string-length.29" name="func:string-length_.28adapted_from_fn:string-length.29"></a><h4> <span class="mw-headline">4.7.1.5 <tt>func:string-length</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-length" title="http://www.w3.org/TR/xpath-functions/#func-string-length">fn:string-length</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:string-length( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:string-length( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-length" title="http://www.w3.org/TR/xpath-functions/#func-string-length">fn:string-length</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:upper-case_.28adapted_from_fn:upper-case.29" name="func:upper-case_.28adapted_from_fn:upper-case.29"></a><h4> <span class="mw-headline">4.7.1.6 <tt>func:upper-case</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-upper-case" title="http://www.w3.org/TR/xpath-functions/#func-upper-case">fn:upper-case</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:upper-case( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:upper-case( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-upper-case" title="http://www.w3.org/TR/xpath-functions/#func-upper-case">fn:upper-case</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:lower-case_.28adapted_from_fn:lower-case.29" name="func:lower-case_.28adapted_from_fn:lower-case.29"></a><h4> <span class="mw-headline">4.7.1.7 <tt>func:lower-case</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-lower-case" title="http://www.w3.org/TR/xpath-functions/#func-lower-case">fn:lower-case</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:lower-case( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:lower-case( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-lower-case" title="http://www.w3.org/TR/xpath-functions/#func-lower-case">fn:lower-case</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29" name="func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29"></a><h4> <span class="mw-headline">4.7.1.8 <tt>func:encode-for-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri" title="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">fn:encode-for-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:encode-for-uri( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:encode-for-uri( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri" title="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">fn:encode-for-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29" name="func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29"></a><h4> <span class="mw-headline">4.7.1.9 <tt>func:iri-to-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri" title="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">fn:iri-to-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?iri ; func:iri-to-uri ( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:iri-to-uri( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri" title="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">fn:iri-to-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29" name="func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29"></a><h4> <span class="mw-headline">4.7.1.10 <tt>func:escape-html-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri" title="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri">fn:escape-html-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?uri ;func:escape-html-uri( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg; func:escape-html-uri( ?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri" title="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri">fn:escape-html-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:substring-before_.28adapted_from_fn:substring-before.29" name="func:substring-before_.28adapted_from_fn:substring-before.29"></a><h4> <span class="mw-headline">4.7.1.11 <tt>func:substring-before</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring-before" title="http://www.w3.org/TR/xpath-functions/#func-substring-before">fn:substring-before</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:substring-before( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation; func:substring-before( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:substring-before(?arg<sub>1</sub> ?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>, such that <i>res</i> is the substring of s<sub>1</sub> that precedes in the value of s<sub>1</sub> the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:substring-after_.28adapted_from_fn:substring-after.29" name="func:substring-after_.28adapted_from_fn:substring-after.29"></a><h4> <span class="mw-headline">4.7.1.12 <tt>func:substring-after</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring-after" title="http://www.w3.org/TR/xpath-functions/#func-substring-after">fn:substring-after</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:substring-after( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation; func:substring-after( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:substring-after(?arg<sub>1</sub> ?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>, such that <i>res</i> is the substring of s<sub>1</sub> that follows in the value of ?s<sub>1</sub> the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:replace_.28adapted_from_fn:replace.29" name="func:replace_.28adapted_from_fn:replace.29"></a><h4> <span class="mw-headline">4.7.1.13 <tt>func:replace</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-replace" title="http://www.w3.org/TR/xpath-functions/#func-replace">fn:replace</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?input ?pattern ?replacement; func:replace( ?input ?pattern ?replacement ) )
</tt></p>
<p><tt>
( ?input ?pattern ?replacement ?flags; func:replace( ?input ?pattern ?replacement ?flags ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for the first three arguments and all values in the value space of <tt>xs:string</tt> that are valid flags following <a class="external text" href="http://www.w3.org/TR/xpath-functions/#flags" title="http://www.w3.org/TR/xpath-functions/#flags">Section 7.6.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] for <tt>?flags</tt>.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub> ( ?input ?pattern ?replacement ?flags; func:replace( ?input ?pattern ?replacement ?flags ) ) (i p r f ) = <i>res</i>, such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-replace" title="http://www.w3.org/TR/xpath-functions/#func-replace">fn:replace</a></tt>(i p r f) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the arguments belongs to their domains.
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_Strings" name="Predicates_on_Strings"></a><h3> <span class="mw-headline">4.7.2 Predicates on Strings </span></h3>
<a id="pred:contains_.28adapted_from_fn:contains.29" name="pred:contains_.28adapted_from_fn:contains.29"></a><h4> <span class="mw-headline">4.7.2.1 <tt>pred:contains</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-contains" title="http://www.w3.org/TR/xpath-functions/#func-contains">fn:contains</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:contains( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation ; pred:contains( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:contains(?arg<sub>1</sub> ?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-contains" title="http://www.w3.org/TR/xpath-functions/#func-contains">fn:contains</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise. I.e., this function returns true or false indicating whether or not ?s<sub>1</sub> contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of ?s<sub>2</sub>, according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="pred:starts-with_.28adapted_from_fn:starts-with.29" name="pred:starts-with_.28adapted_from_fn:starts-with.29"></a><h4> <span class="mw-headline">4.7.2.2 <tt>pred:starts-with</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-starts-with" title="http://www.w3.org/TR/xpath-functions/#func-starts-with">fn:starts-with</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:starts-with( ?arg<sub>1</sub> ?arg<sub>2</sub> )
</tt></p>
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation; pred:starts-with( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation)
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:starts-with(?arg<sub>1</sub> ?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-starts-with" title="http://www.w3.org/TR/xpath-functions/#func-starts-with">fn:starts-with</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:ends-with_.28adapted_from_fn:ends-with.29" name="pred:ends-with_.28adapted_from_fn:ends-with.29"></a><h4> <span class="mw-headline">4.7.2.3 <tt>pred:ends-with</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-ends-with" title="http://www.w3.org/TR/xpath-functions/#func-ends-with">fn:ends-with</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; fn:ends-with( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub> ?collation; fn:ends-with( ?arg<sub>1</sub> ?arg<sub>2</sub> ?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:ends-with(?arg<sub>1</sub> ?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-ends-with" title="http://www.w3.org/TR/xpath-functions/#func-ends-with">fn:ends-with</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:matches_.28adapted_from_fn:matches.29" name="pred:matches_.28adapted_from_fn:matches.29"></a><h4> <span class="mw-headline">4.7.2.4 <tt>pred:matches</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-matches" title="http://www.w3.org/TR/xpath-functions/#func-matches">fn:matches</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?input ?pattern; pred:matches( ?input ?pattern) )
</tt></p>
<p><tt>
( ?input ?pattern ?flags; pred:matches( ?input ?pattern ?flags ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for the first two arguments and all values in the value space of <tt>xs:string</tt> that are valid flags following <a class="external text" href="http://www.w3.org/TR/xpath-functions/#flags" title="http://www.w3.org/TR/xpath-functions/#flags">Section 7.6.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] for <tt>?flags</tt>.</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?input ?pattern ?flags; pred:matches(?input ?pattern ?flags) )(i p f) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-matches" title="http://www.w3.org/TR/xpath-functions/#func-matches">pred:matches</a>( i p f ) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations" name="Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations"></a><h2> <span class="mw-headline">4.8 Functions and Predicates on Dates, Times, and Durations </span></h2>
<p>If not stated otherwise, in the following we define schemas for functions and operators defined on the date, time and duration datatypes in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p><p>As defined in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#dates-and-times" title="http://www.w3.org/TR/xpath-datamodel/#dates-and-times">Section 3.3.2 Dates and Times</a>, <tt>xs:dateTime</tt>, <tt>xs:date</tt>, <tt>xs:time</tt>, <tt>xs:gYearMonth</tt>, <tt>xs:gYear</tt>, <tt>xs:gMonthDay</tt>, <tt>xs:gMonth</tt>, <tt>xs:gDay</tt> values, referred to collectively as date/time values, are represented as seven components or properties: year, month, day, hour, minute, second and timezone. The value of the first five components are <tt>xs:integer</tt>s. The value of the second component is an <tt>xs:decimal</tt> and the value of the timezone component is an <tt>xs:dayTimeDuration</tt>. For all the date/time datatypes, the timezone property is optional and may or may not be present. Depending on the datatype, some of the remaining six properties must be present and some must be absent. Absent, or missing, properties are represented by the empty sequence. This value is referred to as the local value in that the value is in the given timezone. Before comparing or subtracting <tt>xs:dateTime</tt> values, this local value must be translated or normalized to UTC.
</p>
<a id="Functions_on_Dates.2C_Times.2C_and_Durations" name="Functions_on_Dates.2C_Times.2C_and_Durations"></a><h3> <span class="mw-headline">4.8.1 Functions on Dates, Times, and Durations </span></h3>
<a id="func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29" name="func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.1 <tt>func:year-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:year-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:year-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p>Note that we we slightly deviate here from the original definition of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a> which says: "If ?arg is the empty sequence, returns the empty sequence." The RIF version of func:year-from-dateTime does not support "empty sequences".
</p>
<a id="func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29" name="func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.2 <tt>func:month-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime">fn:month-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:month-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:month-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime">fn:month-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29" name="func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.3 <tt>func:day-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime">fn:day-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:day-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:day-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime">fn:day-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29" name="func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.4 <tt>func:hours-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime">fn:hours-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:hours-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:hours-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime">fn:hours-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29" name="func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.5 <tt>func:minutes-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime">fn:minutes-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:minutes-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:minutes-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime">fn:minutes-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29" name="func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.6 <tt>func:seconds-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime">fn:seconds-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:seconds-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:seconds-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime">fn:seconds-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:year-from-date_.28adapted_from_fn:year-from-date.29" name="func:year-from-date_.28adapted_from_fn:year-from-date.29"></a><h4> <span class="mw-headline">4.8.1.7 <tt>func:year-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-date" title="http://www.w3.org/TR/xpath-functions/#func-year-from-date">fn:year-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:year-from-date( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:year-from-date( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-date" title="http://www.w3.org/TR/xpath-functions/#func-year-from-date">fn:year-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:month-from-date_.28adapted_from_fn:month-from-date.29" name="func:month-from-date_.28adapted_from_fn:month-from-date.29"></a><h4> <span class="mw-headline">4.8.1.8 <tt>func:month-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-date" title="http://www.w3.org/TR/xpath-functions/#func-month-from-date">fn:month-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:month-from-date( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:month-from-date( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-date" title="http://www.w3.org/TR/xpath-functions/#func-month-from-date">fn:month-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:day-from-date_.28adapted_from_fn:day-from-date.29" name="func:day-from-date_.28adapted_from_fn:day-from-date.29"></a><h4> <span class="mw-headline">4.8.1.9 <tt>func:day-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-date" title="http://www.w3.org/TR/xpath-functions/#func-day-from-date">fn:day-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:day-from-date( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:day-from-date( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-date" title="http://www.w3.org/TR/xpath-functions/#func-day-from-date">fn:day-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-time_.28adapted_from_fn:hours-from-time.29" name="func:hours-from-time_.28adapted_from_fn:hours-from-time.29"></a><h4> <span class="mw-headline">4.8.1.10 <tt>func:hours-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-time" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-time">fn:hours-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:hours-from-time( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:hours-from-time( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-time" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-time">fn:hours-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29" name="func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29"></a><h4> <span class="mw-headline">4.8.1.11 <tt>func:minutes-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time">fn:minutes-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:minutes-from-time( ?arg ) )
</tt></p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:minutes-from-time( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time">fn:minutes-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29" name="func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29"></a><h4> <span class="mw-headline">4.8.1.12 <tt>func:seconds-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time">fn:seconds-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:seconds-from-time( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:seconds-from-time( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time">fn:seconds-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="func:years-from-duration_.28adapted_from_fn:years-from-duration.29" name="func:years-from-duration_.28adapted_from_fn:years-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.13 <tt>func:years-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-years-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-years-from-duration">fn:years-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:years-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:years-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-years-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-years-from-duration">fn:years-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
</li>
</ul>
<a id="func:months-from-duration_.28adapted_from_fn:months-from-duration.29" name="func:months-from-duration_.28adapted_from_fn:months-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.14 <tt>func:months-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-months-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-months-from-duration">fn:months-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:months-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:months-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-months-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-months-from-duration">fn:months-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:days-from-duration_.28adapted_from_fn:days-from-duration.29" name="func:days-from-duration_.28adapted_from_fn:days-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.15 <tt>func:days-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-days-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-days-from-duration">fn:days-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:days-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:days-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-days-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-days-from-duration">fn:days-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29" name="func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.16 <tt>func:hours-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration">fn:hours-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:hours-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:hours-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration">fn:hours-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29" name="func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.17 <tt>func:minutes-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration">fn:minutes-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:minutes-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:minutes-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration">fn:minutes-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29" name="func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.18 <tt>func:seconds-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration">fn:seconds-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:seconds-from-duration( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:seconds-from-duration( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration">fn:seconds-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29" name="func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.19 <tt>func:timezone-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime">fn:timezone-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:timezone-from-dateTime( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTimeStamp</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:timezone-from-dateTime( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime">fn:timezone-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:dateTimeStamp</tt> instead of <tt>xs:dateTime</tt>, i.e. RIF leaves the return value for <tt>xs:dateTime</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<p>The following two functions are defined analogously for domains <tt>xs:date</tt> and <tt>xs:time</tt>
</p>
<a id="func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29" name="func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29"></a><h4> <span class="mw-headline">4.8.1.20 <tt>func:timezone-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date">fn:timezone-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:timezone-from-date( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The values of value space <tt>xs:date</tt> with a timezone component.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:timezone-from-date( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date">fn:timezone-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:date</tt> values with a timezone component, i.e. RIF leaves the return value for <tt>xs:date</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29" name="func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29"></a><h4> <span class="mw-headline">4.8.1.21 <tt>func:timezone-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time">fn:timezone-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:timezone-from-time( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The values of value space <tt>xs:time</tt> with a timezone component.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg ; func:timezone-from-time( ?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time">fn:timezone-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:time</tt> values with a timezone component, i.e. RIF leaves the return value for <tt>xs:time</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29" name="func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29"></a><h4> <span class="mw-headline">4.8.1.22 <tt>func:subtract-dateTimes</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes">op:subtract-dateTimes</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dateTimes( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTimeStamp</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dateTimes( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes">fn:subtract-dateTimes</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:dateTimeStamp</tt>s instead of <tt>xs:dateTime</tt>, i.e. RIF leaves the return value for <tt>xs:dateTime</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dates_.28adapted_from_op:subtract-dates.29" name="func:subtract-dates_.28adapted_from_op:subtract-dates.29"></a><h4> <span class="mw-headline">4.8.1.23 <tt>func:subtract-dates</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dates" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dates">op:subtract-dates</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dates( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> with given timezone for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dates( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dates" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dates">fn:subtract-dates</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:date</tt>s with explicit timezone, i.e. RIF leaves the return value for <tt>xs:date</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-times_.28adapted_from_op:subtract-times.29" name="func:subtract-times_.28adapted_from_op:subtract-times.29"></a><h4> <span class="mw-headline">4.8.1.24 <tt>func:subtract-times</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-times" title="http://www.w3.org/TR/xpath-functions/#func-subtract-times">op:subtract-times</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-times( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> with given timezone for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-times( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-times" title="http://www.w3.org/TR/xpath-functions/#func-subtract-times">fn:subtract-times</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:time</tt>s with explicit timezone, i.e. RIF leaves the return value for <tt>xs:date</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29" name="func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29"></a><h4> <span class="mw-headline">4.8.1.25 <tt>func:add-yearMonthDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">op:add-yearMonthDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-yearMonthDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">fn:add-yearMonthDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-yearMonthDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">fn:add-yearMonthDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29" name="func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29"></a><h4> <span class="mw-headline">4.8.1.26 <tt>func:subtract-yearMonthDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">op:subtract-yearMonthDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-yearMonthDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">fn:subtract-yearMonthDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-yearMonthDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">fn:subtract-yearMonthDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29" name="func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.27 <tt>func:multiply-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">op:multiply-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:multiply-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">fn:multiply-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:multiply-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">fn:multiply-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29" name="func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.28 <tt>func:divide-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">op:divide-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:divide-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">fn:divide-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">fn:divide-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29" name="func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.29 <tt>func:divide-yearMonthDuration-by-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">op:divide-yearMonthDuration-by-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-yearMonthDuration-by-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration</tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">fn:divide-yearMonthDuration-by-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-yearMonthDuration-by-yearMonthDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">fn:divide-yearMonthDuration-by-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29" name="func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29"></a><h4> <span class="mw-headline">4.8.1.30 <tt>func:add-dayTimeDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">op:add-dayTimeDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-dayTimeDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value space of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">fn:add-dayTimeDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-dayTimeDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">fn:add-dayTimeDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29" name="func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29"></a><h4> <span class="mw-headline">4.8.1.31 <tt>func:subtract-dayTimeDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">op:subtract-dayTimeDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dayTimeDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value space of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">fn:subtract-dayTimeDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dayTimeDurations( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">fn:subtract-dayTimeDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29" name="func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.32 <tt>func:multiply-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">op:multiply-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:multiply-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">fn:multiply-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:multiply-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">fn:multiply-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29" name="func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.33 <tt>func:divide-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">op:divide-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:divide-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">fn:divide-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">fn:divide-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29" name="func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.34 <tt>func:divide-dayTimeDuration-by-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">op:divide-dayTimeDuration-by-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-dayTimeDuration-by-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration</tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">fn:divide-dayTimeDuration-by-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:divide-dayTimeDuration-by-dayTimeDuration( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">fn:divide-dayTimeDuration-by-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29" name="func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.35 <tt>func:add-yearMonthDuration-to-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">op:add-yearMonthDuration-to-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:add-yearMonthDuration-to-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">fn:add-yearMonthDuration-to-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-yearMonthDuration-to-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">fn:add-yearMonthDuration-to-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29" name="func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29"></a><h4> <span class="mw-headline">4.8.1.36 <tt>func:add-yearMonthDuration-to-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">op:add-yearMonthDuration-to-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:add-yearMonthDuration-to-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">fn:add-yearMonthDuration-to-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-yearMonthDuration-to-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">fn:add-yearMonthDuration-to-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29" name="func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.37 <tt>func:add-dayTimeDuration-to-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">op:add-dayTimeDuration-to-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:add-dayTimeDuration-to-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">fn:add-dayTimehDuration-to-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-dayTimeDuration-to-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">fn:add-dayTimeDuration-to-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29" name="func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29"></a><h4> <span class="mw-headline">4.8.1.38 <tt>func:add-dayTimeDuration-to-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">op:add-dayTimeDuration-to-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:add-dayTimeDuration-to-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">fn:add-dayTimehDuration-to-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-dayTimeDuration-to-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">fn:add-dayTimeDuration-to-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29" name="func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29"></a><h4> <span class="mw-headline">4.8.1.39 <tt>func:add-dayTimeDuration-to-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">op:add-dayTimeDuration-to-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:add-dayTimeDuration-to-time( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:time</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">fn:add-dayTimehDuration-to-time</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:time</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:add-dayTimeDuration-to-time( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">fn:add-dayTimeDuration-to-time</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29" name="func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.40 <tt>func:subtract-yearMonthDuration-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">op:subtract-yearMonthDuration-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:subtract-yearMonthDuration-from-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">fn:subtract-yearMonthDuration-from-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-yearMonthDuration-from-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">fn:subtract-yearMonthDuration-from-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29" name="func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29"></a><h4> <span class="mw-headline">4.8.1.41 <tt>func:subtract-yearMonthDuration-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">op:subtract-yearMonthDuration-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:subtract-yearMonthDuration-from-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">fn:subtract-yearMonthDuration-from-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-yearMonthDuration-from-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">fn:subtract-yearMonthDuration-from-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29" name="func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.42 <tt>func:subtract-dayTimeDuration-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">op:subtract-dayTimeDuration-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:subtract-dayTimeDuration-from-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">fn:subtract-dayTimehDuration-from-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-dateTime( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">fn:subtract-dayTimeDuration-from-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29" name="func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29"></a><h4> <span class="mw-headline">4.8.1.43 <tt>func:subtract-dayTimeDuration-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">op:subtract-dayTimeDuration-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:subtract-dayTimeDuration-from-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">fn:subtract-dayTimehDuration-from-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-date( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">fn:subtract-dayTimeDuration-from-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29" name="func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29"></a><h4> <span class="mw-headline">4.8.1.44 <tt>func:subtract-dayTimeDuration-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">op:subtract-dayTimeDuration-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub> ; func:subtract-dayTimeDuration-from-time( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:time</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">fn:subtract-dayTimehDuration-from-time</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:time</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-time( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">fn:subtract-dayTimeDuration-from-Time</a><sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="Predicates_on_Dates.2C_Times.2C_and_Durations" name="Predicates_on_Dates.2C_Times.2C_and_Durations"></a><h3> <span class="mw-headline">4.8.2 Predicates on Dates, Times, and Durations </span></h3>
<a id="pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29" name="pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29"></a><h4> <span class="mw-headline">4.8.2.1 <tt>pred:dateTime-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal">op:dateTime-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-equal( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal">op:dateTime-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29" name="pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29"></a><h4> <span class="mw-headline">4.8.2.2 <tt>pred:dateTime-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than">op:dateTime-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-less-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than">op:dateTime-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29" name="pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.3 <tt>pred:dateTime-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than">op:dateTime-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than">op:dateTime-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-equal_.28adapted_from_op:date-equal.29" name="pred:date-equal_.28adapted_from_op:date-equal.29"></a><h4> <span class="mw-headline">4.8.2.4 <tt>pred:date-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-equal" title="http://www.w3.org/TR/xpath-functions/#func-date-equal">op:date-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-equal( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-equal" title="http://www.w3.org/TR/xpath-functions/#func-date-equal">op:date-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-less-than_.28adapted_from_op:date-less-than.29" name="pred:date-less-than_.28adapted_from_op:date-less-than.29"></a><h4> <span class="mw-headline">4.8.2.5 <tt>pred:date-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-less-than" title="http://www.w3.org/TR/xpath-functions/#func-date-less-than">op:date-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-less-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-less-than" title="http://www.w3.org/TR/xpath-functions/#func-date-less-than">op:date-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-greater-than_.28adapted_from_op:date-greater-than.29" name="pred:date-greater-than_.28adapted_from_op:date-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.6 <tt>pred:date-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-date-greater-than">op:date-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-date-greater-than">op:date-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-equal_.28adapted_from_op:time-equal.29" name="pred:time-equal_.28adapted_from_op:time-equal.29"></a><h4> <span class="mw-headline">4.8.2.7 <tt>pred:time-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-equal" title="http://www.w3.org/TR/xpath-functions/#func-time-equal">op:time-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-equal( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-equal" title="http://www.w3.org/TR/xpath-functions/#func-time-equal">op:time-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-less-than_.28adapted_from_op:time-less-than.29" name="pred:time-less-than_.28adapted_from_op:time-less-than.29"></a><h4> <span class="mw-headline">4.8.2.8 <tt>pred:time-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-less-than" title="http://www.w3.org/TR/xpath-functions/#func-time-less-than">op:time-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-less-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-less-than" title="http://www.w3.org/TR/xpath-functions/#func-time-less-than">op:time-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-greater-than_.28adapted_from_op:time-greater-than.29" name="pred:time-greater-than_.28adapted_from_op:time-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.9 <tt>pred:time-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-time-greater-than">op:time-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-time-greater-than">op:time-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:duration-equal_.28adapted_from_op:duration-equal.29" name="pred:duration-equal_.28adapted_from_op:duration-equal.29"></a><h4> <span class="mw-headline">4.8.2.10 <tt>pred:duration-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-duration-equal" title="http://www.w3.org/TR/xpath-functions/#func-duration-equal">op:duration-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:duration-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The union of the value spaces of <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:duration-equal( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-duration-equal" title="http://www.w3.org/TR/xpath-functions/#func-duration-equal">op:duration-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29" name="pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29"></a><h4> <span class="mw-headline">4.8.2.11 <tt>pred:dayTimeDuration-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than">op:dayTimeDuration-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-less-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than">op:dayTimeDuration-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29" name="pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.12 <tt>pred:dayTimeDuration-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than">op:dayTimeDuration-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than">op:dayTimeDuration-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29" name="pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29"></a><h4> <span class="mw-headline">4.8.2.13 <tt>pred:yearMonthDuration-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than">op:yearMonthDuration-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration-less-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration-less-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than">op:yearMonthDuration-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29" name="pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.14 <tt>pred:yearMonthDuration-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than">op:yearMonthDuration-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration-greater-than(?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than">op:yearMonthDuration-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<p><br />
</p>
<a id="pred:dateTime-not-equal" name="pred:dateTime-not-equal"></a><h4> <span class="mw-headline">4.8.2.15 <tt>pred:dateTime-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-not-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is false.</p>
<a id="pred:dateTime-less-than-or-equal" name="pred:dateTime-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.16 <tt>pred:dateTime-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-less-than-or-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is true or <tt>pred:dateTime-less-than</tt> is true.</p>
<a id="pred:dateTime-greater-than-or-equal" name="pred:dateTime-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.17 <tt>pred:dateTime-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dateTime-greater-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-greater-than-or-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is true or <tt>pred:dateTime-greater-than</tt> is true.</p>
<a id="pred:date-not-equal" name="pred:date-not-equal"></a><h4> <span class="mw-headline">4.8.2.18 <tt>pred:date-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-not-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is false.</p>
<a id="pred:date-less-than-or-equal" name="pred:date-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.19 <tt>pred:date-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-less-than-or-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is true or <tt>pred:date-less-than</tt> is true.</p>
<a id="pred:date-greater-than-or-equal" name="pred:date-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.20 <tt>pred:date-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:date-greater-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-greater-than-or-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is true or <tt>pred:date-greater-than</tt> is true.</p>
<a id="pred:time-not-equal" name="pred:time-not-equal"></a><h4> <span class="mw-headline">4.8.2.21 <tt>pred:time-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-not-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is false.</p>
<a id="pred:time-less-than-or-equal" name="pred:time-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.22 <tt>pred:time-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-less-than-or-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is true or <tt>pred:time-less-than</tt> is true.</p>
<a id="pred:time-greater-than-or-equal" name="pred:time-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.23 <tt>pred:time-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:time-greater-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-greater-than-or-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is true or <tt>pred:time-greater-than</tt> is true.</p>
<a id="pred:duration-not-equal" name="pred:duration-not-equal"></a><h4> <span class="mw-headline">4.8.2.24 <tt>pred:duration-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:duration-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:duration-equal</tt> has the same domains as <tt>pred:duration-equal</tt> and is true whenever <tt>pred:duration-equal</tt> is false.</p>
<a id="pred:dayTimeDuration-less-than-or-equal" name="pred:dayTimeDuration-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.25 <tt>pred:dayTimeDuration-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dayTimeDuration-less-than-or-equal</tt> has the same domains as <tt>pred:dayTimeDuration-less-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:dayTimeDuration-less-than</tt> is true.</p>
<a id="pred:dayTimeDuration-greater-than-or-equal" name="pred:dayTimeDuration-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.26 <tt>pred:dayTimeDuration-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:dayTimeDuration-greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dayTimeDuration-greater-than-or-equal</tt> has the same domains as <tt>pred:dayTimeDuration-greater-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:dayTimeDuration-greater-than</tt> is true.</p>
<a id="pred:yearMonthDuration-less-than-or-equal" name="pred:yearMonthDuration-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.27 <tt>pred:yearMonthDuration-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration-less-than-or-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:yearMonthDuration-less-than-or-equal</tt> has the same domains as <tt>pred:yearMonthDuration-less-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:yearMonthDuration-less-than</tt> is true.</p>
<a id="pred:yearMonthDuration-greater-than-or-equal" name="pred:yearMonthDuration-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.28 <tt>pred:yearMonthDuration-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:yearMonthDuration--greater-than( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:yearMonthDuration-greater-than-or-equal</tt> has the same domains as <tt>pred:yearMonthDuration-greater-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:yearMonthDuration-greater-than</tt> is true.</p>
<a id="Functions_and_Predicates_on_rdf:XMLLiterals" name="Functions_and_Predicates_on_rdf:XMLLiterals"></a><h2> <span class="mw-headline">4.9 Functions and Predicates on rdf:XMLLiterals </span></h2>
<a id="pred:XMLLiteral-equal" name="pred:XMLLiteral-equal"></a><h4> <span class="mw-headline">4.9.1 <tt>pred:XMLLiteral-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:XMLLiteral-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:XMLLiteral</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?arg<sub>1</sub> ?arg<sub>2</sub>; pred:XMLLiteral-equal( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if s<sub>1</sub> = s<sub>2</sub>, <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:XMLLiteral-not-equal" name="pred:XMLLiteral-not-equal"></a><h4> <span class="mw-headline">4.9.2 <tt>pred:XMLLiteral-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub>; pred:XMLLiteral-not-equal( ?arg<sub>1</sub> ?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-not-equal</tt> has the same domains as <tt>pred:XMLLiteral-equal</tt> and is true whenever <tt>pred:XMLLiteral-equal</tt> is false.</p>
<a id="Functions_and_Predicates_on_rdf:PlainLiteral" name="Functions_and_Predicates_on_rdf:PlainLiteral"></a><h2> <span class="mw-headline">4.10 Functions and Predicates on rdf:PlainLiteral </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators in [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].
</p>
<a id="Functions_on_rdf:PlainLiteral" name="Functions_on_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.10.1 Functions on rdf:PlainLiteral </span></h3>
<a id="func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29" name="func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29"></a><h4> <span class="mw-headline">4.10.1.1 <tt>func:PlainLiteral-from-string-lang</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:PlainLiteral-from-string-lang" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:PlainLiteral-from-string-lang">plfn:PlainLiteral-from-string-lang</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub> ?arg<sub>2</sub> ; func:PlainLiteral-from-string-lang( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for ?arg<sub>1</sub> and the intersection of the elements of the value space of <tt>xs:string</tt> which represent valid language tags according to [<a href="#ref-bcp-47" title="">BCP-47</a>] for ?arg<sub>2</sub>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>((?arg<sub>1</sub> ?arg<sub>2</sub> ; func:PlainLiteral-from-string-lang( ?arg<sub>1</sub> ?arg<sub>2</sub> ) )(s l) = <i>res</i>
such that <i>res</i> is the pair < s, l > in the value space of <tt>rdf:PlainLiteral</tt>.</p>
<p>If any argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29" name="func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29"></a><h4> <span class="mw-headline">4.10.1.2 <tt>func:string-from-PlainLiteral</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:string-from-PlainLiteral" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:string-from-PlainLiteral">plfn:string-from-PlainLiteral</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg ; func:string-from-PlainLiteral( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(?arg ; func:string-from-PlainLiteral( ?arg ) )(t) = <i>res</i> such that <i>res</i> is the string part s of t if t is a pair < s, l > or <i>res</i> = t if t is a string value.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29" name="func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29"></a><h4> <span class="mw-headline">4.10.1.3 <tt>func:lang-from-PlainLiteral</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:lang-from-PlainLiteral" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:lang-from-PlainLiteral">plfn:lang-from-PlainLiteral</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg ; func:lang-from-PlainLiteral( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for ?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(?arg ; func:lang-from-PlainLiteral( ?arg ) )(t) = <i>l</i> such that <i>l</i> is the language tag string of t if t is a pair < s, l > and <tt>""^^xs:string</tt> if t is a string value.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:PlainLiteral-compare_.28adapted_from_plfn:compare.29" name="func:PlainLiteral-compare_.28adapted_from_plfn:compare.29"></a><h4> <span class="mw-headline">4.10.1.4 <tt>func:PlainLiteral-compare</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:compare" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:compare">plfn:compare</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?comparand<sub>1</sub> ?comparand<sub>2</sub>; func:PlainLiteral-compare(?comparand<sub>1</sub> ?comparand<sub>2</sub>) )
</tt></p>
<p><tt>
( ?comparand<sub>1</sub> ?comparand<sub>2</sub> ?collation; func:PlainLiteral-compare(?comparand<sub>1</sub> ?comparand<sub>2</sub> ?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for <tt>?comparand<sub>1</sub></tt> and <tt>$comparand<sub>2</sub></tt>, and the empty set for <tt>?collation</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?comparand<sub>1</sub> ?comparand<sub>2</sub>; func:PlainLiteral-compare(?comparand<sub>1</sub> ?comparand<sub>2</sub>) )(t<sub>1</sub> t<sub>2</sub>) = <i>res</i>
such that, whenever t<sub>1</sub>=( s<sub>1</sub>, l ) and t<sub>2</sub>=( s<sub>2</sub>, l ) are two pairs with the same language tag l in the value space of<tt>rdf:PlainLiteral</tt>, or two string values t<sub>1</sub>=s<sub>1</sub> and t<sub>2</sub>=s<sub>2</sub>, respectively, then <i>res</i> = <tt>-1</tt>, <tt>0</tt>, or <tt>1</tt> (from the value space of <tt>xs:integer</tt>), depending on whether the value of s<sub>1</sub> is respectively less than, equal to, or greater than the value of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].</p>
<p>
In case an argument value is outside of its domain, or if the language tags of the values for <tt>?comparand<sub>1</sub></tt> and <tt>$comparand<sub>2</sub></tt> differ, the function value is left unspecified.
That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:PlainLiteral-length_.28adapted_from_plfn:length.29" name="func:PlainLiteral-length_.28adapted_from_plfn:length.29"></a><h4> <span class="mw-headline">4.10.1.5 <tt>func:PlainLiteral-length</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:length" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:length">plfn:length</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?arg ; func:PlainLiteral-length( ?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>rdf:PlainLiteral</tt> for ?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>( ?arg ; func:PlainLiteral-length( ?arg ) )(s) = <i>res</i>
such that <i>res</i> is a value in the value space of <tt>xs:integer</tt> equal to the length in characters of the string part <i>s</i> of the argument if it is a pair ( <i>s</i>,l ), or the argument is a string value <i>s</i>, respectively.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_rdf:PlainLiteral" name="Predicates_on_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.10.2 Predicates on rdf:PlainLiteral </span></h3>
<a id="pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29" name="pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29"></a><h4> <span class="mw-headline">4.10.2.1 <tt>pred:matches-language-range</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range">plfn:matches-language-range</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
( ?input ?range; pred:matches-language-range( ?input ?range) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for <tt>?input</tt> and the values of value space <tt>xs:string</tt> that correspond to valid language tags according to [<a href="#ref-bcp-47" title="">BCP-47</a>] for <tt>?range</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p>Whenever both arguments are within their domains,
<p><i><b>I</b></i><sub>external</sub> ( ?input ?range; pred:matches-language-range( ?input ?range) )(i r) = <b>t</b>
if and only if <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range">plfn:matches-language-range</a></tt>(i r)
as specified in [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>] returns <tt>true</tt>, <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the predicate is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_RIF_Lists" name="Functions_and_Predicates_on_RIF_Lists"></a><h2> <span class="mw-headline">4.11 Functions and Predicates on RIF Lists </span></h2>
<p>RIF Lists are similar to list and array types in many systems, as well
as <a class="external text" href="http://www.w3.org/TR/xpath-functions/#sequence-functions" title="http://www.w3.org/TR/xpath-functions/#sequence-functions">XPath/XQuery Sequences</a> [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. They differ from XPath as follows:
</p>
<ul><li> They are called "lists" instead of sequences (so the "subsequence" function is called "sublist")
</li><li> Positions (indexes) count from zero, instead of one, and negative indexes are defined to count back from the end of the list
</li><li> They are not limited to containing only atomic data; in particular, they may contain other lists.
</li><li> There is no equivalence between an atomic value and a singleton list; in RIF these are distinct values.
</li></ul>
<a id="Position_Numbering" name="Position_Numbering"></a><h3> <span class="mw-headline">4.11.1 Position Numbering </span></h3>
<p>The positions in a list are numbered starting with zero.
That is, in a list of length n+1, the first item
has position 0, and the last item has position n.
When a negative position number is provided to a builtin,
the length of the list is added to it before it is used, so it
effectively counts backward from the end of the list: position -1
points to the last item in the list, i.e. corresponds effectively to position n, etc.
</p>
<a id="Item_Comparison" name="Item_Comparison"></a><h3> <span class="mw-headline">4.11.2 Item Comparison </span></h3>
<p>List items are compared for equality (as required by many of these
builtins) using normal RIF equality testing, not datatype equality (e.g.,
pred:numeric-equal).
</p><p>Several list builtins need to establish inequality in order to compute
a result. If all the compared items are literals or lists, this is
not a problem, but if they are rif:local or rif:iri terms, the
knowledge base is unlikely to contain inequality information. This
may lead to counter-intuitive results. For example, the empty ruleset
does not entail <tt>External(func:index-of( List(ex:foo ex:bar) ex:foo) ) == List(0)</tt>,
because the empty ruleset provides no indication whether <tt>eg:foo =
eg:bar</tt>.
</p>
<a id="Predicates_on_RIF_Lists" name="Predicates_on_RIF_Lists"></a><h3> <span class="mw-headline">4.11.3 Predicates on RIF Lists </span></h3>
<a id="pred:is-list" name="pred:is-list"></a><h4> <span class="mw-headline">4.11.3.1 <tt>pred:is-list</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?object; pred:is-list(?object))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?object: unrestricted<br />
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?object; pred:is-list ( ?object ) )(s) = <b>t</b> if and only if there exists some (t<sub>0</sub>, ... , t<sub>n</sub>) such that either <i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>n</sub>) = s or <i><b>I</b></i><sub>tail</sub>(t<sub>0</sub>, ... , t<sub>n</sub>) = s, and <b>f</b> otherwise.</p>
<p>Note, that since the syntactic forms of open and closed lists using the <tt>List</tt> operator refer to <i><b>I</b></i><sub>list</sub><sup>-1</sup> and <i><b>I</b></i><sub>tail</sub><sup>-1</sup>, respectively, <tt>pred:is-list</tt> is always true on these syntactic forms. Further note that per definition <i><b>I</b></i><sub>list</sub>(D<sub>ind</sub>) is disjoint from the value spaces of all data types in <i><b>DTS</b></i>, and consequently <tt>pred:is-list</tt> is always false on constants belonging to a datatype supported by the RIF dialect at hand. this is illustrated by the following examples.</p>
</li>
<li>
<em>Examples</em>
<ul>
<li><tt>External(pred:is-list(List(0 1 2 3)))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(1))</tt> will evaluate to <b>f</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(0 1 2 List(3 4))))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(0 1 2 | List(3 4))))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(1 | 2)))</tt> will evaluate to <b>t</b> in any interpretation.
</li></ul>
</li>
</ul>
<a id="pred:list-contains" name="pred:list-contains"></a><h4> <span class="mw-headline">4.11.3.2 <tt>pred:list-contains</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?item; pred:list-contains(?list ?item))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?item: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>
<p><i><b>I</b></i><sub>truth</sub><tt> ο </tt><i><b>I</b></i><sub>external</sub>( ?list ?item; pred:list-contains ( ?list ?item ) )(l s) = <b>t</b> if and only if I<sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that t<sub>i</sub> = s for some i between 0 and n, and <b>f</b> otherwise.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>
<ul>
<li><tt>External(pred:list-contains(List(0 1 2 3 4) 2)</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 4 5 2 2) 2)</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(2 2 3 4 5 2 2) 1)</tt> will evaluate to <b>f</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List() 1)</tt> will evaluate to <b>f</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 List(7 8)) List(7 8))</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 List(7 8)) List(7 7))</tt> will evaluate to <b>f</b> in any interpretation.</li></ul>
</li>
</ul>
<a id="Functions_on_RIF_Lists" name="Functions_on_RIF_Lists"></a><h3> <span class="mw-headline">4.11.4 Functions on RIF Lists </span></h3>
<a id="func:make-list" name="func:make-list"></a><h4> <span class="mw-headline">4.11.4.1 <tt>func:make-list</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?item<sub>1</sub> ... ?item<sub>n</sub>; func:make-list(?item<sub>1</sub> ... ?item<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?item0: unrestricted<br />
...<br />
?item<i>n</i>: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list of the arguments ?item<sub>1</sub>, ... ?item<sub>n</sub>, in the same order they appear as arguments. That is,
<i><b>I</b></i><sub>external</sub>( ?item<sub>1</sub> ... ?item<sub>n</sub>; func:make-list( ?item<sub>1</sub> ... ?item<sub>n</sub> ) )(s<sub>1</sub> ... s<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(s<sub>1</sub> ... s<sub>n</sub>)</p>
</li>
<li>
<em>Note</em>:
<p>This function is useful in RIF Core because the List construction operator is syntactically prohibited from being used with variables.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:make-list(0 1 2) ) = List(0 1 2)
External( func:make-list() ) = List()
External( func:make-list(0) ) = List(0)
External( func:make-list(0 1 List(20 21))) = List(0 1 List(20 21))
External( func:make-list(List(0 1))) = List(List(0 1))</pre>
</li>
</ul>
<a id="func:count_.28adapted_from_fn:count.29" name="func:count_.28adapted_from_fn:count.29"></a><h4> <span class="mw-headline">4.11.4.2 <tt>func:count</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-count" title="http://www.w3.org/TR/xpath-functions/#func-count">fn:count</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:count(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the number of entries in the list (the length of the list). That is,
<i><b>I</b></i><sub>external</sub>( ?list; func:count( ?list ) )(l) = n if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n-1</sub>) is an element of <i><b>D</b></i><sub>ind</sub><sup>n</sup>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>
External(func:count(List(0 1 2 3 4))) = 5
External(func:count(List(0))) = 1
External(func:count(List(0 0 0))) = 3
External(func:count(List())) = 0</pre>
</li>
</ul>
<a id="func:get" name="func:get"></a><h4> <span class="mw-headline">4.11.4.3 <tt>func:get</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?position; func:get(?list ?position))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?position: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the item at the given position in the list. That is,
<i><b>I</b></i><sub>external</sub>( ?list ?position; func:get(?list ?position) )(l i) = t<sub>i</sub> if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:get(List(0 1 2 3 4) 0) ) = 0
External( func:get(List(0 1 2 3 4) 1) ) = 1
External( func:get(List(0 1 2 3 4) 4) ) = 4
External( func:get(List(0 1 2 3 4) -1) ) = 4
External( func:get(List(0 1 2 3 4) -5) ) = 0
External( func:get(List(0 1 2 3 4) -10) ) = (unspecified)
External( func:get(List(0 1 2 3 4) 5) ) = (unspecified)</pre>
</li>
</ul>
<a id="func:sublist_.28adapted_from_fn:subsequence.29" name="func:sublist_.28adapted_from_fn:subsequence.29"></a><h4> <span class="mw-headline">4.11.4.4 <tt>func:sublist</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subsequence" title="http://www.w3.org/TR/xpath-functions/#func-subsequence">fn:subsequence</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?start ?stop; func:sublist(?list ?start ?stop))</tt></p>
<p><tt>(?list ?start; func:sublist(?list ?start))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?start: value space of xs:int<br />
?stop: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list, containing (in order) the items starting at position '?start' and continuing up to, but not including, the '?stop' position, if '?start' is before '?stop'. The '?stop' position may be omitted, in which case it defaults to the length of the list.
That is,
<i><b>I</b></i><sub>external</sub>( ?list ?start ?stop; func:sublist(?list ?start ?stop) )(l i j) = <i><b>I</b></i><sub>list</sub>(t<sub>i</sub> ... t<sub>j</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that i and j correspond to positions between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>. In case i is omitted it defaults to n.</p>
<p>If an argument value is outside of its domain or, respectively, i and j do not correspond to positions between 0 and n such that the corresponding position of i is smaller than the corresponding position of j, as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Note</em>:
<p>This differs from XPath's <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subsequence" title="http://www.w3.org/TR/xpath-functions/#func-subsequence">fn:subsequence</a> function in using a 'stop' position parameter instead of a 'length' parameter (in addition to the name change, the zero-based indexing, and allowing negative indexes).</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:sublist(List(0 1 2 3 4) 0 0) ) = List()
External( func:sublist(List(0 1 2 3 4) 0 1) ) = List(0)
External( func:sublist(List(0 1 2 3 4) 0 4) ) = List(0 1 2 3)
External( func:sublist(List(0 1 2 3 4) 0 5) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 0 10) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 0 -2) ) = List(0 1 2)
External( func:sublist(List(0 1 2 3 4) 2 4) ) = List(2 3)
External( func:sublist(List(0 1 2 3 4) 2 -2) ) = List(2)
External( func:sublist(List(0 1 2 3 4) 0) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 3) ) = List(3 4)
External( func:sublist(List(0 1 2 3 4) -2) ) = List(3 4)</pre>
</li>
</ul>
<a id="func:append" name="func:append"></a><h4> <span class="mw-headline">4.11.4.5 <tt>func:append</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?item<sub>1</sub> ... ?item<sub>n</sub>; func:append(?list ?item<sub>1</sub> ... ?item<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?item<sub>1</sub>: unrestricted<br />
...<br />
?item<sub>n</sub>: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list consisting of all the items in ?list, followed by ?item<sub>i</sub>, for each i, 1 <= i <= n.
That is, <i><b>I</b></i><sub>external</sub>( ?list ?item<sub>1</sub> ... ?item<sub>n</sub>; func:append(?list ?item<sub>1</sub> ... ?item<sub>n</sub>) )(l s<sub>1</sub> ... s<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>k</sub> s<sub>1</sub> ... s<sub>n</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>k</sub>).</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:append(List(0 1 2) 3) )= List(0 1 2 3)
External( func:append(List(0 1 2) 3 4) ) = List(0 1 2 3 4)
External( func:append(List(1 1) List(1) List(1) List(List(1))) ) = List(1 1 List(1) List(1) List(List(1)))
External( func:append(List() 1) ) = List(1)</pre>
</li>
</ul>
<a id="func:concatenate_.28adapted_from_fn:concatenate.29" name="func:concatenate_.28adapted_from_fn:concatenate.29"></a><h4> <span class="mw-headline">4.11.4.6 <tt>func:concatenate</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concatenate" title="http://www.w3.org/TR/xpath-functions/#func-concatenate">fn:concatenate</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ... ?list<sub>n</sub>; func:concatenate(?list<sub>1</sub> ... ?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
?list<sub>n</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list consisting of all the items in list<sub>1</sub>, followed by all the items in list<sub>i</sub>, for each i <= n. That is, <i><b>I</b></i><sub>external</sub>( ?list<sub>1</sub> ... ?list<sub>n</sub>; func:concatenate(?list<sub>1</sub> ... ?list<sub>n</sub>) )(l<sub>1</sub> ... l<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(t<sub>1,0</sub> ... t<sub>1,k<sub>1</sub></sub> ... t<sub>n,0</sub> ... t<sub>n,k<sub>n</sub></sub>) if, for each i between 1 and n, <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l<sub>i</sub>) = (t<sub>i,0</sub> ... t<sub>i,k<sub>i</sub></sub>).</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:concatenate(List(0 1 2) List(3 4 5)) ) = List(0 1 2 3 4 5)
External( func:concatenate(List(1 1) List(1) List(1)) ) = List(1 1 1 1)
External( func:concatenate(List())) = List()
External( func:concatenate(List() List(1) List() List(2)) ) = List(1 2)</pre>
</li>
</ul>
<a id="func:insert-before_.28adapted_from_fn:insert-before.29" name="func:insert-before_.28adapted_from_fn:insert-before.29"></a><h4> <span class="mw-headline">4.11.4.7 <tt>func:insert-before</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-insert-before" title="http://www.w3.org/TR/xpath-functions/#func-insert-before">fn:insert-before</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?position ?newItem; func:insert-before(?list ?position ?newItem))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?position: value space of xs:int<br />
?newItem: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Return a list which is ?list, except that
?newItem is inserted at the given ?position, with the item (if
any) that was at that position, and all following items, shifted
down one position. That is,
<i><b>I</b></i><sub>external</sub>( ?list ?position ?newItem;
func:insert-before(?list ?position ?newItem) )(l i s) =
<i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>i-1</sub> s
t<sub>i</sub> ... t<sub>n</sub>) if
<i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:insert-before(List(0 1 2 3 4) 0 99) ) = List(99 0 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) 1 99) ) = List(0 99 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) 5 99) ) = (unspecified)
External( func:insert-before(List(0 1 2 3 4) -1 99) ) = List(0 1 2 3 99 4)
External( func:insert-before(List(0 1 2 3 4) -5 99) ) = List(99 0 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) -10 99) ) = (unspecified)</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:remove_.28adapted_from_fn:remove.29" name="func:remove_.28adapted_from_fn:remove.29"></a><h4> <span class="mw-headline">4.11.4.8 <tt>func:remove</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-remove" title="http://www.w3.org/TR/xpath-functions/#func-remove">fn:remove</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?position; func:remove(?list ?position))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?position: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list which is ?list except that the item at the
given ?position has been removed. That is,
<i><b>I</b></i><sub>external</sub>( ?list ?position;
func:remove(?list ?position) )(l i) =
<i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>i-1</sub>
t<sub>i+1</sub> ... t<sub>n</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:remove(List(0 1 2 3 4) 0) ) = List(1 2 3 4)
External( func:remove(List(0 1 2 3 4) 1) ) = List(0 2 3 4)
External( func:remove(List(0 1 2 3 4) 4) ) = List(0 1 2 3)
External( func:remove(List(0 1 2 3 4) 5) ) = (unspecified)
External( func:remove(List(0 1 2 3 4) 6) ) = (unspecified)
External( func:remove(List(0 1 2 3 4) -1) ) = List(0 1 2 3)
External( func:remove(List(0 1 2 3 4) -5) ) = List(1 2 3 4)
External( func:remove(List(0 1 2 3 4) -6) ) = (unspecified)</pre>
</li>
</ul>
<p><br />
</p><p><br />
</p>
<a id="func:reverse_.28adapted_from_fn:reverse.29" name="func:reverse_.28adapted_from_fn:reverse.29"></a><h4> <span class="mw-headline">4.11.4.9 <tt>func:reverse</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-reverse" title="http://www.w3.org/TR/xpath-functions/#func-reverse">fn:reverse</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:reverse(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Return a list with all the items in ?list, but in
reverse order. That is,
<i><b>I</b></i><sub>external</sub>( ?list;
func:reverse(?list) )(l) =
<i><b>I</b></i><sub>list</sub>(t<sub>n</sub> ... t<sub>0</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>).</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:reverse(List(0 1 2 3 4)) ) = List(4 3 2 1 0)
External( func:reverse(List(1)) ) = List(1)
External( func:reverse(List()) ) = List()</pre>
</li>
</ul>
<p><br />
</p><p><br />
</p>
<a id="func:index-of_.28adapted_from_fn:index-of.29" name="func:index-of_.28adapted_from_fn:index-of.29"></a><h4> <span class="mw-headline">4.11.4.10 <tt>func:index-of</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-index-of" title="http://www.w3.org/TR/xpath-functions/#func-index-of">fn:index-of</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list ?matchValue; func:index-of(?list ?matchValue))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?matchValue: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the ascending list of all integers, i>=0, such that
External( func:get(?list,i) ) = ?matchValue. That is,
<i><b>I</b></i><sub>external</sub>(?list ?matchValue; func:index-of(?list ?matchValue))(l v) =
<i><b>I</b></i><sub>list</sub>(i<sub>1</sub> ... i<sub>k</sub>) if
<i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that (i<sub>1</sub> ... i<sub>k</sub>) is
the ordered list of positions (as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>) between 0 and n with
t<sub>i<sub>1</sub></sub> = ... = t<sub>i<sub>k</sub></sub> = v.
</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:index-of(List(0 1 2 3 4) 2) ) = List(2)
External( func:index-of(List(0 1 2 3 4 5 2 2) 2) ) = List(2 6 7)
External( func:index-of(List(2 2 3 4 5 2 2) 2) ) = List(0 1 5 6)
External( func:index-of(List(2 2 3 4 5 2 2) 1) ) = List()</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:union_.28inspired_by_fn:union.29" name="func:union_.28inspired_by_fn:union.29"></a><h4> <span class="mw-headline">4.11.4.11 <tt>func:union</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-union" title="http://www.w3.org/TR/xpath-functions/#func-union">fn:union</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ... ?list<sub>n</sub>; func:union(?list<sub>1</sub> ... ?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list-1: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
?list-n: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list containing all the items in ?list<sub>1</sub>, ..., ?list<sub>n</sub>, in the same order, but with all duplicates removed.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Note</em>:
<p> <tt>External( func:union(list<sub>1</sub> ... list<sub>n</sub>) )</tt> is equivalent to <tt>External( func:distinct_values(External( func:concatenate(list<sub>1</sub> ... list<sub>n</sub>) ) ) )</tt>.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:union(List(0 1 2 4) List(3 4 5 6)) ) = List(0 1 2 4 3 5 6)
External( func:union(List(0 1 2 3) List(4)) ) = List(0 1 2 3 4)
External( func:union(List(0 1 2 3) List(3)) ) = List(0 1 2 3)</pre>
External( func:union(List(0 2 1 0)) ) = List( 0 2 1 ) </li>
</ul>
<a id="func:distinct-values_.28adapted_from_fn:distinct-values.29" name="func:distinct-values_.28adapted_from_fn:distinct-values.29"></a><h4> <span class="mw-headline">4.11.4.12 <tt>func:distinct-values</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-distinct-values" title="http://www.w3.org/TR/xpath-functions/#func-distinct-values">fn:distinct-values</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:distinct-values(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are in ?list, in the order of first appearance, except that all except the first occurance of any item are deleted.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:distinct-values(List(0 1 2 3 4)) ) = List(0 1 2 3 4)
External( func:distinct-values(List(0 1 2 3 4 0 4)) ) = List(0 1 2 3 4)
External( func:distinct-values(List(3 3 3)) ) = List(3)</pre>
</li>
</ul>
<a id="func:intersect_.28inspired_by_fn:intersect.29" name="func:intersect_.28inspired_by_fn:intersect.29"></a><h4> <span class="mw-headline">4.11.4.13 <tt>func:intersect</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-intersect" title="http://www.w3.org/TR/xpath-functions/#func-intersect">fn:intersect</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ... ?list<sub>n</sub>; func:intersect(?list<sub>1</sub> ... ?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
?list<sub>n</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are common to all argument lists. The order of the items in the returned list is the same as the order in ?list<sub>1</sub>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:intersect(List(0 1 2 3 4) List(1 3)) ) = List(1 3)
External( func:intersect(List(0 1 2 3 4) List(3 1)) ) = List(1 3)
External( func:intersect(List(0 1 2 3 4) List()) ) = List()
External( func:intersect(List(0 1 2 3 4) List(0 1 2 3 4 5 6)) ) = List(0 1 2 3 4)</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:except_.28inspired_by_fn:except.29" name="func:except_.28inspired_by_fn:except.29"></a><h4> <span class="mw-headline">4.11.4.14 <tt>func:except</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-except" title="http://www.w3.org/TR/xpath-functions/#func-except">fn:except</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ?list<sub>2</sub>; func:except(?list<sub>1</sub> ?list<sub>2</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
?list<sub>2</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are in ?list<sub>1</sub> and not in ?list<sub>2</sub>.
The order of the items is the same as in ?list<sub>1</sub>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:except(List(0 1 2 3 4) List(1 3)) ) = List(0 2 4)
External( func:except(List(0 1 2 3 4) List()) ) = List(0 1 2 3 4)
External( func:except(List(0 1 2 3 4) List(0 1 2 3 4)) ) = List()</pre>
</li>
</ul>
<a id="References" name="References"></a><h1> <span class="mw-headline">5 References </span></h1>
<p><span class="anchor" id="ref-bcp-47"></span>
</p>
<dl><dt> [BCP-47]
</dt><dd> <i>BCP 47 - Tags for the Identification of Languages</i>, A. Phillips, M. Davis, IETF, Sep 2006, <a class="external free" href="http://tools.ietf.org/html/bcp47" title="http://tools.ietf.org/html/bcp47">http://tools.ietf.org/html/bcp47</a>.
</dd></dl>
<p><span class="anchor" id="ref-curie"></span>
</p>
<dl><dt> [CURIE]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/2009/CR-curie-20090116/" title="http://www.w3.org/TR/2009/CR-curie-20090116/">CURIE Syntax 1.0</a></i>, M. Birbeck, S. McCarron, W3C Candidate Recommendation, 16 January 2009, <a class="external free" href="http://www.w3.org/TR/2009/CR-curie-20090116/" title="http://www.w3.org/TR/2009/CR-curie-20090116/">http://www.w3.org/TR/2009/CR-curie-20090116/</a>. <a class="external text" href="http://www.w3.org/TR/curie/" title="http://www.w3.org/TR/curie/">Latest version</a> available at <a class="external free" href="http://www.w3.org/TR/curie/" title="http://www.w3.org/TR/curie/">http://www.w3.org/TR/curie/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-concepts"></span>
</p>
<dl><dt> [RDF-CONCEPTS]
</dt><dd> <i>Resource Description Framework (RDF): Concepts and Abstract Syntax</i>, G. Klyne, J. Carroll (Editors), W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-concepts/" title="http://www.w3.org/TR/rdf-concepts/">http://www.w3.org/TR/rdf-concepts/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-semantics"></span>
</p>
<dl><dt> [RDF-SEMANTICS]
</dt><dd> <i>RDF Semantics</i>, P. Hayes, Editor, W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/">http://www.w3.org/TR/2004/REC-rdf-mt-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-mt/" title="http://www.w3.org/TR/rdf-mt/">http://www.w3.org/TR/rdf-mt/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-schema"></span>
</p>
<dl><dt> [RDF-SCHEMA]
</dt><dd> <i>RDF Vocabulary Description Language 1.0: RDF Schema</i>, B. McBride, Editor, W3C Recommendation 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-schema-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-schema-20040210/">http://www.w3.org/TR/2004/REC-rdf-schema-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-schema/" title="http://www.w3.org/TR/rdf-schema/">http://www.w3.org/TR/rdf-schema/</a>.
</dd></dl>
<dl><dt> <span id="ref-rdf-PlainLiteral">[RDF-PLAINLITERAL]</span>
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/" title="http://www.w3.org/TR/rdf-plain-literal/"><tt>rdf:PlainLiteral</tt>: A Datatype for RDF Plain Literals</a></i>, J. Bao, S. Hawke, B. Motik, P.F. Patel-Schneider, A. Polleres (Editors), W3C Candidate Recommendation, 11 June 2009, http://www.w3.org/TR/2009/CR-rdf-plain-literal-20090611/. Latest version available at http://www.w3.org/TR/rdf-plain-literal/.
</dd></dl>
<p><span class="anchor" id="ref-rfc-3986"></span>
</p>
<dl><dt> [RFC-3986]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3986" title="http://tools.ietf.org/html/rfc3986">RFC 3986</a> - Uniform Resource Identifier (URI): Generic Syntax</i>, T. Berners-Lee, R. Fielding, L. Masinter, IETF, January 2005, <a class="external free" href="http://www.ietf.org/rfc/rfc3986.txt" title="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a>.
</dd></dl>
<p><span class="anchor" id="ref-rfc-3987"></span>
</p>
<dl><dt> [RFC-3987]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3987" title="http://tools.ietf.org/html/rfc3987">RFC 3987</a> - Internationalized Resource Identifiers (IRIs)</i>, M. Duerst and M. Suignard, IETF, January 2005, <a class="external free" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">http://www.ietf.org/rfc/rfc3987.txt</a>.
</dd></dl>
<p><span class="anchor" id="ref-rif-bld"></span>
</p>
<dl><dt> [RIF-BLD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/"><span>RIF Basic Logic Dialect</span></a></cite> Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">http://www.w3.org/TR/2010/REC-rif-bld-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-bld/">http://www.w3.org/TR/rif-bld/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-core"></span>
</p>
<dl><dt> [RIF-Core]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/"><span>RIF Core Dialect</span></a></cite> Harold Boley, Gary Hallmark, Michael Kifer, Adrian Paschke, Axel Polleres, Dave Reynolds, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">http://www.w3.org/TR/2010/REC-rif-core-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-core/">http://www.w3.org/TR/rif-core/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-fld"></span>
</p>
<dl><dt> [RIF-FLD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/"><span>RIF Framework for Logic Dialects</span></a></cite> Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/">http://www.w3.org/TR/2010/REC-rif-fld-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-fld/">http://www.w3.org/TR/rif-fld/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-prd"></span>
</p>
<dl><dt> [RIF-PRD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/"><span>RIF Production Rule Dialect</span></a></cite> Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">http://www.w3.org/TR/2010/REC-rif-prd-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-prd/">http://www.w3.org/TR/rif-prd/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-sparql"></span>
</p>
<dl><dt> [SPARQL]
</dt><dd> <i>SPARQL Query Language for RDF</i>, E. Prud'hommeaux, A. Seaborne (Editors), W3C Recommendation, World Wide Web Consortium, 12 January 2008, <a class="external free" href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/" title="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/">http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/" title="http://www.w3.org/TR/rdf-sparql-query/">http://www.w3.org/TR/rdf-sparql-query/</a>.
</dd></dl>
<p><span class="anchor" id="ref-swrl"></span>
</p>
<dl><dt> [SWRL]
</dt><dd> <i><a class="external text" href="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/" title="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/">SWRL: A Semantic Web Rule Language Combining OWL and RuleML</a></i>, I. Horrocks, P. F. Patel-Schneider, H. Boley, S. Tabet, B., M. Dean, W3C Member Submission, 21 May 2004, <a class="external free" href="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/" title="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/">http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/</a>. <a class="external text" href="http://www.w3.org/Submission/SWRL/" title="http://www.w3.org/Submission/SWRL/">Latest version</a> available at <a class="external free" href="http://www.w3.org/Submission/SWRL/" title="http://www.w3.org/Submission/SWRL/">http://www.w3.org/Submission/SWRL/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xdm"></span>
</p>
<dl><dt> [XDM]
</dt><dd> <i>XQuery 1.0 and XPath 2.0 Data Model (XDM)</i>, M. Fernández, A. Malhotra, J. Marsh, M. Nagy, N. Walsh (Editors), W3C Recommendation, World Wide Web Consortium, 23 January 2007. This version is <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/" title="http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/">http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xpath-datamodel/" title="http://www.w3.org/TR/xpath-datamodel/">http://www.w3.org/TR/xpath-datamodel/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xml-ns"></span>
</p>
<dl><dt> [XML-NS]
</dt><dd> <i>Namespaces in XML 1.1 (Second Edition)</i>, T. Bray, D. Hollander, A. Layman, R. Tobin (Editors), W3C Recommendation, World Wide Web Consortium, 16 August 2006, <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/">http://www.w3.org/TR/2006/REC-xml-names11-20060816/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xml-names11/" title="http://www.w3.org/TR/xml-names11/">http://www.w3.org/TR/xml-names11/</a>.
</dd></dl>
<dl><dt> <span id="ref-xml-schema2">[XML Schema Datatypes]</span>
</dt><dd> <cite><a class="external text" href="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/" title="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/">W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</a></cite>. David Peterson, Shudi Gao, Ashok Malhotra, C. M. Sperberg-McQueen, and Henry S. Thompson, eds. W3C Candidate Recommendation, 30 April 2009, http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/. Latest version available as http://www.w3.org/TR/xmlschema11-2/.
</dd></dl>
<p><span class="anchor" id="ref-xpath"></span>
</p>
<dl><dt> [XPath]
</dt><dd> <i>XML Path Language (XPath) 2.0</i>, A. Berglund, S. Boag, D. Chamberlin, M. F. Fernández, M, Kay, J. Robie, J. Siméon (Editors), W3C Recommendation, World Wide Web Consortium, 23 January 2007, <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/">http://www.w3.org/TR/2007/REC-xpath20-20070123/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xpath20/" title="http://www.w3.org/TR/xpath20/">http://www.w3.org/TR/xpath20/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xpath-functions"></span>
</p>
<dl><dt> [XPath-Functions]
</dt><dd> <i>XQuery 1.0 and XPath 2.0 Functions and Operators</i>, A. Malhotra, J. Melton, N. Walsh (Editors), W3C Recommendation, World Wide Web Consortium, 23 January 2007, <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/">http://www.w3.org/TR/2007/REC-xpath-functions-20070123/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xpath-functions/" title="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</a>.
</dd></dl>
<p><span class="anchor" id="app-external-schema"></span>
</p>
<a id="Appendix:_Schemas_for_Externally_Defined_Terms" name="Appendix:_Schemas_for_Externally_Defined_Terms"></a><h1> <span class="mw-headline">6 Appendix: Schemas for Externally Defined Terms </span></h1>
<p>The <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF Framework for Logic Dialects</a> introduces a general notion of externally defined terms and their schemes. However, <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a> and the present document use only restricted kinds of external terms. To make this document self-contained, this appendix provides a complete description of these restricted notions.
</p><p>In <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a>, an external term is an expression of the form <tt>External(id τ)</tt>, where <tt>id</tt> is a term that identifies the source that defines the term <tt>τ</tt> and <tt>τ</tt> itself can be a constant, a positional or named-arguments term, a frame, an equality, or a classification term. In <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a>, only positional and named-argument terms are allowed as <tt>τ</tt>, and RIF-DTB builtins can only be positional terms. So, only a <i><b>restricted kind of external terms</b></i> is used: <tt>External(τ)</tt>, where <tt>τ</tt> has one of the aforementioned forms. If <tt>τ</tt> is a term of the form <tt>p(...)</tt> then <tt>External(τ)</tt> is treated as a shorthand for <tt>External(p τ)</tt>, but this extended 2-argument form of <tt>External</tt> itself is not allowed in RIF-BLD.
</p><p><i>External schemas</i> serve as templates for externally defined terms. These schemas determine which externally defined terms are acceptable in a RIF dialect. Externally defined terms include RIF built-ins, but are more general. They are designed to also accommodate the ideas of procedural attachments and querying of external data sources.
</p><p><span class="anchor" id="def-external-schema"></span>
<b>Definition (Schema for external term).</b>
An <i><b> external schema</b></i> is a statement of the form <tt>(?X<sub>1</sub> ... ?X<sub>n</sub>; τ)</tt> where
</p>
<ul>
<li>
<tt>τ</tt> is a positional or a named-argument term.
</li>
<li>
<tt>?X<sub>1</sub> ... ?X<sub>n</sub></tt> is a list of all distinct variables that occur in <tt>τ</tt>
</li>
</ul>
<p>The names of the variables in an external schema are immaterial, but their order is important. For instance, <tt>(?X ?Y; ?X[foo->?Y])</tt> and <tt>(?V ?W; ?V[foo->?W])</tt> are considered to be indistinguishable, but <tt>(?X ?Y; ?X[foo->?Y])</tt> and <tt>(?Y ?X; ?X[foo->?Y])</tt> are viewed as different schemas.
</p><p>Note that <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a> defines external schemas as triples <tt>(id; ?X<sub>1</sub> ... ?X<sub>n</sub>; τ)</tt>, where <tt>id</tt> is the identifying term for the schema's source. However, since RIF-BLD uses a simplified version of externally defined terms in which <tt>id</tt> is determined by the predicate/function name in <tt>τ</tt>, the <tt>id</tt>-part is omitted in the above simplified version of external schemas.
</p><p>A term <tt>t</tt> is an <i><b>instantiation</b></i> of an external schema <tt>(?X<sub>1</sub> ... ?X<sub>n</sub>; τ)</tt> iff <tt>t</tt> can be obtained from <tt>τ</tt> by a simultaneous substitution <tt>?X<sub>1</sub>/s<sub>1</sub> ... ?X<sub>n</sub>/s<sub>n</sub></tt> of the variables <tt>?X<sub>1</sub> ... ?X<sub>n</sub></tt> with terms <tt>s<sub>1</sub> ... s<sub>n</sub></tt>, respectively. Some of the terms <tt>s<sub>i</sub></tt> can be variables themselves. For example, <tt>?Z[foo->f(a ?P)]</tt> is an instantiation of <tt>(?X ?Y; ?X[foo->?Y])</tt> by the substitution <tt>?X/?Z ?Y/f(a ?P)</tt>. ☐
</p><p>Observe that a variable cannot be an instantiation of an external schema, since <tt>τ</tt> in the above definition cannot be a variable. It will be seen later that this implies that a term of the form <tt>External(?X)</tt> is not well-formed in RIF.
</p><p>The intuition behind the notion of an external schema, such as <tt>(?X ?Y; ?X["foo"^^xs:string->?Y])</tt> or <tt>(?V; "pred:isTime"^^rif:iri(?V))</tt>, is that <tt>?X["foo"^^xs:string->?Y]</tt> or <tt>"pred:isTime"^^rif:iri(?V)</tt> are invocation patterns for querying external sources, and instantiations of those schemas correspond to concrete invocations. Thus, <tt>External("http://foo.bar.com"^^rif:iri["foo"^^xs:string->"123"^^xs:integer])</tt> and <tt>External("pred:isTime"^^rif:iri("22:33:44"^^xs:time)</tt> are examples of invocations of external terms -- one querying an external source and another invoking a built-in.
</p><p><br />
<span class="anchor" id="def-external-schema-set"></span>
<b>Definition (Coherent set of external schemas).</b>
A set of external schemas is <i><b>coherent</b></i> if there is no term, <tt>t</tt>, that is an instantiation of two distinct schemas in the set. ☐
</p><p>The intuition behind this notion is to ensure that any use of an external term is associated with at most one external schema. This assumption is relied upon in the definition of the semantics of externally defined terms. Note that the coherence condition is easy to verify syntactically and that it implies that schemas like <tt>(?X ?Y; ?X[foo->?Y])</tt> and <tt>(?Y ?X; ?X[foo->?Y])</tt>, which differ only in the order of their variables, cannot be in the same coherent set.
</p><p>It is important to keep in mind that external schemas are <i>not</i> part of the language in RIF, since they do not appear anywhere in RIF statements. Instead, they are best thought of as part of the grammar of the language.
</p><p><br />
<span class="anchor" id="sec-changelog"></span>
</p>
<div id="changelog">
<a id="Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010" name="Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010"></a><h1> <span class="mw-headline">7 Appendix: Changes from Candidate Recommendation Version of October 1, 2010 </span></h1>
<ul><li> AT RISK notes were removed.
</li><li> Misnamed references were fixed [XML-SCHEMA2] -> [XML Schema Datatypes]
</li><li> Added new section <a href="#XML_Schema_Datatypes" title="">2.3.1 XML Schema Datatypes</a> to clarify the status of references to XSD 1.1. This is analogous to the treatment of references to XSD1.1 in <a class="external text" href="http://www.w3.org/TR/2009/REC-owl2-conformance-20091027/#XML_Schema_Datatypes" title="http://www.w3.org/TR/2009/REC-owl2-conformance-20091027/#XML_Schema_Datatypes">OWL2</a>
</li></ul>
</div>
</body>
</html>