datafoodconsortium-connector 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 653a023fe7b9c3e2f59a738b31a8713745e4c106650ec743529397c0f817b331
4
- data.tar.gz: 588951db4b8311fd71350b8668089958f5983e36712f50f458f3d00860c37230
3
+ metadata.gz: 40d1b7f766984fc8ee3d3f26cf2ade067ec7dd9a235909b0899eb4ec332cd661
4
+ data.tar.gz: 5319424d204c44431b22906c3c31409a890b4de229472540f701b24c15081b4a
5
5
  SHA512:
6
- metadata.gz: 666e12a902979c275b10a883861759a781e9bffbb8c9e58de95f72d74cd33d79d3e6060917ab4c8c2417c22d525097c218b56bc7482b087a8f8f186d3e8f466e
7
- data.tar.gz: 2533e80077e344ed2c54b0466ce0347dd91267f45c42a5f779b0545154788d2296875d387671550e17427ab73ecd289ade1a0bc846a0163b28fa40cdbf1036c1
6
+ metadata.gz: 953e93000215c7db54e7bc7fbcb03a04e724ab131b945a6a89963b3b92d92ef163ac1c429255e8b4c88408ea237ff7d6e34354394e8d5560b42755b32abd285b
7
+ data.tar.gz: 94281d6f476d285260f552fe96a17755b60c0e7bb4513e7665d3d12d5d554d78455b50cf95bb25bfd1f12ab33c14ced681ea7d639bc0181f26ce46650a509737
@@ -8,47 +8,7 @@ require 'json/ld'
8
8
  module DataFoodConsortium
9
9
  module Connector
10
10
  class Context < JSON::LD::Context
11
- VERSION_1_8 = JSON.parse <<~JSON
12
- {
13
- "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
14
- "skos" : "http://www.w3.org/2004/02/skos/core#",
15
- "dfc": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_FullModel.owl#",
16
- "dc": "http://purl.org/dc/elements/1.1/#",
17
- "dfc-b": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#",
18
- "dfc-p": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_ProductGlossary.owl#",
19
- "dfc-t": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_TechnicalOntology.owl#",
20
- "dfc-m": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/measures.rdf#",
21
- "dfc-pt": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
22
- "dfc-f": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/facets.rdf#",
23
- "ontosec": "http://www.semanticweb.org/ontologies/2008/11/OntologySecurity.owl#",
24
- "dfc-p:hasUnit":{ "@type":"@id" },
25
- "dfc-b:hasUnit":{ "@type":"@id" },
26
- "dfc-b:hasQuantity":{ "@type":"@id" },
27
- "dfc-p:hasType":{ "@type":"@id" },
28
- "dfc-b:hasType":{ "@type":"@id" },
29
- "dfc-b:references":{ "@type":"@id" },
30
- "dfc-b:referencedBy":{ "@type":"@id" },
31
- "dfc-b:offeres":{ "@type":"@id" },
32
- "dfc-b:supplies":{ "@type":"@id" },
33
- "dfc-b:defines":{ "@type":"@id" },
34
- "dfc-b:affiliates":{ "@type":"@id" },
35
- "dfc-b:hasCertification":{ "@type":"@id" },
36
- "dfc-b:manages":{ "@type":"@id" },
37
- "dfc-b:offeredThrough":{ "@type":"@id" },
38
- "dfc-b:hasBrand":{ "@type":"@id" },
39
- "dfc-b:hasGeographicalOrigin":{ "@type":"@id" },
40
- "dfc-b:hasClaim":{ "@type":"@id" },
41
- "dfc-b:hasAllergenDimension":{ "@type":"@id" },
42
- "dfc-b:hasNutrientDimension":{ "@type":"@id" },
43
- "dfc-b:hasPhysicalDimension":{ "@type":"@id" },
44
- "dfc:owner":{ "@type":"@id" },
45
- "dfc-t:hostedBy":{ "@type":"@id" },
46
- "dfc-t:hasPivot":{ "@type":"@id" },
47
- "dfc-t:represent":{ "@type":"@id" }
48
- }
49
- JSON
50
-
51
- add_preloaded("http://www.datafoodconsortium.org/") { parse(VERSION_1_8) }
11
+ add_preloaded("http://www.datafoodconsortium.org/") { parse(json) }
52
12
 
53
13
  # This is the actual file the DFC website refers to in a link header.
54
14
  alias_preloaded(
@@ -65,7 +25,11 @@ module DataFoodConsortium
65
25
 
66
26
  # The hash serializer expects only string values in the context.
67
27
  def self.inputContext
68
- @inputContext = VERSION_1_8.select { |key, value| value.is_a? String }
28
+ @inputContext = json.select { |key, value| value.is_a? String }
29
+ end
30
+
31
+ def self.json
32
+ @json ||= JSON.parse(File.read("#{__dir__}/context_1.14.0.json"))["@context"]
69
33
  end
70
34
  end
71
35
  end
@@ -0,0 +1,456 @@
1
+ {
2
+ "@context": {
3
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
4
+ "skos" : "http://www.w3.org/2004/02/skos/core#",
5
+ "dfc": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_FullModel.owl#",
6
+ "dc": "http://purl.org/dc/elements/1.1/#",
7
+ "dfc-b": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#",
8
+ "dfc-t": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_TechnicalOntology.owl#",
9
+ "dfc-m": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/measures.rdf#",
10
+ "dfc-pt": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
11
+ "dfc-f": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/facets.rdf#",
12
+ "dfc-v": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/vocabulary.rdf#",
13
+ "ontosec": "http://www.semanticweb.org/ontologies/2008/11/OntologySecurity.owl#",
14
+ "dfc-b:DFC_BusinessOntology_ObjectProperty": {
15
+ "@type": "@id"
16
+ },
17
+ "dfc-b:DFC_Interface_Property": {
18
+ "@type": "@id"
19
+ },
20
+ "dfc-b:addressOf": {
21
+ "@type": "@id"
22
+ },
23
+ "dfc-b:affiliatedTo": {
24
+ "@type": "@id"
25
+ },
26
+ "dfc-b:affiliates": {
27
+ "@type": "@id"
28
+ },
29
+ "dfc-b:allergenCharacteristicOf": {
30
+ "@type": "@id"
31
+ },
32
+ "dfc-b:belongsTo": {
33
+ "@type": "@id"
34
+ },
35
+ "dfc-b:brandOf": {
36
+ "@type": "@id"
37
+ },
38
+ "dfc-b:certificateOf": {
39
+ "@type": "@id"
40
+ },
41
+ "dfc-b:characteristicOf": {
42
+ "@type": "@id"
43
+ },
44
+ "dfc-b:claimOf": {
45
+ "@type": "@id"
46
+ },
47
+ "dfc-b:composedOf": {
48
+ "@type": "@id"
49
+ },
50
+ "dfc-b:composes": {
51
+ "@type": "@id"
52
+ },
53
+ "dfc-b:concernedBy": {
54
+ "@type": "@id"
55
+ },
56
+ "dfc-b:concerns": {
57
+ "@type": "@id"
58
+ },
59
+ "dfc-b:constituedBy": {
60
+ "@type": "@id"
61
+ },
62
+ "dfc-b:constitutes": {
63
+ "@type": "@id"
64
+ },
65
+ "dfc-b:consumedBy": {
66
+ "@type": "@id"
67
+ },
68
+ "dfc-b:consumes": {
69
+ "@type": "@id"
70
+ },
71
+ "dfc-b:containerInformationOf": {
72
+ "@type": "@id"
73
+ },
74
+ "dfc-b:coordinatedBy": {
75
+ "@type": "@id"
76
+ },
77
+ "dfc-b:coordinates": {
78
+ "@type": "@id"
79
+ },
80
+ "dfc-b:definedBy": {
81
+ "@type": "@id"
82
+ },
83
+ "dfc-b:defines": {
84
+ "@type": "@id"
85
+ },
86
+ "dfc-b:deliveredAt": {
87
+ "@type": "@id"
88
+ },
89
+ "dfc-b:facetOf": {
90
+ "@type": "@id"
91
+ },
92
+ "dfc-b:from": {
93
+ "@type": "@id"
94
+ },
95
+ "dfc-b:fulfills": {
96
+ "@type": "@id"
97
+ },
98
+ "dfc-b:geographicalOriginOf": {
99
+ "@type": "@id"
100
+ },
101
+ "dfc-b:hasAddress": {
102
+ "@type": "@id"
103
+ },
104
+ "dfc-b:hasAllergenCharacteristic": {
105
+ "@type": "@id"
106
+ },
107
+ "dfc-b:hasAllergenDimension": {
108
+ "@type": "@id"
109
+ },
110
+ "dfc-b:hasBrand": {
111
+ "@type": "@id"
112
+ },
113
+ "dfc-b:hasCertification": {
114
+ "@type": "@id"
115
+ },
116
+ "dfc-b:hasCharacteristic": {
117
+ "@type": "@id"
118
+ },
119
+ "dfc-b:hasClaim": {
120
+ "@type": "@id"
121
+ },
122
+ "dfc-b:hasContainerInformation": {
123
+ "@type": "@id"
124
+ },
125
+ "dfc-b:hasDimension": {
126
+ "@type": "@id"
127
+ },
128
+ "dfc-b:hasFacet": {
129
+ "@type": "@id"
130
+ },
131
+ "dfc-b:hasFulfilmentStatus": {
132
+ "@type": "@id"
133
+ },
134
+ "dfc-b:hasGeographicalOrigin": {
135
+ "@type": "@id"
136
+ },
137
+ "dfc-b:hasIngredient": {
138
+ "@type": "@id"
139
+ },
140
+ "dfc-b:hasInput": {
141
+ "@type": "@id"
142
+ },
143
+ "dfc-b:hasLabellingCharacteristic": {
144
+ "@type": "@id"
145
+ },
146
+ "dfc-b:hasLabellingDimension": {
147
+ "@type": "@id"
148
+ },
149
+ "dfc-b:hasMainContact": {
150
+ "@type": "@id"
151
+ },
152
+ "dfc-b:hasNatureOrigin": {
153
+ "@type": "@id"
154
+ },
155
+ "dfc-b:hasNutrientCharacteristic": {
156
+ "@type": "@id"
157
+ },
158
+ "dfc-b:hasNutrientDimension": {
159
+ "@type": "@id"
160
+ },
161
+ "dfc-b:hasObject": {
162
+ "@type": "@id"
163
+ },
164
+ "dfc-b:hasOffer": {
165
+ "@type": "@id"
166
+ },
167
+ "dfc-b:hasOption": {
168
+ "@type": "@id"
169
+ },
170
+ "dfc-b:hasOrderStatus": {
171
+ "@type": "@id"
172
+ },
173
+ "dfc-b:hasOutput": {
174
+ "@type": "@id"
175
+ },
176
+ "dfc-b:hasPart": {
177
+ "@type": "@id"
178
+ },
179
+ "dfc-b:hasPartOrigin": {
180
+ "@type": "@id"
181
+ },
182
+ "dfc-b:hasPaymentMethod": {
183
+ "@type": "@id"
184
+ },
185
+ "dfc-b:hasPaymentStatus": {
186
+ "@type": "@id"
187
+ },
188
+ "dfc-b:hasPhoneNumber": {
189
+ "@type": "@id"
190
+ },
191
+ "dfc-b:hasPhysicalCharacteristic": {
192
+ "@type": "@id"
193
+ },
194
+ "dfc-b:hasPhysicalDimension": {
195
+ "@type": "@id"
196
+ },
197
+ "dfc-b:hasPrice": {
198
+ "@type": "@id"
199
+ },
200
+ "dfc-b:hasProcess": {
201
+ "@type": "@id"
202
+ },
203
+ "dfc-b:hasQuantity": {
204
+ "@type": "@id"
205
+ },
206
+ "dfc-b:hasReference": {
207
+ "@type": "@id"
208
+ },
209
+ "dfc-b:hasSocialMedia": {
210
+ "@type": "@id"
211
+ },
212
+ "dfc-b:hasStatus": {
213
+ "@type": "@id"
214
+ },
215
+ "dfc-b:hasTemperature": {
216
+ "@type": "@id"
217
+ },
218
+ "dfc-b:hasTransformationType": {
219
+ "@type": "@id"
220
+ },
221
+ "dfc-b:hasType": {
222
+ "@type": "@id"
223
+ },
224
+ "dfc-b:hasUnit": {
225
+ "@type": "@id"
226
+ },
227
+ "dfc-b:holds": {
228
+ "@type": "@id"
229
+ },
230
+ "dfc-b:hostedAt": {
231
+ "@type": "@id"
232
+ },
233
+ "dfc-b:hosts": {
234
+ "@type": "@id"
235
+ },
236
+ "dfc-b:identifiedBy": {
237
+ "@type": "@id"
238
+ },
239
+ "dfc-b:identifies": {
240
+ "@type": "@id"
241
+ },
242
+ "dfc-b:industrializedBy": {
243
+ "@type": "@id"
244
+ },
245
+ "dfc-b:industrializes": {
246
+ "@type": "@id"
247
+ },
248
+ "dfc-b:inputOf": {
249
+ "@type": "@id"
250
+ },
251
+ "dfc-b:isFulfilledBy": {
252
+ "@type": "@id"
253
+ },
254
+ "dfc-b:isIngredientOf": {
255
+ "@type": "@id"
256
+ },
257
+ "dfc-b:isPriceOf": {
258
+ "@type": "@id"
259
+ },
260
+ "dfc-b:isTemperatureOf": {
261
+ "@type": "@id"
262
+ },
263
+ "dfc-b:labellingCharacteristicOf": {
264
+ "@type": "@id"
265
+ },
266
+ "dfc-b:listedIn": {
267
+ "@type": "@id"
268
+ },
269
+ "dfc-b:lists": {
270
+ "@type": "@id"
271
+ },
272
+ "dfc-b:localizedBy": {
273
+ "@type": "@id"
274
+ },
275
+ "dfc-b:localizes": {
276
+ "@type": "@id"
277
+ },
278
+ "dfc-b:mainContactOf": {
279
+ "@type": "@id"
280
+ },
281
+ "dfc-b:maintainedBy": {
282
+ "@type": "@id"
283
+ },
284
+ "dfc-b:maintains": {
285
+ "@type": "@id"
286
+ },
287
+ "dfc-b:managedBy": {
288
+ "@type": "@id"
289
+ },
290
+ "dfc-b:manages": {
291
+ "@type": "@id"
292
+ },
293
+ "dfc-b:natureOriginOf": {
294
+ "@type": "@id"
295
+ },
296
+ "dfc-b:nutrientCharacteristicOf": {
297
+ "@type": "@id"
298
+ },
299
+ "dfc-b:objectOf": {
300
+ "@type": "@id"
301
+ },
302
+ "dfc-b:offeredThrough": {
303
+ "@type": "@id"
304
+ },
305
+ "dfc-b:offers": {
306
+ "@type": "@id"
307
+ },
308
+ "dfc-b:offersTo": {
309
+ "@type": "@id"
310
+ },
311
+ "dfc-b:optionOf": {
312
+ "@type": "@id"
313
+ },
314
+ "dfc-b:orderedBy": {
315
+ "@type": "@id"
316
+ },
317
+ "dfc-b:orders": {
318
+ "@type": "@id"
319
+ },
320
+ "dfc-b:outputOf": {
321
+ "@type": "@id"
322
+ },
323
+ "dfc-b:ownedBy": {
324
+ "@type": "@id"
325
+ },
326
+ "dfc-b:owns": {
327
+ "@type": "@id"
328
+ },
329
+ "dfc-b:paidWith": {
330
+ "@type": "@id"
331
+ },
332
+ "dfc-b:partOf": {
333
+ "@type": "@id"
334
+ },
335
+ "dfc-b:partOriginOf": {
336
+ "@type": "@id"
337
+ },
338
+ "dfc-b:phoneNumberOf": {
339
+ "@type": "@id"
340
+ },
341
+ "dfc-b:physicalCharacteristicOf": {
342
+ "@type": "@id"
343
+ },
344
+ "dfc-b:pickedUpAt": {
345
+ "@type": "@id"
346
+ },
347
+ "dfc-b:processOf": {
348
+ "@type": "@id"
349
+ },
350
+ "dfc-b:producedBy": {
351
+ "@type": "@id"
352
+ },
353
+ "dfc-b:produces": {
354
+ "@type": "@id"
355
+ },
356
+ "dfc-b:proposedBy": {
357
+ "@type": "@id"
358
+ },
359
+ "dfc-b:proposes": {
360
+ "@type": "@id"
361
+ },
362
+ "dfc-b:referenceOf": {
363
+ "@type": "@id"
364
+ },
365
+ "dfc-b:referencedBy": {
366
+ "@type": "@id"
367
+ },
368
+ "dfc-b:references": {
369
+ "@type": "@id"
370
+ },
371
+ "dfc-b:refersTo": {
372
+ "@type": "@id"
373
+ },
374
+ "dfc-b:representedBy": {
375
+ "@type": "@id"
376
+ },
377
+ "dfc-b:represents": {
378
+ "@type": "@id"
379
+ },
380
+ "dfc-b:requestedBy": {
381
+ "@type": "@id"
382
+ },
383
+ "dfc-b:requests": {
384
+ "@type": "@id"
385
+ },
386
+ "dfc-b:satisfiedBy": {
387
+ "@type": "@id"
388
+ },
389
+ "dfc-b:satisfies": {
390
+ "@type": "@id"
391
+ },
392
+ "dfc-b:selectedBy": {
393
+ "@type": "@id"
394
+ },
395
+ "dfc-b:selects": {
396
+ "@type": "@id"
397
+ },
398
+ "dfc-b:sells": {
399
+ "@type": "@id"
400
+ },
401
+ "dfc-b:socialMediaOf": {
402
+ "@type": "@id"
403
+ },
404
+ "dfc-b:soldBy": {
405
+ "@type": "@id"
406
+ },
407
+ "dfc-b:storedIn": {
408
+ "@type": "@id"
409
+ },
410
+ "dfc-b:stores": {
411
+ "@type": "@id"
412
+ },
413
+ "dfc-b:suppliedBy": {
414
+ "@type": "@id"
415
+ },
416
+ "dfc-b:supplies": {
417
+ "@type": "@id"
418
+ },
419
+ "dfc-b:suppliesTo": {
420
+ "@type": "@id"
421
+ },
422
+ "dfc-b:to": {
423
+ "@type": "@id"
424
+ },
425
+ "dfc-b:tracedBy": {
426
+ "@type": "@id"
427
+ },
428
+ "dfc-b:traces": {
429
+ "@type": "@id"
430
+ },
431
+ "dfc-b:transformedBy": {
432
+ "@type": "@id"
433
+ },
434
+ "dfc-b:transforms": {
435
+ "@type": "@id"
436
+ },
437
+ "dfc-b:typeOf": {
438
+ "@type": "@id"
439
+ },
440
+ "dfc-b:uses": {
441
+ "@type": "@id"
442
+ },
443
+ "dfc-t:represent": {
444
+ "@type": "@id"
445
+ },
446
+ "dfc-t:hasPivot": {
447
+ "@type": "@id"
448
+ },
449
+ "dfc-t:hostedBy": {
450
+ "@type": "@id"
451
+ },
452
+ "dfc-t:owner": {
453
+ "@type": "@id"
454
+ }
455
+ }
456
+ }
@@ -21,7 +21,7 @@ module DataFoodConsortium
21
21
  end
22
22
 
23
23
  def self.prefixed_name(uri)
24
- RDF::URI.new(uri).pname(prefixes: Context::VERSION_1_8)
24
+ RDF::URI.new(uri).pname(prefixes: Context.json)
25
25
  end
26
26
 
27
27
  def import(json_string_or_io)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datafoodconsortium-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Lecoq
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-14 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtual_assembly-semantizer
@@ -45,6 +45,7 @@ files:
45
45
  - lib/datafoodconsortium/connector/characteristic.rb
46
46
  - lib/datafoodconsortium/connector/connector.rb
47
47
  - lib/datafoodconsortium/connector/context.rb
48
+ - lib/datafoodconsortium/connector/context_1.14.0.json
48
49
  - lib/datafoodconsortium/connector/customer_category.rb
49
50
  - lib/datafoodconsortium/connector/defined_product.rb
50
51
  - lib/datafoodconsortium/connector/enterprise.rb