Commit 1a7a229
committed
feat: keep reified definition nodes in the graph, filter them on read
The step no longer removes anything. Unlinking a node once its text had been
read left the graph diverging from the source RDF for the sake of a
presentation problem, so it is reverted: like every other step of the
pipeline this one only appends, and the reified node keeps both its link and
its provenance.
The URI is instead kept out of Class#definition. skos:definition carries
whatever object the graph puts on it, so a reified node arrives as a bare URI
that no reader can use; the attribute now hands out only what is readable,
while `properties` still reports the raw predicate, node URI included.
A resource is only taken for a reified node when it lives in the concept's
own URI space. An external reference - a Wikipedia page, a DOI, a term in
another vocabulary - is a definition the ontology means to give and comes
through untouched. The namespace is taken from the concept rather than from
the submission because this runs inside the reader, once per class per page,
and reaching for the submission there would lazy load it.
Two details the implementation depends on. The reader is wrapped with
alias_method, not redefined: Goo generates it with define_method on the class
itself, so a bare `def definition` would replace it and silently drop the
language flattening and the AttributeNotLoaded guard. And the filter is
applied again in index_doc, because it builds from to_hash, which reads the
instance variables straight and bypasses every reader - without it a node URI
would still be indexed as the text of the definition.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>1 parent 46a1629 commit 1a7a229
3 files changed
Lines changed: 137 additions & 54 deletions
File tree
- lib/ontologies_linked_data
- models
- services/submission_process/operations
- test/models/skos
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 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 | + | |
199 | 253 | | |
200 | 254 | | |
201 | 255 | | |
| |||
273 | 327 | | |
274 | 328 | | |
275 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
276 | 337 | | |
277 | 338 | | |
278 | 339 | | |
| |||
Lines changed: 17 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | | - | |
| 141 | + | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
151 | | - | |
| 150 | + | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
159 | 158 | | |
160 | 159 | | |
161 | 160 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | 161 | | |
168 | 162 | | |
169 | 163 | | |
| |||
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
182 | | - | |
183 | 176 | | |
184 | 177 | | |
185 | 178 | | |
| |||
205 | 198 | | |
206 | 199 | | |
207 | 200 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
212 | 205 | | |
213 | 206 | | |
214 | 207 | | |
| |||
231 | 224 | | |
232 | 225 | | |
233 | 226 | | |
234 | | - | |
235 | | - | |
236 | 227 | | |
237 | 228 | | |
238 | 229 | | |
239 | | - | |
240 | 230 | | |
241 | | - | |
242 | 231 | | |
243 | | - | |
| 232 | + | |
244 | 233 | | |
245 | 234 | | |
246 | 235 | | |
| |||
259 | 248 | | |
260 | 249 | | |
261 | 250 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | 251 | | |
266 | 252 | | |
267 | 253 | | |
268 | | - | |
| 254 | + | |
269 | 255 | | |
270 | 256 | | |
271 | 257 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 258 | + | |
| 259 | + | |
276 | 260 | | |
277 | 261 | | |
278 | | - | |
| 262 | + | |
279 | 263 | | |
280 | 264 | | |
281 | 265 | | |
| |||
290 | 274 | | |
291 | 275 | | |
292 | 276 | | |
293 | | - | |
294 | 277 | | |
295 | 278 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | 279 | | |
306 | 280 | | |
307 | 281 | | |
308 | 282 | | |
309 | | - | |
| 283 | + | |
310 | 284 | | |
311 | 285 | | |
312 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 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 | + | |
93 | 138 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
97 | 142 | | |
98 | 143 | | |
99 | 144 | | |
| |||
109 | 154 | | |
110 | 155 | | |
111 | 156 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
120 | 161 | | |
| 162 | + | |
121 | 163 | | |
122 | 164 | | |
123 | 165 | | |
124 | 166 | | |
125 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
126 | 174 | | |
127 | 175 | | |
128 | 176 | | |
| |||
0 commit comments