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,55 @@
|
|
|
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
|
+
require "datafoodconsortium/connector/shipping_option"
|
|
27
|
+
require "virtual_assembly/semantizer"
|
|
28
|
+
|
|
29
|
+
class DataFoodConsortium::Connector::PickupOption < DataFoodConsortium::Connector::ShippingOption
|
|
30
|
+
|
|
31
|
+
SEMANTIC_TYPE = "dfc-b:PickupOption".freeze
|
|
32
|
+
|
|
33
|
+
# @return [IPhysicalPlace]
|
|
34
|
+
attr_accessor :pickupPlace
|
|
35
|
+
|
|
36
|
+
# @param semanticId [String]
|
|
37
|
+
# @param pickupPlace [IPhysicalPlace]
|
|
38
|
+
# @param name [String]
|
|
39
|
+
# @param description [String]
|
|
40
|
+
# @param fee [Real]
|
|
41
|
+
# @param quantity [IQuantity]
|
|
42
|
+
# @param order [IOrder]
|
|
43
|
+
# @param saleSession [ISaleSession]
|
|
44
|
+
# @param beginDate [DateTime]
|
|
45
|
+
# @param endDate [DateTime]
|
|
46
|
+
def initialize(semanticId, pickupPlace: nil, name: nil, description: nil, fee: nil, quantity: nil, order: nil, saleSession: nil, beginDate: nil, endDate: nil)
|
|
47
|
+
super(semanticId, name: name, description: description, fee: fee, quantity: quantity, order: order, saleSession: saleSession, beginDate: beginDate, endDate: endDate)
|
|
48
|
+
@pickupPlace = pickupPlace
|
|
49
|
+
self.semanticType = "dfc-b:PickupOption"
|
|
50
|
+
registerSemanticProperty("dfc-b:pickedUpAt", &method("pickupPlace")).valueSetter = method("pickupPlace=")
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
require "datafoodconsortium/connector/flow"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
require "virtual_assembly/semantizer"
|
|
30
|
+
|
|
31
|
+
class DataFoodConsortium::Connector::PlannedLocalConsumptionFlow < DataFoodConsortium::Connector::Flow
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedLocalConsumptionFlow".freeze
|
|
34
|
+
|
|
35
|
+
# @return [IPlannedLocalTransformation]
|
|
36
|
+
attr_accessor :transformation
|
|
37
|
+
|
|
38
|
+
# @return [ILocalizedProduct]
|
|
39
|
+
attr_accessor :product
|
|
40
|
+
|
|
41
|
+
# @param semanticId [String]
|
|
42
|
+
# @param transformation [IPlannedLocalTransformation]
|
|
43
|
+
# @param product [ILocalizedProduct]
|
|
44
|
+
# @param quantity [IQuantity]
|
|
45
|
+
def initialize(semanticId, transformation: nil, product: nil, quantity: nil)
|
|
46
|
+
super(semanticId, quantity: quantity)
|
|
47
|
+
@transformation = transformation
|
|
48
|
+
@product = product
|
|
49
|
+
self.semanticType = "dfc-b:AsPlannedLocalConsumptionFlow"
|
|
50
|
+
registerSemanticProperty("dfc-b:incomeOf", &method("transformation")).valueSetter = method("transformation=")
|
|
51
|
+
registerSemanticProperty("dfc-b:consumes", &method("product")).valueSetter = method("product=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
require "datafoodconsortium/connector/flow"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
require "virtual_assembly/semantizer"
|
|
30
|
+
|
|
31
|
+
class DataFoodConsortium::Connector::PlannedLocalProductionFlow < DataFoodConsortium::Connector::Flow
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedLocalProductionFlow".freeze
|
|
34
|
+
|
|
35
|
+
# @return [IPlannedLocalTransformation]
|
|
36
|
+
attr_accessor :transformation
|
|
37
|
+
|
|
38
|
+
# @return [ILocalizedProduct]
|
|
39
|
+
attr_accessor :product
|
|
40
|
+
|
|
41
|
+
# @param semanticId [String]
|
|
42
|
+
# @param transformation [IPlannedLocalTransformation]
|
|
43
|
+
# @param product [ILocalizedProduct]
|
|
44
|
+
# @param quantity [IQuantity]
|
|
45
|
+
def initialize(semanticId, transformation: nil, product: nil, quantity: nil)
|
|
46
|
+
super(semanticId, quantity: quantity)
|
|
47
|
+
@transformation = transformation
|
|
48
|
+
@product = product
|
|
49
|
+
self.semanticType = "dfc-b:AsPlannedLocalProductionFlow"
|
|
50
|
+
registerSemanticProperty("dfc-b:outcomeOf", &method("transformation")).valueSetter = method("transformation=")
|
|
51
|
+
registerSemanticProperty("dfc-b:produces", &method("product")).valueSetter = method("product=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
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::PlannedLocalTransformation
|
|
31
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedLocalTransformation".freeze
|
|
34
|
+
|
|
35
|
+
# @return [ISKOSConcept]
|
|
36
|
+
attr_accessor :transformationType
|
|
37
|
+
|
|
38
|
+
# @return [Real]
|
|
39
|
+
attr_accessor :cost
|
|
40
|
+
|
|
41
|
+
# @return [DateTime]
|
|
42
|
+
attr_accessor :startDate
|
|
43
|
+
|
|
44
|
+
# @return [DateTime]
|
|
45
|
+
attr_accessor :endDate
|
|
46
|
+
|
|
47
|
+
# @return [IPlannedLocalConsumptionFlow]
|
|
48
|
+
attr_accessor :consumptionFlow
|
|
49
|
+
|
|
50
|
+
# @return [IPlannedLocalProductionFlow]
|
|
51
|
+
attr_accessor :productionFlow
|
|
52
|
+
|
|
53
|
+
# @param semanticId [String]
|
|
54
|
+
# @param transformationType [ISKOSConcept]
|
|
55
|
+
# @param cost [Real]
|
|
56
|
+
# @param startDate [DateTime]
|
|
57
|
+
# @param endDate [DateTime]
|
|
58
|
+
# @param consumptionFlow [IPlannedLocalConsumptionFlow]
|
|
59
|
+
# @param productionFlow [IPlannedLocalProductionFlow]
|
|
60
|
+
def initialize(semanticId, transformationType: nil, cost: nil, startDate: nil, endDate: nil, consumptionFlow: nil, productionFlow: nil)
|
|
61
|
+
super(semanticId)
|
|
62
|
+
@transformationType = transformationType
|
|
63
|
+
@cost = cost
|
|
64
|
+
@startDate = startDate
|
|
65
|
+
@endDate = endDate
|
|
66
|
+
@consumptionFlow = consumptionFlow
|
|
67
|
+
@productionFlow = productionFlow
|
|
68
|
+
self.semanticType = "dfc-b:AsPlannedLocalTransformation"
|
|
69
|
+
registerSemanticProperty("dfc-b:hasTransformationType", &method("transformationType")).valueSetter = method("transformationType=")
|
|
70
|
+
registerSemanticProperty("dfc-b:cost", &method("cost")).valueSetter = method("cost=")
|
|
71
|
+
registerSemanticProperty("dfc-b:startDate", &method("startDate")).valueSetter = method("startDate=")
|
|
72
|
+
registerSemanticProperty("dfc-b:endDate", &method("endDate")).valueSetter = method("endDate=")
|
|
73
|
+
registerSemanticProperty("dfc-b:hasIncome", &method("consumptionFlow")).valueSetter = method("consumptionFlow=")
|
|
74
|
+
registerSemanticProperty("dfc-b:hasOutcome", &method("productionFlow")).valueSetter = method("productionFlow=")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
require "virtual_assembly/semantizer"
|
|
28
|
+
|
|
29
|
+
class DataFoodConsortium::Connector::ProductBatch
|
|
30
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
31
|
+
|
|
32
|
+
SEMANTIC_TYPE = "dfc-b:ProductBatch".freeze
|
|
33
|
+
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :name
|
|
36
|
+
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :description
|
|
39
|
+
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :batchNumber
|
|
42
|
+
|
|
43
|
+
# @return [IRealStock]
|
|
44
|
+
attr_accessor :realStock
|
|
45
|
+
|
|
46
|
+
# @return [IPhysicalProduct]
|
|
47
|
+
attr_accessor :physicalProduct
|
|
48
|
+
|
|
49
|
+
# @return [DateTime]
|
|
50
|
+
attr_accessor :bestBeforeDate
|
|
51
|
+
|
|
52
|
+
# @return [DateTime]
|
|
53
|
+
attr_accessor :expirationDate
|
|
54
|
+
|
|
55
|
+
# @return [DateTime]
|
|
56
|
+
attr_accessor :productionDate
|
|
57
|
+
|
|
58
|
+
# @param semanticId [String]
|
|
59
|
+
# @param name [String]
|
|
60
|
+
# @param description [String]
|
|
61
|
+
# @param batchNumber [String]
|
|
62
|
+
# @param realStock [IRealStock]
|
|
63
|
+
# @param physicalProduct [IPhysicalProduct]
|
|
64
|
+
# @param bestBeforeDate [DateTime]
|
|
65
|
+
# @param expirationDate [DateTime]
|
|
66
|
+
# @param productionDate [DateTime]
|
|
67
|
+
def initialize(semanticId, name: nil, description: nil, batchNumber: nil, realStock: nil, physicalProduct: nil, bestBeforeDate: nil, expirationDate: nil, productionDate: nil)
|
|
68
|
+
super(semanticId)
|
|
69
|
+
@name = name
|
|
70
|
+
@description = description
|
|
71
|
+
@batchNumber = batchNumber
|
|
72
|
+
@realStock = realStock
|
|
73
|
+
@physicalProduct = physicalProduct
|
|
74
|
+
@bestBeforeDate = bestBeforeDate
|
|
75
|
+
@expirationDate = expirationDate
|
|
76
|
+
@productionDate = productionDate
|
|
77
|
+
self.semanticType = "dfc-b:ProductBatch"
|
|
78
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
79
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
80
|
+
registerSemanticProperty("dfc-b:batchNumber", &method("batchNumber")).valueSetter = method("batchNumber=")
|
|
81
|
+
registerSemanticProperty("dfc-b:identifiedBy", &method("realStock")).valueSetter = method("realStock=")
|
|
82
|
+
registerSemanticProperty("dfc-b:contains", &method("physicalProduct")).valueSetter = method("physicalProduct=")
|
|
83
|
+
registerSemanticProperty("dfc-b:bestBeforeDate", &method("bestBeforeDate")).valueSetter = method("bestBeforeDate=")
|
|
84
|
+
registerSemanticProperty("dfc-b:expirationDate", &method("expirationDate")).valueSetter = method("expirationDate=")
|
|
85
|
+
registerSemanticProperty("dfc-b:productionDate", &method("productionDate")).valueSetter = method("productionDate=")
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
|
|
29
|
+
require "virtual_assembly/semantizer"
|
|
30
|
+
|
|
31
|
+
class DataFoodConsortium::Connector::RealStock
|
|
32
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
33
|
+
|
|
34
|
+
SEMANTIC_TYPE = "dfc-b:RealStock".freeze
|
|
35
|
+
|
|
36
|
+
# @return [IPhysicalProduct]
|
|
37
|
+
attr_accessor :physicalProduct
|
|
38
|
+
|
|
39
|
+
# @return [IQuantity]
|
|
40
|
+
attr_accessor :quantity
|
|
41
|
+
|
|
42
|
+
# @return [IPhysicalPlace]
|
|
43
|
+
attr_accessor :physicalPlace
|
|
44
|
+
|
|
45
|
+
# @return [DateTime]
|
|
46
|
+
attr_accessor :availabilityDate
|
|
47
|
+
|
|
48
|
+
# @return [IProductBatch]
|
|
49
|
+
attr_accessor :productBatches
|
|
50
|
+
|
|
51
|
+
# @param semanticId [String]
|
|
52
|
+
# @param physicalProduct [IPhysicalProduct]
|
|
53
|
+
# @param quantity [IQuantity]
|
|
54
|
+
# @param physicalPlace [IPhysicalPlace]
|
|
55
|
+
# @param availabilityDate [DateTime]
|
|
56
|
+
# @param productBatches [IProductBatch]
|
|
57
|
+
def initialize(semanticId, physicalProduct: nil, quantity: nil, physicalPlace: nil, availabilityDate: nil, productBatches: [])
|
|
58
|
+
super(semanticId)
|
|
59
|
+
@physicalProduct = physicalProduct
|
|
60
|
+
@quantity = quantity
|
|
61
|
+
@physicalPlace = physicalPlace
|
|
62
|
+
@availabilityDate = availabilityDate
|
|
63
|
+
@productBatches = productBatches
|
|
64
|
+
self.semanticType = "dfc-b:RealStock"
|
|
65
|
+
registerSemanticProperty("dfc-b:constitutes", &method("physicalProduct")).valueSetter = method("physicalProduct=")
|
|
66
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("quantity")).valueSetter = method("quantity=")
|
|
67
|
+
registerSemanticProperty("dfc-b:isStoredIn", &method("physicalPlace")).valueSetter = method("physicalPlace=")
|
|
68
|
+
registerSemanticProperty("dfc-b:availabilityDate", &method("availabilityDate")).valueSetter = method("availabilityDate=")
|
|
69
|
+
registerSemanticProperty("dfc-b:identifies", &method("productBatches")).valueSetter = method("productBatches=")
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
require "datafoodconsortium/connector/flow"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
require "virtual_assembly/semantizer"
|
|
30
|
+
|
|
31
|
+
class DataFoodConsortium::Connector::RealizedConsumptionFlow < DataFoodConsortium::Connector::Flow
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsRealizedConsumptionFlow".freeze
|
|
34
|
+
|
|
35
|
+
# @return [IRealizedTransformation]
|
|
36
|
+
attr_accessor :transformation
|
|
37
|
+
|
|
38
|
+
# @return [IPhysicalProduct]
|
|
39
|
+
attr_accessor :product
|
|
40
|
+
|
|
41
|
+
# @param semanticId [String]
|
|
42
|
+
# @param transformation [IRealizedTransformation]
|
|
43
|
+
# @param product [IPhysicalProduct]
|
|
44
|
+
# @param quantity [IQuantity]
|
|
45
|
+
def initialize(semanticId, transformation: nil, product: nil, quantity: nil)
|
|
46
|
+
super(semanticId, quantity: quantity)
|
|
47
|
+
@transformation = transformation
|
|
48
|
+
@product = product
|
|
49
|
+
self.semanticType = "dfc-b:AsRealizedConsumptionFlow"
|
|
50
|
+
registerSemanticProperty("dfc-b:incomeOf", &method("transformation")).valueSetter = method("transformation=")
|
|
51
|
+
registerSemanticProperty("dfc-b:consumes", &method("product")).valueSetter = method("product=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
require "datafoodconsortium/connector/flow"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
require "virtual_assembly/semantizer"
|
|
30
|
+
|
|
31
|
+
class DataFoodConsortium::Connector::RealizedProductionFlow < DataFoodConsortium::Connector::Flow
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsRealizedProductionFlow".freeze
|
|
34
|
+
|
|
35
|
+
# @return [IRealizedTransformation]
|
|
36
|
+
attr_accessor :transformation
|
|
37
|
+
|
|
38
|
+
# @return [IPhysicalProduct]
|
|
39
|
+
attr_accessor :product
|
|
40
|
+
|
|
41
|
+
# @param semanticId [String]
|
|
42
|
+
# @param transformation [IRealizedTransformation]
|
|
43
|
+
# @param product [IPhysicalProduct]
|
|
44
|
+
# @param quantity [IQuantity]
|
|
45
|
+
def initialize(semanticId, transformation: nil, product: nil, quantity: nil)
|
|
46
|
+
super(semanticId, quantity: quantity)
|
|
47
|
+
@transformation = transformation
|
|
48
|
+
@product = product
|
|
49
|
+
self.semanticType = "dfc-b:AsRealizedProductionFlow"
|
|
50
|
+
registerSemanticProperty("dfc-b:outcomeOf", &method("transformation")).valueSetter = method("transformation=")
|
|
51
|
+
registerSemanticProperty("dfc-b:produces", &method("product")).valueSetter = method("product=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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::RealizedTransformation
|
|
31
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
|
32
|
+
|
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsRealizedTransformation".freeze
|
|
34
|
+
|
|
35
|
+
# @return [ISKOSConcept]
|
|
36
|
+
attr_accessor :transformationType
|
|
37
|
+
|
|
38
|
+
# @return [DateTime]
|
|
39
|
+
attr_accessor :startDate
|
|
40
|
+
|
|
41
|
+
# @return [DateTime]
|
|
42
|
+
attr_accessor :endDate
|
|
43
|
+
|
|
44
|
+
# @return [IRealizedConsumptionFlow]
|
|
45
|
+
attr_accessor :consumptionFlow
|
|
46
|
+
|
|
47
|
+
# @return [IRealizedProductionFlow]
|
|
48
|
+
attr_accessor :productionFlow
|
|
49
|
+
|
|
50
|
+
# @param semanticId [String]
|
|
51
|
+
# @param transformationType [ISKOSConcept]
|
|
52
|
+
# @param startDate [DateTime]
|
|
53
|
+
# @param endDate [DateTime]
|
|
54
|
+
# @param consumptionFlow [IRealizedConsumptionFlow]
|
|
55
|
+
# @param productionFlow [IRealizedProductionFlow]
|
|
56
|
+
def initialize(semanticId, transformationType: nil, startDate: nil, endDate: nil, consumptionFlow: nil, productionFlow: nil)
|
|
57
|
+
super(semanticId)
|
|
58
|
+
@transformationType = transformationType
|
|
59
|
+
@startDate = startDate
|
|
60
|
+
@endDate = endDate
|
|
61
|
+
@consumptionFlow = consumptionFlow
|
|
62
|
+
@productionFlow = productionFlow
|
|
63
|
+
self.semanticType = "dfc-b:AsRealizedTransformation"
|
|
64
|
+
registerSemanticProperty("dfc-b:hasTransformationType", &method("transformationType")).valueSetter = method("transformationType=")
|
|
65
|
+
registerSemanticProperty("dfc-b:startDate", &method("startDate")).valueSetter = method("startDate=")
|
|
66
|
+
registerSemanticProperty("dfc-b:endDate", &method("endDate")).valueSetter = method("endDate=")
|
|
67
|
+
registerSemanticProperty("dfc-b:hasIncome", &method("consumptionFlow")).valueSetter = method("consumptionFlow=")
|
|
68
|
+
registerSemanticProperty("dfc-b:hasOutcome", &method("productionFlow")).valueSetter = method("productionFlow=")
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
end
|