datafoodconsortium-connector 1.1.0 → 1.2.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 +4 -4
- data/lib/datafoodconsortium/connector/connector.rb +8 -8
- data/lib/datafoodconsortium/connector/context.rb +13 -5
- data/lib/datafoodconsortium/connector/{context_1.14.0.json → context_1.16.0.json} +36 -0
- data/lib/datafoodconsortium/connector/delivery_option.rb +67 -0
- data/lib/datafoodconsortium/connector/localized_product.rb +105 -0
- data/lib/datafoodconsortium/connector/payment_method.rb +70 -0
- data/lib/datafoodconsortium/connector/physical_place.rb +94 -0
- data/lib/datafoodconsortium/connector/physical_product.rb +104 -0
- data/lib/datafoodconsortium/connector/pickup_option.rb +55 -0
- data/lib/datafoodconsortium/connector/planned_local_consumption_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/planned_local_production_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/planned_local_transformation.rb +79 -0
- data/lib/datafoodconsortium/connector/planned_transformation.rb +1 -0
- data/lib/datafoodconsortium/connector/product_batch.rb +90 -0
- data/lib/datafoodconsortium/connector/real_stock.rb +74 -0
- data/lib/datafoodconsortium/connector/realized_consumption_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/realized_production_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/realized_transformation.rb +73 -0
- data/lib/datafoodconsortium/connector/shipping_option.rb +91 -0
- data/lib/datafoodconsortium/connector/theoretical_stock.rb +67 -0
- data/lib/datafoodconsortium/connector/virtual_place.rb +64 -0
- data/lib/datafoodconsortium/connector.rb +17 -0
- metadata +21 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Maxime Lecoq <maxime@lecoqlibre.fr>
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
require "virtual_assembly/semantizer"
|
|
29
|
+
|
|
30
|
+
class DataFoodConsortium::Connector::ShippingOption
|
|
31
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:PickupOption".freeze
|
|
34
|
+
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :name
|
|
37
|
+
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :description
|
|
40
|
+
|
|
41
|
+
# @return [Real]
|
|
42
|
+
attr_accessor :fee
|
|
43
|
+
|
|
44
|
+
# @return [IQuantity]
|
|
45
|
+
attr_accessor :quantity
|
|
46
|
+
|
|
47
|
+
# @return [IOrder]
|
|
48
|
+
attr_accessor :order
|
|
49
|
+
|
|
50
|
+
# @return [ISaleSession]
|
|
51
|
+
attr_accessor :saleSession
|
|
52
|
+
|
|
53
|
+
# @return [DateTime]
|
|
54
|
+
attr_accessor :beginDate
|
|
55
|
+
|
|
56
|
+
# @return [DateTime]
|
|
57
|
+
attr_accessor :endDate
|
|
58
|
+
|
|
59
|
+
# @param semanticId [String]
|
|
60
|
+
# @param name [String]
|
|
61
|
+
# @param description [String]
|
|
62
|
+
# @param fee [Real]
|
|
63
|
+
# @param quantity [IQuantity]
|
|
64
|
+
# @param order [IOrder]
|
|
65
|
+
# @param saleSession [ISaleSession]
|
|
66
|
+
# @param beginDate [DateTime]
|
|
67
|
+
# @param endDate [DateTime]
|
|
68
|
+
def initialize(semanticId, name: nil, description: nil, fee: nil, quantity: nil, order: nil, saleSession: nil, beginDate: nil, endDate: nil)
|
|
69
|
+
super(semanticId)
|
|
70
|
+
@name = name
|
|
71
|
+
@description = description
|
|
72
|
+
@fee = fee
|
|
73
|
+
@quantity = quantity
|
|
74
|
+
@order = order
|
|
75
|
+
@saleSession = saleSession
|
|
76
|
+
@beginDate = beginDate
|
|
77
|
+
@endDate = endDate
|
|
78
|
+
self.semanticType = "dfc-b:PickupOption"
|
|
79
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
80
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
81
|
+
registerSemanticProperty("dfc-b:fee", &method("fee")).valueSetter = method("fee=")
|
|
82
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("quantity")).valueSetter = method("quantity=")
|
|
83
|
+
registerSemanticProperty("dfc-b:selectedBy", &method("order")).valueSetter = method("order=")
|
|
84
|
+
registerSemanticProperty("dfc-b:optionOf", &method("saleSession")).valueSetter = method("saleSession=")
|
|
85
|
+
registerSemanticProperty("dfc-b:startDate", &method("beginDate")).valueSetter = method("beginDate=")
|
|
86
|
+
registerSemanticProperty("dfc-b:endDate", &method("endDate")).valueSetter = method("endDate=")
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Maxime Lecoq <maxime@lecoqlibre.fr>
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
require "virtual_assembly/semantizer"
|
|
29
|
+
|
|
30
|
+
class DataFoodConsortium::Connector::TheoreticalStock
|
|
31
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:TheoreticalStock".freeze
|
|
34
|
+
|
|
35
|
+
# @return [ILocalizedProduct]
|
|
36
|
+
attr_accessor :localizedProduct
|
|
37
|
+
|
|
38
|
+
# @return [IQuantity]
|
|
39
|
+
attr_accessor :quantity
|
|
40
|
+
|
|
41
|
+
# @return [IPhysicalPlace]
|
|
42
|
+
attr_accessor :physicalPlace
|
|
43
|
+
|
|
44
|
+
# @return [DateTime]
|
|
45
|
+
attr_accessor :availabilityDate
|
|
46
|
+
|
|
47
|
+
# @param semanticId [String]
|
|
48
|
+
# @param localizedProduct [ILocalizedProduct]
|
|
49
|
+
# @param quantity [IQuantity]
|
|
50
|
+
# @param physicalPlace [IPhysicalPlace]
|
|
51
|
+
# @param availabilityDate [DateTime]
|
|
52
|
+
def initialize(semanticId, localizedProduct: nil, quantity: nil, physicalPlace: nil, availabilityDate: nil)
|
|
53
|
+
super(semanticId)
|
|
54
|
+
@localizedProduct = localizedProduct
|
|
55
|
+
@quantity = quantity
|
|
56
|
+
@physicalPlace = physicalPlace
|
|
57
|
+
@availabilityDate = availabilityDate
|
|
58
|
+
self.semanticType = "dfc-b:TheoreticalStock"
|
|
59
|
+
registerSemanticProperty("dfc-b:constitutes", &method("localizedProduct")).valueSetter = method("localizedProduct=")
|
|
60
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("quantity")).valueSetter = method("quantity=")
|
|
61
|
+
registerSemanticProperty("dfc-b:localizedBy", &method("physicalPlace")).valueSetter = method("physicalPlace=")
|
|
62
|
+
registerSemanticProperty("dfc-b:availabilityDate", &method("availabilityDate")).valueSetter = method("availabilityDate=")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Maxime Lecoq <maxime@lecoqlibre.fr>
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
require "virtual_assembly/semantizer"
|
|
26
|
+
|
|
27
|
+
class DataFoodConsortium::Connector::VirtualPlace
|
|
28
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
29
|
+
|
|
30
|
+
SEMANTIC_TYPE = "dfc-b:VirtualPlace".freeze
|
|
31
|
+
|
|
32
|
+
# @return [String]
|
|
33
|
+
attr_accessor :name
|
|
34
|
+
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :description
|
|
37
|
+
|
|
38
|
+
# @return [ISaleSession]
|
|
39
|
+
attr_accessor :hostedSaleSessions
|
|
40
|
+
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :urls
|
|
43
|
+
|
|
44
|
+
# @param semanticId [String]
|
|
45
|
+
# @param name [String]
|
|
46
|
+
# @param description [String]
|
|
47
|
+
# @param hostedSaleSessions [ISaleSession]
|
|
48
|
+
# @param urls [String]
|
|
49
|
+
def initialize(semanticId, name: nil, description: nil, hostedSaleSessions: [], urls: [])
|
|
50
|
+
super(semanticId)
|
|
51
|
+
@name = name
|
|
52
|
+
@description = description
|
|
53
|
+
@hostedSaleSessions = hostedSaleSessions
|
|
54
|
+
@urls = urls
|
|
55
|
+
self.semanticType = "dfc-b:VirtualPlace"
|
|
56
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
57
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
58
|
+
registerSemanticProperty("dfc-b:hosts", &method("hostedSaleSessions")).valueSetter = method("hostedSaleSessions=")
|
|
59
|
+
registerSemanticProperty("dfc-b:URL", &method("urls")).valueSetter = method("urls=")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
end
|
|
@@ -19,18 +19,35 @@ module DataFoodConsortium
|
|
|
19
19
|
require 'datafoodconsortium/connector/quantity.rb'
|
|
20
20
|
require 'datafoodconsortium/connector/defined_product.rb'
|
|
21
21
|
require 'datafoodconsortium/connector/flow.rb'
|
|
22
|
+
require 'datafoodconsortium/connector/localized_product.rb'
|
|
23
|
+
require 'datafoodconsortium/connector/physical_product.rb'
|
|
22
24
|
require 'datafoodconsortium/connector/planned_consumption_flow.rb'
|
|
25
|
+
require 'datafoodconsortium/connector/planned_local_consumption_flow.rb'
|
|
26
|
+
require 'datafoodconsortium/connector/planned_local_production_flow.rb'
|
|
27
|
+
require 'datafoodconsortium/connector/planned_local_transformation.rb'
|
|
23
28
|
require 'datafoodconsortium/connector/planned_production_flow.rb'
|
|
24
29
|
require 'datafoodconsortium/connector/planned_transformation.rb'
|
|
30
|
+
require 'datafoodconsortium/connector/realized_consumption_flow.rb'
|
|
31
|
+
require 'datafoodconsortium/connector/realized_production_flow.rb'
|
|
32
|
+
require 'datafoodconsortium/connector/realized_transformation.rb'
|
|
25
33
|
require 'datafoodconsortium/connector/supplied_product.rb'
|
|
26
34
|
require 'datafoodconsortium/connector/technical_product.rb'
|
|
27
35
|
require 'datafoodconsortium/connector/catalog.rb'
|
|
28
36
|
require 'datafoodconsortium/connector/catalog_item.rb'
|
|
37
|
+
require 'datafoodconsortium/connector/delivery_option.rb'
|
|
29
38
|
require 'datafoodconsortium/connector/offer.rb'
|
|
30
39
|
require 'datafoodconsortium/connector/order.rb'
|
|
31
40
|
require 'datafoodconsortium/connector/order_line.rb'
|
|
41
|
+
require 'datafoodconsortium/connector/payment_method.rb'
|
|
42
|
+
require 'datafoodconsortium/connector/physical_place.rb'
|
|
43
|
+
require 'datafoodconsortium/connector/pickup_option.rb'
|
|
32
44
|
require 'datafoodconsortium/connector/price.rb'
|
|
45
|
+
require 'datafoodconsortium/connector/product_batch.rb'
|
|
46
|
+
require 'datafoodconsortium/connector/real_stock.rb'
|
|
33
47
|
require 'datafoodconsortium/connector/sale_session.rb'
|
|
48
|
+
require 'datafoodconsortium/connector/shipping_option.rb'
|
|
49
|
+
require 'datafoodconsortium/connector/theoretical_stock.rb'
|
|
50
|
+
require 'datafoodconsortium/connector/virtual_place.rb'
|
|
34
51
|
require 'datafoodconsortium/connector/skos_concept.rb'
|
|
35
52
|
|
|
36
53
|
def self.semantic_types
|
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: datafoodconsortium-connector
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maxime Lecoq
|
|
8
|
+
- Maikel Linke
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
12
|
+
date: 2025-11-24 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: virtual_assembly-semantizer
|
|
@@ -45,27 +46,42 @@ files:
|
|
|
45
46
|
- lib/datafoodconsortium/connector/characteristic.rb
|
|
46
47
|
- lib/datafoodconsortium/connector/connector.rb
|
|
47
48
|
- lib/datafoodconsortium/connector/context.rb
|
|
48
|
-
- lib/datafoodconsortium/connector/context_1.
|
|
49
|
+
- lib/datafoodconsortium/connector/context_1.16.0.json
|
|
49
50
|
- lib/datafoodconsortium/connector/customer_category.rb
|
|
50
51
|
- lib/datafoodconsortium/connector/defined_product.rb
|
|
52
|
+
- lib/datafoodconsortium/connector/delivery_option.rb
|
|
51
53
|
- lib/datafoodconsortium/connector/enterprise.rb
|
|
52
54
|
- lib/datafoodconsortium/connector/flow.rb
|
|
53
55
|
- lib/datafoodconsortium/connector/importer.rb
|
|
54
56
|
- lib/datafoodconsortium/connector/json_ld_serializer.rb
|
|
57
|
+
- lib/datafoodconsortium/connector/localized_product.rb
|
|
55
58
|
- lib/datafoodconsortium/connector/nutrient_characteristic.rb
|
|
56
59
|
- lib/datafoodconsortium/connector/offer.rb
|
|
57
60
|
- lib/datafoodconsortium/connector/order.rb
|
|
58
61
|
- lib/datafoodconsortium/connector/order_line.rb
|
|
62
|
+
- lib/datafoodconsortium/connector/payment_method.rb
|
|
59
63
|
- lib/datafoodconsortium/connector/person.rb
|
|
60
64
|
- lib/datafoodconsortium/connector/phone_number.rb
|
|
61
65
|
- lib/datafoodconsortium/connector/physical_characteristic.rb
|
|
66
|
+
- lib/datafoodconsortium/connector/physical_place.rb
|
|
67
|
+
- lib/datafoodconsortium/connector/physical_product.rb
|
|
68
|
+
- lib/datafoodconsortium/connector/pickup_option.rb
|
|
62
69
|
- lib/datafoodconsortium/connector/planned_consumption_flow.rb
|
|
70
|
+
- lib/datafoodconsortium/connector/planned_local_consumption_flow.rb
|
|
71
|
+
- lib/datafoodconsortium/connector/planned_local_production_flow.rb
|
|
72
|
+
- lib/datafoodconsortium/connector/planned_local_transformation.rb
|
|
63
73
|
- lib/datafoodconsortium/connector/planned_production_flow.rb
|
|
64
74
|
- lib/datafoodconsortium/connector/planned_transformation.rb
|
|
65
75
|
- lib/datafoodconsortium/connector/price.rb
|
|
76
|
+
- lib/datafoodconsortium/connector/product_batch.rb
|
|
66
77
|
- lib/datafoodconsortium/connector/quantitative_value.rb
|
|
67
78
|
- lib/datafoodconsortium/connector/quantity.rb
|
|
79
|
+
- lib/datafoodconsortium/connector/real_stock.rb
|
|
80
|
+
- lib/datafoodconsortium/connector/realized_consumption_flow.rb
|
|
81
|
+
- lib/datafoodconsortium/connector/realized_production_flow.rb
|
|
82
|
+
- lib/datafoodconsortium/connector/realized_transformation.rb
|
|
68
83
|
- lib/datafoodconsortium/connector/sale_session.rb
|
|
84
|
+
- lib/datafoodconsortium/connector/shipping_option.rb
|
|
69
85
|
- lib/datafoodconsortium/connector/skos_concept.rb
|
|
70
86
|
- lib/datafoodconsortium/connector/skos_helper.rb
|
|
71
87
|
- lib/datafoodconsortium/connector/skos_parser.rb
|
|
@@ -73,6 +89,8 @@ files:
|
|
|
73
89
|
- lib/datafoodconsortium/connector/social_media.rb
|
|
74
90
|
- lib/datafoodconsortium/connector/supplied_product.rb
|
|
75
91
|
- lib/datafoodconsortium/connector/technical_product.rb
|
|
92
|
+
- lib/datafoodconsortium/connector/theoretical_stock.rb
|
|
93
|
+
- lib/datafoodconsortium/connector/virtual_place.rb
|
|
76
94
|
homepage: https://github.com/datafoodconsortium/connector-ruby/
|
|
77
95
|
licenses:
|
|
78
96
|
- MIT
|