datafoodconsortium-connector 1.0.0.pre.alpha.10 → 1.0.0.pre.alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datafoodconsortium/connector/address.rb +19 -1
- data/lib/datafoodconsortium/connector/agent.rb +7 -1
- data/lib/datafoodconsortium/connector/defined_product.rb +7 -1
- data/lib/datafoodconsortium/connector/enterprise.rb +3 -2
- data/lib/datafoodconsortium/connector/flow.rb +46 -0
- data/lib/datafoodconsortium/connector/order.rb +19 -1
- data/lib/datafoodconsortium/connector/person.rb +3 -2
- data/lib/datafoodconsortium/connector/planned_consumption_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/planned_production_flow.rb +56 -0
- data/lib/datafoodconsortium/connector/planned_transformation.rb +59 -0
- data/lib/datafoodconsortium/connector/social_media.rb +0 -4
- data/lib/datafoodconsortium/connector/supplied_product.rb +3 -2
- data/lib/datafoodconsortium/connector/technical_product.rb +3 -2
- data/lib/datafoodconsortium/connector.rb +4 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c1487755e51bd985e7599d98c95fad225a3b4978c97e67cecef5d13f9248810
|
4
|
+
data.tar.gz: e0ceaf49a623e3888e1f367c0486e169e7b9e8faa823ffca2ddc31b8d2936a53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa17e1874a8eb4ccff56c027da9aeddb8605a9c886f42ce7f5a80d8c21730da57ce4aa46f13672a9ff6f6d2dd4bbd8ce949e954e673ab5ff120489f754fb8fee
|
7
|
+
data.tar.gz: 470abfb781c9405fdddd6e97e9f72d03447f7e5ebcc27e39a818db5cb594b55cd7a5709175c4d50466e8a6193782787c9b441f862632f0a2ad825a0d7b0ab9a2
|
@@ -40,22 +40,40 @@ class DataFoodConsortium::Connector::Address
|
|
40
40
|
# @return [String]
|
41
41
|
attr_accessor :country
|
42
42
|
|
43
|
+
# @return [Real]
|
44
|
+
attr_accessor :latitude
|
45
|
+
|
46
|
+
# @return [Real]
|
47
|
+
attr_accessor :longitude
|
48
|
+
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :region
|
51
|
+
|
43
52
|
# @param semanticId [String]
|
44
53
|
# @param street [String]
|
45
54
|
# @param postalCode [String]
|
46
55
|
# @param city [String]
|
47
56
|
# @param country [String]
|
48
|
-
|
57
|
+
# @param latitude [Real]
|
58
|
+
# @param longitude [Real]
|
59
|
+
# @param region [String]
|
60
|
+
def initialize(semanticId, street: "", postalCode: "", city: "", country: "", latitude: 0.0, longitude: 0.0, region: "")
|
49
61
|
super(semanticId)
|
50
62
|
@street = street
|
51
63
|
@postalCode = postalCode
|
52
64
|
@city = city
|
53
65
|
@country = country
|
66
|
+
@latitude = latitude
|
67
|
+
@longitude = longitude
|
68
|
+
@region = region
|
54
69
|
self.semanticType = "dfc-b:Address"
|
55
70
|
registerSemanticProperty("dfc-b:hasStreet", &method("street")).valueSetter = method("street=")
|
56
71
|
registerSemanticProperty("dfc-b:hasPostalCode", &method("postalCode")).valueSetter = method("postalCode=")
|
57
72
|
registerSemanticProperty("dfc-b:hasCity", &method("city")).valueSetter = method("city=")
|
58
73
|
registerSemanticProperty("dfc-b:hasCountry", &method("country")).valueSetter = method("country=")
|
74
|
+
registerSemanticProperty("dfc-b:latitude", &method("latitude")).valueSetter = method("latitude=")
|
75
|
+
registerSemanticProperty("dfc-b:longitude", &method("longitude")).valueSetter = method("longitude=")
|
76
|
+
registerSemanticProperty("dfc-b:region", &method("region")).valueSetter = method("region=")
|
59
77
|
end
|
60
78
|
|
61
79
|
|
@@ -44,25 +44,31 @@ class DataFoodConsortium::Connector::Agent
|
|
44
44
|
# @return [ISocialMedia]
|
45
45
|
attr_accessor :socialMedias
|
46
46
|
|
47
|
+
# @return [String]
|
48
|
+
attr_accessor :logo
|
49
|
+
|
47
50
|
# @param semanticId [String]
|
48
51
|
# @param localizations [IAddress]
|
49
52
|
# @param phoneNumbers [IPhoneNumber]
|
50
53
|
# @param emails [String]
|
51
54
|
# @param websites [String]
|
52
55
|
# @param socialMedias [ISocialMedia]
|
53
|
-
|
56
|
+
# @param logo [String]
|
57
|
+
def initialize(semanticId, localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [], logo: "")
|
54
58
|
super(semanticId)
|
55
59
|
@localizations = localizations
|
56
60
|
@phoneNumbers = phoneNumbers
|
57
61
|
@emails = emails
|
58
62
|
@websites = websites
|
59
63
|
@socialMedias = socialMedias
|
64
|
+
@logo = logo
|
60
65
|
self.semanticType = "dfc-b:Agent"
|
61
66
|
registerSemanticProperty("dfc-b:hasAddress", &method("localizations")).valueSetter = method("localizations=")
|
62
67
|
registerSemanticProperty("dfc-b:hasPhoneNumber", &method("phoneNumbers")).valueSetter = method("phoneNumbers=")
|
63
68
|
registerSemanticProperty("dfc-b:email", &method("emails")).valueSetter = method("emails=")
|
64
69
|
registerSemanticProperty("dfc-b:websitePage", &method("websites")).valueSetter = method("websites=")
|
65
70
|
registerSemanticProperty("dfc-b:hasSocialMedia", &method("socialMedias")).valueSetter = method("socialMedias=")
|
71
|
+
registerSemanticProperty("dfc-b:logo", &method("logo")).valueSetter = method("logo=")
|
66
72
|
end
|
67
73
|
|
68
74
|
|
@@ -82,6 +82,9 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
82
82
|
# @return [ISKOSConcept]
|
83
83
|
attr_accessor :partOrigin
|
84
84
|
|
85
|
+
# @return [String]
|
86
|
+
attr_accessor :images
|
87
|
+
|
85
88
|
# @param semanticId [String]
|
86
89
|
# @param name [String]
|
87
90
|
# @param description [String]
|
@@ -99,7 +102,8 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
99
102
|
# @param certifications [ISKOSConcept]
|
100
103
|
# @param natureOrigin [ISKOSConcept]
|
101
104
|
# @param partOrigin [ISKOSConcept]
|
102
|
-
|
105
|
+
# @param images [String]
|
106
|
+
def initialize(semanticId, name: "", description: "", productType: nil, quantity: nil, alcoholPercentage: 0.0, lifetime: "", claims: [], usageOrStorageConditions: "", allergenCharacteristics: [], nutrientCharacteristics: [], physicalCharacteristics: [], geographicalOrigin: nil, catalogItems: [], certifications: [], natureOrigin: [], partOrigin: [], images: [])
|
103
107
|
super(semanticId)
|
104
108
|
@name = name
|
105
109
|
@description = description
|
@@ -117,6 +121,7 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
117
121
|
@certifications = certifications
|
118
122
|
@natureOrigin = natureOrigin
|
119
123
|
@partOrigin = partOrigin
|
124
|
+
@images = images
|
120
125
|
self.semanticType = "dfc-b:DefinedProduct"
|
121
126
|
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
122
127
|
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
@@ -134,6 +139,7 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
134
139
|
registerSemanticProperty("dfc-b:hasCertification", &method("certifications")).valueSetter = method("certifications=")
|
135
140
|
registerSemanticProperty("dfc-b:hasNatureOrigin", &method("natureOrigin")).valueSetter = method("natureOrigin=")
|
136
141
|
registerSemanticProperty("dfc-b:hasPartOrigin", &method("partOrigin")).valueSetter = method("partOrigin=")
|
142
|
+
registerSemanticProperty("dfc-b:image", &method("images")).valueSetter = method("images=")
|
137
143
|
end
|
138
144
|
|
139
145
|
|
@@ -79,8 +79,9 @@ class DataFoodConsortium::Connector::Enterprise < DataFoodConsortium::Connector:
|
|
79
79
|
# @param emails [String]
|
80
80
|
# @param websites [String]
|
81
81
|
# @param socialMedias [ISocialMedia]
|
82
|
-
|
83
|
-
|
82
|
+
# @param logo [String]
|
83
|
+
def initialize(semanticId, name: "", description: "", vatNumber: "", customerCategories: [], catalogs: [], catalogItems: [], suppliedProducts: [], technicalProducts: [], mainContact: nil, localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [], logo: "")
|
84
|
+
super(semanticId, localizations: localizations, phoneNumbers: phoneNumbers, emails: emails, websites: websites, socialMedias: socialMedias, logo: logo)
|
84
85
|
@name = name
|
85
86
|
@description = description
|
86
87
|
@vatNumber = vatNumber
|
@@ -0,0 +1,46 @@
|
|
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::Flow
|
28
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
29
|
+
|
30
|
+
SEMANTIC_TYPE = "".freeze
|
31
|
+
|
32
|
+
# @return [IQuantity]
|
33
|
+
attr_accessor :quantity
|
34
|
+
|
35
|
+
# @param semanticId [String]
|
36
|
+
# @param quantity [IQuantity]
|
37
|
+
def initialize(semanticId, quantity: nil)
|
38
|
+
super(semanticId)
|
39
|
+
@quantity = quantity
|
40
|
+
self.semanticType = ""
|
41
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("quantity")).valueSetter = method("quantity=")
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
end
|
@@ -46,25 +46,43 @@ class DataFoodConsortium::Connector::Order
|
|
46
46
|
# @return [IAgent]
|
47
47
|
attr_accessor :client
|
48
48
|
|
49
|
+
# @return [ISKOSConcept]
|
50
|
+
attr_accessor :fulfilmentStatus
|
51
|
+
|
52
|
+
# @return [ISKOSConcept]
|
53
|
+
attr_accessor :orderStatus
|
54
|
+
|
55
|
+
# @return [ISKOSConcept]
|
56
|
+
attr_accessor :paymentStatus
|
57
|
+
|
49
58
|
# @param semanticId [String]
|
50
59
|
# @param number [String]
|
51
60
|
# @param date [String]
|
52
61
|
# @param saleSession [ISaleSession]
|
53
62
|
# @param lines [IOrderLine]
|
54
63
|
# @param client [IAgent]
|
55
|
-
|
64
|
+
# @param fulfilmentStatus [ISKOSConcept]
|
65
|
+
# @param orderStatus [ISKOSConcept]
|
66
|
+
# @param paymentStatus [ISKOSConcept]
|
67
|
+
def initialize(semanticId, number: "", date: "", saleSession: nil, lines: [], client: nil, fulfilmentStatus: nil, orderStatus: nil, paymentStatus: nil)
|
56
68
|
super(semanticId)
|
57
69
|
@number = number
|
58
70
|
@date = date
|
59
71
|
@saleSession = saleSession
|
60
72
|
@lines = lines
|
61
73
|
@client = client
|
74
|
+
@fulfilmentStatus = fulfilmentStatus
|
75
|
+
@orderStatus = orderStatus
|
76
|
+
@paymentStatus = paymentStatus
|
62
77
|
self.semanticType = "dfc-b:Order"
|
63
78
|
registerSemanticProperty("dfc-b:orderNumber", &method("number")).valueSetter = method("number=")
|
64
79
|
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
65
80
|
registerSemanticProperty("dfc-b:belongsTo", &method("saleSession")).valueSetter = method("saleSession=")
|
66
81
|
registerSemanticProperty("dfc-b:hasPart", &method("lines")).valueSetter = method("lines=")
|
67
82
|
registerSemanticProperty("dfc-b:orderedBy", &method("client")).valueSetter = method("client=")
|
83
|
+
registerSemanticProperty("dfc-b:hasFulfilmentStatus", &method("fulfilmentStatus")).valueSetter = method("fulfilmentStatus=")
|
84
|
+
registerSemanticProperty("dfc-b:hasOrderStatus", &method("orderStatus")).valueSetter = method("orderStatus=")
|
85
|
+
registerSemanticProperty("dfc-b:hasPaymentStatus", &method("paymentStatus")).valueSetter = method("paymentStatus=")
|
68
86
|
end
|
69
87
|
|
70
88
|
|
@@ -48,8 +48,9 @@ class DataFoodConsortium::Connector::Person < DataFoodConsortium::Connector::Age
|
|
48
48
|
# @param emails [String]
|
49
49
|
# @param websites [String]
|
50
50
|
# @param socialMedias [ISocialMedia]
|
51
|
-
|
52
|
-
|
51
|
+
# @param logo [String]
|
52
|
+
def initialize(semanticId, firstName: "", lastName: "", affiliatedOrganizations: [], localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [], logo: "")
|
53
|
+
super(semanticId, localizations: localizations, phoneNumbers: phoneNumbers, emails: emails, websites: websites, socialMedias: socialMedias, logo: logo)
|
53
54
|
@firstName = firstName
|
54
55
|
@lastName = lastName
|
55
56
|
@affiliatedOrganizations = affiliatedOrganizations
|
@@ -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::PlannedConsumptionFlow < DataFoodConsortium::Connector::Flow
|
32
|
+
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedConsumptionFlow".freeze
|
34
|
+
|
35
|
+
# @return [IPlannedTransformation]
|
36
|
+
attr_accessor :transformation
|
37
|
+
|
38
|
+
# @return [IDefinedProduct]
|
39
|
+
attr_accessor :product
|
40
|
+
|
41
|
+
# @param semanticId [String]
|
42
|
+
# @param transformation [IPlannedTransformation]
|
43
|
+
# @param product [IDefinedProduct]
|
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:AsPlannedConsumptionFlow"
|
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::PlannedProductionFlow < DataFoodConsortium::Connector::Flow
|
32
|
+
|
33
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedProductionFlow".freeze
|
34
|
+
|
35
|
+
# @return [IPlannedTransformation]
|
36
|
+
attr_accessor :transformation
|
37
|
+
|
38
|
+
# @return [ISuppliedProduct]
|
39
|
+
attr_accessor :product
|
40
|
+
|
41
|
+
# @param semanticId [String]
|
42
|
+
# @param transformation [IPlannedTransformation]
|
43
|
+
# @param product [ISuppliedProduct]
|
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:AsPlannedProductionFlow"
|
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,59 @@
|
|
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 "virtual_assembly/semantizer"
|
27
|
+
|
28
|
+
class DataFoodConsortium::Connector::PlannedTransformation
|
29
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
30
|
+
|
31
|
+
SEMANTIC_TYPE = "dfc-b:AsPlannedTransformation".freeze
|
32
|
+
|
33
|
+
# @return [ISKOSConcept]
|
34
|
+
attr_accessor :transformationType
|
35
|
+
|
36
|
+
# @return [IPlannedConsumptionFlow]
|
37
|
+
attr_accessor :consumptionFlow
|
38
|
+
|
39
|
+
# @return [IPlannedProductionFlow]
|
40
|
+
attr_accessor :productionFlow
|
41
|
+
|
42
|
+
# @param semanticId [String]
|
43
|
+
# @param transformationType [ISKOSConcept]
|
44
|
+
# @param consumptionFlow [IPlannedConsumptionFlow]
|
45
|
+
# @param productionFlow [IPlannedProductionFlow]
|
46
|
+
def initialize(semanticId, transformationType: nil, consumptionFlow: nil, productionFlow: nil)
|
47
|
+
super(semanticId)
|
48
|
+
@transformationType = transformationType
|
49
|
+
@consumptionFlow = consumptionFlow
|
50
|
+
@productionFlow = productionFlow
|
51
|
+
self.semanticType = "dfc-b:AsPlannedTransformation"
|
52
|
+
registerSemanticProperty("dfc-b:hasTransformationType", &method("transformationType")).valueSetter = method("transformationType=")
|
53
|
+
registerSemanticProperty("dfc-b:hasIncome", &method("consumptionFlow")).valueSetter = method("consumptionFlow=")
|
54
|
+
registerSemanticProperty("dfc-b:hasOutcome", &method("productionFlow")).valueSetter = method("productionFlow=")
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
end
|
@@ -59,8 +59,9 @@ class DataFoodConsortium::Connector::SuppliedProduct < DataFoodConsortium::Conne
|
|
59
59
|
# @param certifications [ISKOSConcept]
|
60
60
|
# @param natureOrigin [ISKOSConcept]
|
61
61
|
# @param partOrigin [ISKOSConcept]
|
62
|
-
|
63
|
-
|
62
|
+
# @param images [String]
|
63
|
+
def initialize(semanticId, totalTheoreticalStock: 0.0, name: "", description: "", productType: nil, quantity: nil, alcoholPercentage: 0.0, lifetime: "", claims: [], usageOrStorageConditions: "", allergenCharacteristics: [], nutrientCharacteristics: [], physicalCharacteristics: [], geographicalOrigin: nil, catalogItems: [], certifications: [], natureOrigin: [], partOrigin: [], images: [])
|
64
|
+
super(semanticId, name: name, description: description, productType: productType, quantity: quantity, alcoholPercentage: alcoholPercentage, lifetime: lifetime, claims: claims, usageOrStorageConditions: usageOrStorageConditions, allergenCharacteristics: allergenCharacteristics, nutrientCharacteristics: nutrientCharacteristics, physicalCharacteristics: physicalCharacteristics, geographicalOrigin: geographicalOrigin, catalogItems: catalogItems, certifications: certifications, natureOrigin: natureOrigin, partOrigin: partOrigin, images: images)
|
64
65
|
@totalTheoreticalStock = totalTheoreticalStock
|
65
66
|
self.semanticType = "dfc-b:SuppliedProduct"
|
66
67
|
registerSemanticProperty("dfc-b:totalTheoreticalStock", &method("totalTheoreticalStock")).valueSetter = method("totalTheoreticalStock=")
|
@@ -47,8 +47,9 @@ class DataFoodConsortium::Connector::TechnicalProduct < DataFoodConsortium::Conn
|
|
47
47
|
# @param certifications [ISKOSConcept]
|
48
48
|
# @param natureOrigin [ISKOSConcept]
|
49
49
|
# @param partOrigin [ISKOSConcept]
|
50
|
-
|
51
|
-
|
50
|
+
# @param images [String]
|
51
|
+
def initialize(semanticId, name: "", description: "", productType: nil, quantity: nil, alcoholPercentage: 0.0, lifetime: "", claims: [], usageOrStorageConditions: "", allergenCharacteristics: [], nutrientCharacteristics: [], physicalCharacteristics: [], geographicalOrigin: nil, catalogItems: [], certifications: [], natureOrigin: [], partOrigin: [], images: [])
|
52
|
+
super(semanticId, name: name, description: description, productType: productType, quantity: quantity, alcoholPercentage: alcoholPercentage, lifetime: lifetime, claims: claims, usageOrStorageConditions: usageOrStorageConditions, allergenCharacteristics: allergenCharacteristics, nutrientCharacteristics: nutrientCharacteristics, physicalCharacteristics: physicalCharacteristics, geographicalOrigin: geographicalOrigin, catalogItems: catalogItems, certifications: certifications, natureOrigin: natureOrigin, partOrigin: partOrigin, images: images)
|
52
53
|
|
53
54
|
self.semanticType = "dfc-b:TechnicalProduct"
|
54
55
|
|
@@ -18,6 +18,10 @@ module DataFoodConsortium
|
|
18
18
|
require 'datafoodconsortium/connector/quantitative_value.rb'
|
19
19
|
require 'datafoodconsortium/connector/quantity.rb'
|
20
20
|
require 'datafoodconsortium/connector/defined_product.rb'
|
21
|
+
require 'datafoodconsortium/connector/flow.rb'
|
22
|
+
require 'datafoodconsortium/connector/planned_consumption_flow.rb'
|
23
|
+
require 'datafoodconsortium/connector/planned_production_flow.rb'
|
24
|
+
require 'datafoodconsortium/connector/planned_transformation.rb'
|
21
25
|
require 'datafoodconsortium/connector/supplied_product.rb'
|
22
26
|
require 'datafoodconsortium/connector/technical_product.rb'
|
23
27
|
require 'datafoodconsortium/connector/catalog.rb'
|
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.pre.alpha.
|
4
|
+
version: 1.0.0.pre.alpha.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Lecoq
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtual_assembly-semantizer
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- lib/datafoodconsortium/connector/customer_category.rb
|
49
49
|
- lib/datafoodconsortium/connector/defined_product.rb
|
50
50
|
- lib/datafoodconsortium/connector/enterprise.rb
|
51
|
+
- lib/datafoodconsortium/connector/flow.rb
|
51
52
|
- lib/datafoodconsortium/connector/importer.rb
|
52
53
|
- lib/datafoodconsortium/connector/json_ld_serializer.rb
|
53
54
|
- lib/datafoodconsortium/connector/nutrient_characteristic.rb
|
@@ -57,6 +58,9 @@ files:
|
|
57
58
|
- lib/datafoodconsortium/connector/person.rb
|
58
59
|
- lib/datafoodconsortium/connector/phone_number.rb
|
59
60
|
- lib/datafoodconsortium/connector/physical_characteristic.rb
|
61
|
+
- lib/datafoodconsortium/connector/planned_consumption_flow.rb
|
62
|
+
- lib/datafoodconsortium/connector/planned_production_flow.rb
|
63
|
+
- lib/datafoodconsortium/connector/planned_transformation.rb
|
60
64
|
- lib/datafoodconsortium/connector/price.rb
|
61
65
|
- lib/datafoodconsortium/connector/quantitative_value.rb
|
62
66
|
- lib/datafoodconsortium/connector/quantity.rb
|
@@ -71,7 +75,9 @@ files:
|
|
71
75
|
homepage: https://github.com/datafoodconsortium/connector-ruby/
|
72
76
|
licenses:
|
73
77
|
- MIT
|
74
|
-
metadata:
|
78
|
+
metadata:
|
79
|
+
changelog_uri: https://github.com/datafoodconsortium/connector-ruby/blob/main/CHANGELOG.md
|
80
|
+
source_code_uri: https://github.com/datafoodconsortium/connector-ruby/
|
75
81
|
post_install_message:
|
76
82
|
rdoc_options: []
|
77
83
|
require_paths:
|