-
Notifications
You must be signed in to change notification settings - Fork 13
/
functions.xml
159 lines (135 loc) · 3.8 KB
/
functions.xml
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
<sparqlifyConfig>
<!-- TODO Property... -->
<namespaces>
<namespace>
<prefix>bif</prefix><uri>http://foobar.org/</uri>
</namespace>
</namespaces>
<!-- Postgis Geometry Constructors -->
<!-- Source: http://postgis.net/docs/reference.html#Geometry_Constructors -->
<!-- NOTE: GeomFromPoint already needs a template... -->
<simpleFunctions>
<simpleFunction>
<name>strstarts</name>
<mappings>
<mapping>
<signature>boolean strstarts(string, string)</signature>
<pattern>(strpos($1$, $2$) = 1)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>strends</name>
<mappings>
<mapping>
<signature>boolean strends(string, string)</signature>
<pattern>(right($1$, length($2$)) = $2$)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>strafter</name>
<mappings>
<mapping>
<signature>boolean strafter(string, string)</signature>
<pattern>(case when strpos($1$, $2$) != 0 then substr($1$, strpos($1$, $2$) + length($2$) else '' end)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>ucase</name>
<mappings>
<mapping>
<signature>string ucase(string)</signature>
<pattern>(upper($1$))</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>lcase</name>
<mappings>
<mapping>
<signature>string lcase(string)</signature>
<pattern>(lower($1$))</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>contains</name>
<mappings>
<mapping>
<signature>boolean contains(string, string)</signature>
<pattern>(strpos($1$, $2$) != 0)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>regex</name>
<mappings>
<mapping>
<signature>boolean regex(string, string)</signature>
<pattern>($1$ ~ $2$)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>regex</name>
<mappings>
<mapping>
<signature>boolean regex(string, string, string)</signature>
<pattern>($1$ ~* $2$)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>http://www.openlinksw.com/schemas/bif#st_geomFromPoint</name>
<mappings>
<mapping>
<signature>geometry ST_Point(float, float)</signature>
<pattern>ST_SetSRID($name$($1$, $2$), 4326)</pattern>
</mapping>
<mapping>
<signature>geometry ST_Point(float, float, int)</signature>
<pattern>ST_SetSRID($name$($1$, $2$), $3$)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>http://www.openlinksw.com/schemas/bif#st_point</name>
<mappings>
<mapping>
<signature>geometry ST_Point(float, float)</signature>
<pattern>ST_SetSRID($name$($1$, $2$), 4326)</pattern>
</mapping>
<mapping>
<signature>geometry ST_Point(float, float, int)</signature>
<pattern>ST_SetSRID($name$($1$, $2$), $3$)</pattern>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>http://www.openlinksw.com/schemas/bif#st_geomFromText</name>
<mappings>
<mapping>
<signature>geometry ST_GeomFromText(string)</signature>
<pattern>$name$($1$, 4326)</pattern>
</mapping>
<mapping>
<signature>geometry ST_GeomFromText(string, int)</signature>
</mapping>
</mappings>
</simpleFunction>
<simpleFunction>
<name>http://www.openlinksw.com/schemas/bif#st_intersects</name>
<mappings>
<mapping>
<signature>boolean ST_Intersects(geometry, geometry)</signature>
</mapping>
<mapping>
<signature>boolean ST_DWithin(geometry, geometry, float)</signature>
<pattern>$name$($1$, $2$, $3$)</pattern>
</mapping>
</mappings>
</simpleFunction>
</simpleFunctions>
</sparqlifyConfig>