datafoodconsortium-connector 1.0.0.pre.alpha.3 → 1.0.0.pre.alpha.5
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 +18 -7
- data/lib/datafoodconsortium/connector/agent.rb +16 -7
- data/lib/datafoodconsortium/connector/allergen_characteristic.rb +8 -5
- data/lib/datafoodconsortium/connector/allergen_dimension.rb +1 -1
- data/lib/datafoodconsortium/connector/catalog_item.rb +18 -12
- data/lib/datafoodconsortium/connector/certification.rb +1 -1
- data/lib/datafoodconsortium/connector/characteristic.rb +5 -3
- data/lib/datafoodconsortium/connector/connector.rb +8 -11
- data/lib/datafoodconsortium/connector/customer_category.rb +6 -7
- data/lib/datafoodconsortium/connector/defined_product.rb +88 -25
- data/lib/datafoodconsortium/connector/enterprise.rb +30 -29
- data/lib/datafoodconsortium/connector/geographical_origin.rb +1 -1
- data/lib/datafoodconsortium/connector/json_ld_serializer.rb +16 -4
- data/lib/datafoodconsortium/connector/nutrient_characteristic.rb +8 -5
- data/lib/datafoodconsortium/connector/offer.rb +18 -9
- data/lib/datafoodconsortium/connector/part_origin.rb +1 -1
- data/lib/datafoodconsortium/connector/person.rb +19 -6
- data/lib/datafoodconsortium/connector/physical_characteristic.rb +8 -5
- data/lib/datafoodconsortium/connector/price.rb +55 -0
- data/lib/datafoodconsortium/connector/quantitative_value.rb +13 -8
- data/lib/datafoodconsortium/connector/skos_concept.rb +24 -22
- data/lib/datafoodconsortium/connector/supplied_product.rb +28 -5
- data/lib/datafoodconsortium/connector.rb +12 -11
- metadata +33 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '038c834a93288301c728b90f0295f52c59a8a96e164a03d965a90f2d7d4abafc'
|
4
|
+
data.tar.gz: 2f1089809c6fb52f182f001fe0e80e648bb2f2d740e3d069925fa24e010d2910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbd1850d8b3757a44dbf2fd6b4a5af9fd4f5bc8484f125d2d87bff486bbd1e2710db6836220bd425a57a6685d71071169842b04900cf9b5f551e813c42a4f608
|
7
|
+
data.tar.gz: 75f945233471dc052ba5f86ffc1bf51e374fc3534e595ec7a7bb6c3957520689f15566779255a7c08526ec993229335bca9d53d7aad2c57a70e6347af343ae6a
|
@@ -27,19 +27,30 @@ class DataFoodConsortium::Connector::Address
|
|
27
27
|
|
28
28
|
include VirtualAssembly::Semantizer::SemanticObject
|
29
29
|
|
30
|
+
# @return [String]
|
30
31
|
attr_accessor :street
|
32
|
+
|
33
|
+
# @return [String]
|
31
34
|
attr_accessor :postalCode
|
35
|
+
|
36
|
+
# @return [String]
|
32
37
|
attr_accessor :city
|
38
|
+
|
39
|
+
# @return [String]
|
33
40
|
attr_accessor :country
|
34
41
|
|
35
|
-
|
36
|
-
|
42
|
+
# @param semanticId [String]
|
43
|
+
# @param street [String]
|
44
|
+
# @param postalCode [String]
|
45
|
+
# @param city [String]
|
46
|
+
# @param country [String]
|
47
|
+
def initialize(semanticId, street: "", postalCode: "", city: "", country: "")
|
48
|
+
super(semanticId)
|
49
|
+
@street = street
|
50
|
+
@postalCode = postalCode
|
51
|
+
@city = city
|
52
|
+
@country = country
|
37
53
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Address"
|
38
|
-
self.street = street
|
39
|
-
self.postalCode = postalCode
|
40
|
-
self.city = city
|
41
|
-
self.country = country
|
42
|
-
|
43
54
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasStreet") { self.street }
|
44
55
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasPostalCode") { self.postalCode }
|
45
56
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasCity") { self.city }
|
@@ -29,33 +29,42 @@ class DataFoodConsortium::Connector::Agent
|
|
29
29
|
|
30
30
|
include VirtualAssembly::Semantizer::SemanticObject
|
31
31
|
|
32
|
+
# @return [Contactable]
|
32
33
|
attr_accessor :contacts
|
34
|
+
|
35
|
+
# @return [Localizable]
|
33
36
|
attr_accessor :localizations
|
34
37
|
|
35
|
-
|
36
|
-
|
38
|
+
# @param semanticId [String]
|
39
|
+
# @param contacts [Contactable]
|
40
|
+
# @param localizations [Localizable]
|
41
|
+
def initialize(semanticId, contacts: [], localizations: [])
|
42
|
+
super(semanticId)
|
43
|
+
@contacts = contacts
|
44
|
+
@localizations = localizations
|
37
45
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Agent"
|
38
|
-
|
39
|
-
self.contacts = []
|
40
|
-
self.localizations = []
|
41
46
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasAddress") { self.localizations }
|
42
47
|
end
|
43
48
|
|
44
49
|
|
50
|
+
|
45
51
|
def addContact(contact)
|
46
52
|
self.contacts.push(contact)
|
47
53
|
end
|
48
54
|
|
55
|
+
|
49
56
|
def addLocalization(localization)
|
50
57
|
self.localizations.push(localization)
|
51
58
|
end
|
52
59
|
|
60
|
+
|
53
61
|
def removeContact(contact)
|
54
|
-
raise "Not implemented"
|
62
|
+
raise "Not yet implemented."
|
55
63
|
end
|
56
64
|
|
65
|
+
|
57
66
|
def removeLocalization(localization)
|
58
|
-
raise "Not implemented"
|
67
|
+
raise "Not yet implemented."
|
59
68
|
end
|
60
69
|
|
61
70
|
|
@@ -21,22 +21,25 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
|
24
|
+
require "datafoodconsortium/connector/characteristic"
|
24
25
|
|
25
26
|
|
26
|
-
require "datafoodconsortium/connector/characteristic"
|
27
27
|
require "virtual_assembly/semantizer"
|
28
28
|
|
29
29
|
class DataFoodConsortium::Connector::AllergenCharacteristic < DataFoodConsortium::Connector::Characteristic
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
# @return [IAllergenDimension]
|
33
34
|
attr_accessor :allergenDimension
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
# @param allergenDimension [IAllergenDimension]
|
37
|
+
# @param unit [IUnit]
|
38
|
+
# @param value [Real]
|
39
|
+
def initialize(allergenDimension: nil, unit: nil, value: 0.0)
|
40
|
+
super(unit: unit, value: value)
|
41
|
+
@allergenDimension = allergenDimension
|
37
42
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#AllergenCharacteristic"
|
38
|
-
self.allergenDimension = allergenDimension
|
39
|
-
|
40
43
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasAllergenDimension") { self.allergenDimension }
|
41
44
|
end
|
42
45
|
|
@@ -20,8 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
|
24
23
|
require "datafoodconsortium/connector/characteristic_dimension"
|
24
|
+
|
25
25
|
require "virtual_assembly/semantizer"
|
26
26
|
|
27
27
|
class DataFoodConsortium::Connector::AllergenDimension < DataFoodConsortium::Connector::CharacteristicDimension
|
@@ -29,18 +29,30 @@ class DataFoodConsortium::Connector::CatalogItem
|
|
29
29
|
|
30
30
|
include VirtualAssembly::Semantizer::SemanticObject
|
31
31
|
|
32
|
+
# @return [IDefinedProduct]
|
32
33
|
attr_accessor :product
|
34
|
+
|
35
|
+
# @return [String]
|
33
36
|
attr_accessor :sku
|
37
|
+
|
38
|
+
# @return [Real]
|
34
39
|
attr_accessor :stockLimitation
|
40
|
+
|
41
|
+
# @return [IOffer]
|
35
42
|
attr_accessor :offers
|
36
43
|
|
37
|
-
|
38
|
-
|
44
|
+
# @param semanticId [String]
|
45
|
+
# @param product [IDefinedProduct]
|
46
|
+
# @param sku [String]
|
47
|
+
# @param stockLimitation [Real]
|
48
|
+
# @param offers [IOffer]
|
49
|
+
def initialize(semanticId, product: nil, sku: "", stockLimitation: 0.0, offers: [])
|
50
|
+
super(semanticId)
|
51
|
+
@product = product
|
52
|
+
@sku = sku
|
53
|
+
@stockLimitation = stockLimitation
|
54
|
+
@offers = offers
|
39
55
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#CatalogItem"
|
40
|
-
self.product = product
|
41
|
-
self.sku = nil
|
42
|
-
self.stockLimitation = nil
|
43
|
-
self.offers = []
|
44
56
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#references") { self.product }
|
45
57
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#sku") { self.sku }
|
46
58
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation }
|
@@ -50,13 +62,7 @@ class DataFoodConsortium::Connector::CatalogItem
|
|
50
62
|
|
51
63
|
|
52
64
|
|
53
|
-
def addOffer(offer)
|
54
|
-
self.offers.push(offer)
|
55
|
-
end
|
56
65
|
|
57
|
-
def addOffer(offer)
|
58
|
-
self.offers.push(offer)
|
59
|
-
end
|
60
66
|
|
61
67
|
|
62
68
|
end
|
@@ -20,8 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
|
24
23
|
require "datafoodconsortium/connector/skos_concept"
|
24
|
+
|
25
25
|
require "virtual_assembly/semantizer"
|
26
26
|
|
27
27
|
class DataFoodConsortium::Connector::Certification < DataFoodConsortium::Connector::SKOSConcept
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
require "datafoodconsortium/connector/quantitative_value"
|
26
|
+
|
26
27
|
require "virtual_assembly/semantizer"
|
27
28
|
|
28
29
|
class DataFoodConsortium::Connector::Characteristic < DataFoodConsortium::Connector::QuantitativeValue
|
@@ -30,9 +31,10 @@ class DataFoodConsortium::Connector::Characteristic < DataFoodConsortium::Connec
|
|
30
31
|
|
31
32
|
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
# @param unit [IUnit]
|
35
|
+
# @param value [Real]
|
36
|
+
def initialize(unit: nil, value: 0.0)
|
37
|
+
super(unit: unit, value: value)
|
36
38
|
|
37
39
|
|
38
40
|
|
@@ -27,24 +27,26 @@ class DataFoodConsortium::Connector::Connector
|
|
27
27
|
|
28
28
|
include Singleton
|
29
29
|
|
30
|
+
attr_accessor :context
|
31
|
+
|
30
32
|
attr_reader :FACETS
|
31
33
|
attr_reader :MEASURES
|
32
34
|
attr_reader :PRODUCT_TYPES
|
33
35
|
|
34
|
-
def export(subject)
|
35
|
-
return @exporter.process(subject)
|
36
|
+
def export(subject, *subjects)
|
37
|
+
return @exporter.process(subject, *subjects)
|
36
38
|
end
|
37
39
|
|
38
40
|
def loadFacets(data)
|
39
|
-
@FACETS = loadThesaurus(data)
|
41
|
+
@FACETS = loadThesaurus(data)
|
40
42
|
end
|
41
43
|
|
42
44
|
def loadMeasures(data)
|
43
|
-
@MEASURES = loadThesaurus(data)
|
45
|
+
@MEASURES = loadThesaurus(data)
|
44
46
|
end
|
45
47
|
|
46
48
|
def loadProductTypes(data)
|
47
|
-
@PRODUCT_TYPES = loadThesaurus(data)
|
49
|
+
@PRODUCT_TYPES = loadThesaurus(data)
|
48
50
|
end
|
49
51
|
|
50
52
|
private
|
@@ -52,12 +54,7 @@ class DataFoodConsortium::Connector::Connector
|
|
52
54
|
def initialize()
|
53
55
|
super()
|
54
56
|
|
55
|
-
@context =
|
56
|
-
"@context": {
|
57
|
-
"dfc-b": "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#"
|
58
|
-
}
|
59
|
-
}))['@context']
|
60
|
-
|
57
|
+
@context = "http://static.datafoodconsortium.org/ontologies/context.json"
|
61
58
|
@exporter = DataFoodConsortium::Connector::JsonLdSerializer.new(@context)
|
62
59
|
@parser = DataFoodConsortium::Connector::SKOSParser.new
|
63
60
|
|
@@ -27,16 +27,15 @@ class DataFoodConsortium::Connector::CustomerCategory
|
|
27
27
|
|
28
28
|
include VirtualAssembly::Semantizer::SemanticObject
|
29
29
|
|
30
|
-
|
30
|
+
# @return [String]
|
31
31
|
attr_accessor :description
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
# @param semanticId [String]
|
34
|
+
# @param description [String]
|
35
|
+
def initialize(semanticId, description: "")
|
36
|
+
super(semanticId)
|
37
|
+
@description = description
|
35
38
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#CustomerCategory"
|
36
|
-
self.name = name
|
37
|
-
self.description = description
|
38
|
-
|
39
|
-
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#name") { self.name }
|
40
39
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#description") { self.description }
|
41
40
|
end
|
42
41
|
|
@@ -38,42 +38,90 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
38
38
|
|
39
39
|
include VirtualAssembly::Semantizer::SemanticObject
|
40
40
|
|
41
|
+
# @return [String]
|
41
42
|
attr_accessor :name
|
43
|
+
|
44
|
+
# @return [String]
|
42
45
|
attr_accessor :description
|
46
|
+
|
47
|
+
# @return [IProductType]
|
43
48
|
attr_accessor :productType
|
49
|
+
|
50
|
+
# @return [Quantifiable]
|
44
51
|
attr_accessor :quantity
|
52
|
+
|
53
|
+
# @return [Real]
|
45
54
|
attr_accessor :alcoholPercentage
|
55
|
+
|
56
|
+
# @return [String]
|
46
57
|
attr_accessor :lifetime
|
58
|
+
|
59
|
+
# @return [Claimable]
|
47
60
|
attr_accessor :claims
|
61
|
+
|
62
|
+
# @return [String]
|
48
63
|
attr_accessor :usageOrStorageConditions
|
64
|
+
|
65
|
+
# @return [IAllergenCharacteristic]
|
49
66
|
attr_accessor :allergenCharacteristics
|
67
|
+
|
68
|
+
# @return [INutrientCharacteristic]
|
50
69
|
attr_accessor :nutrientCharacteristics
|
70
|
+
|
71
|
+
# @return [IPhysicalCharacteristic]
|
51
72
|
attr_accessor :physicalCharacteristics
|
73
|
+
|
74
|
+
# @return [IGeographicalOrigin]
|
52
75
|
attr_accessor :geographicalOrigin
|
76
|
+
|
77
|
+
# @return [ICatalogItem]
|
53
78
|
attr_accessor :catalogItems
|
79
|
+
|
80
|
+
# @return [ICertification]
|
54
81
|
attr_accessor :certifications
|
82
|
+
|
83
|
+
# @return [INatureOrigin]
|
55
84
|
attr_accessor :natureOrigin
|
85
|
+
|
86
|
+
# @return [IPartOrigin]
|
56
87
|
attr_accessor :partOrigin
|
57
88
|
|
58
|
-
|
59
|
-
|
89
|
+
# @param semanticId [String]
|
90
|
+
# @param name [String]
|
91
|
+
# @param description [String]
|
92
|
+
# @param productType [IProductType]
|
93
|
+
# @param quantity [Quantifiable]
|
94
|
+
# @param alcoholPercentage [Real]
|
95
|
+
# @param lifetime [String]
|
96
|
+
# @param claims [Claimable]
|
97
|
+
# @param usageOrStorageConditions [String]
|
98
|
+
# @param allergenCharacteristics [IAllergenCharacteristic]
|
99
|
+
# @param nutrientCharacteristics [INutrientCharacteristic]
|
100
|
+
# @param physicalCharacteristics [IPhysicalCharacteristic]
|
101
|
+
# @param geographicalOrigin [IGeographicalOrigin]
|
102
|
+
# @param catalogItems [ICatalogItem]
|
103
|
+
# @param certifications [ICertification]
|
104
|
+
# @param natureOrigin [INatureOrigin]
|
105
|
+
# @param partOrigin [IPartOrigin]
|
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: [])
|
107
|
+
super(semanticId)
|
108
|
+
@name = name
|
109
|
+
@description = description
|
110
|
+
@productType = productType
|
111
|
+
@quantity = quantity
|
112
|
+
@alcoholPercentage = alcoholPercentage
|
113
|
+
@lifetime = lifetime
|
114
|
+
@claims = claims
|
115
|
+
@usageOrStorageConditions = usageOrStorageConditions
|
116
|
+
@allergenCharacteristics = allergenCharacteristics
|
117
|
+
@nutrientCharacteristics = nutrientCharacteristics
|
118
|
+
@physicalCharacteristics = physicalCharacteristics
|
119
|
+
@geographicalOrigin = geographicalOrigin
|
120
|
+
@catalogItems = catalogItems
|
121
|
+
@certifications = certifications
|
122
|
+
@natureOrigin = natureOrigin
|
123
|
+
@partOrigin = partOrigin
|
60
124
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#DefinedProduct"
|
61
|
-
self.name = name
|
62
|
-
self.description = description
|
63
|
-
self.productType = nil
|
64
|
-
self.quantity = nil
|
65
|
-
self.alcoholPercentage = nil
|
66
|
-
self.lifetime = nil
|
67
|
-
self.claims = []
|
68
|
-
self.usageOrStorageConditions = nil
|
69
|
-
self.allergenCharacteristics = []
|
70
|
-
self.nutrientCharacteristics = []
|
71
|
-
self.physicalCharacteristics = []
|
72
|
-
self.geographicalOrigin = nil
|
73
|
-
self.catalogItems = []
|
74
|
-
self.certifications = []
|
75
|
-
self.natureOrigin = []
|
76
|
-
self.partOrigin = []
|
77
125
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#name") { self.name }
|
78
126
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#description") { self.description }
|
79
127
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasType") { self.productType }
|
@@ -93,64 +141,79 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
93
141
|
end
|
94
142
|
|
95
143
|
|
144
|
+
|
96
145
|
def addClaim(claim)
|
97
146
|
self.claims.push(claim)
|
98
147
|
end
|
99
148
|
|
149
|
+
|
100
150
|
def removeClaim(claim)
|
101
|
-
raise "Not implemented"
|
151
|
+
raise "Not yet implemented."
|
102
152
|
end
|
103
153
|
|
154
|
+
|
104
155
|
def addAllergenCharacteristic(allergenCharacteristic)
|
105
156
|
self.allergenCharacteristics.push(allergenCharacteristic)
|
106
157
|
end
|
107
158
|
|
159
|
+
|
108
160
|
def addNutrientCharacteristic(nutrientCharacteristic)
|
109
161
|
self.nutrientCharacteristics.push(nutrientCharacteristic)
|
110
162
|
end
|
111
163
|
|
164
|
+
|
112
165
|
def addPhysicalCharacteristic(physicalCharacteristic)
|
113
166
|
self.physicalCharacteristics.push(physicalCharacteristic)
|
114
167
|
end
|
115
168
|
|
169
|
+
|
116
170
|
def addNatureOrigin(natureOrigin)
|
117
171
|
self.natureOrigin.push(natureOrigin)
|
118
172
|
end
|
119
173
|
|
174
|
+
|
120
175
|
def addPartOrigin(partOrigin)
|
121
176
|
self.partOrigin.push(partOrigin)
|
122
177
|
end
|
123
178
|
|
179
|
+
|
124
180
|
def removeAllergenCharacteristic(allergenCharacteristic)
|
125
|
-
raise "Not implemented"
|
181
|
+
raise "Not yet implemented."
|
126
182
|
end
|
127
183
|
|
184
|
+
|
128
185
|
def removeNutrientCharacteristic(nutrientCharacteristic)
|
129
|
-
raise "Not implemented"
|
186
|
+
raise "Not yet implemented."
|
130
187
|
end
|
131
188
|
|
189
|
+
|
132
190
|
def removePhysicalCharacteristic(physicalCharacteristic)
|
133
|
-
raise "Not implemented"
|
191
|
+
raise "Not yet implemented."
|
134
192
|
end
|
135
193
|
|
194
|
+
|
136
195
|
def removeNatureOrigin(natureOrigin)
|
137
|
-
raise "Not implemented"
|
196
|
+
raise "Not yet implemented."
|
138
197
|
end
|
139
198
|
|
199
|
+
|
140
200
|
def removePartOrigin(partOrigin)
|
141
|
-
raise "Not implemented"
|
201
|
+
raise "Not yet implemented."
|
142
202
|
end
|
143
203
|
|
204
|
+
|
144
205
|
def addCatalogItem(catalogItem)
|
145
206
|
self.catalogItems.push(catalogItem)
|
146
207
|
end
|
147
208
|
|
209
|
+
|
148
210
|
def addCertification(certification)
|
149
211
|
self.certifications.push(certification)
|
150
212
|
end
|
151
213
|
|
214
|
+
|
152
215
|
def removeCertification(certification)
|
153
|
-
raise "Not implemented"
|
216
|
+
raise "Not yet implemented."
|
154
217
|
end
|
155
218
|
|
156
219
|
|
@@ -20,35 +20,55 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "datafoodconsortium/connector/supplied_product"
|
23
24
|
|
24
25
|
|
25
26
|
|
26
|
-
require "datafoodconsortium/connector/supplied_product"
|
27
|
-
|
28
27
|
require "datafoodconsortium/connector/agent"
|
29
28
|
|
29
|
+
|
30
30
|
require "virtual_assembly/semantizer"
|
31
31
|
|
32
32
|
class DataFoodConsortium::Connector::Enterprise < DataFoodConsortium::Connector::Agent
|
33
33
|
|
34
34
|
|
35
35
|
|
36
|
+
# @return [String]
|
36
37
|
attr_accessor :name
|
38
|
+
|
39
|
+
# @return [String]
|
37
40
|
attr_accessor :description
|
41
|
+
|
42
|
+
# @return [String]
|
38
43
|
attr_accessor :vatNumber
|
44
|
+
|
45
|
+
# @return [ICustomerCategory]
|
39
46
|
attr_accessor :customerCategories
|
47
|
+
|
48
|
+
# @return [SuppliedProduct]
|
40
49
|
attr_accessor :suppliedProducts
|
50
|
+
|
51
|
+
# @return [ICatalogItem]
|
41
52
|
attr_accessor :catalogItems
|
42
53
|
|
43
|
-
|
44
|
-
|
54
|
+
# @param semanticId [String]
|
55
|
+
# @param name [String]
|
56
|
+
# @param description [String]
|
57
|
+
# @param vatNumber [String]
|
58
|
+
# @param customerCategories [ICustomerCategory]
|
59
|
+
# @param suppliedProducts [SuppliedProduct]
|
60
|
+
# @param catalogItems [ICatalogItem]
|
61
|
+
# @param contacts [Contactable]
|
62
|
+
# @param localizations [Localizable]
|
63
|
+
def initialize(semanticId, name: "", description: "", vatNumber: "", customerCategories: [], suppliedProducts: [], catalogItems: [], contacts: [], localizations: [])
|
64
|
+
super(semanticId, contacts: contacts, localizations: localizations)
|
65
|
+
@name = name
|
66
|
+
@description = description
|
67
|
+
@vatNumber = vatNumber
|
68
|
+
@customerCategories = customerCategories
|
69
|
+
@suppliedProducts = suppliedProducts
|
70
|
+
@catalogItems = catalogItems
|
45
71
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Enterprise"
|
46
|
-
self.name = name
|
47
|
-
self.description = nil
|
48
|
-
self.vatNumber = nil
|
49
|
-
self.customerCategories = []
|
50
|
-
self.suppliedProducts = []
|
51
|
-
self.catalogItems = []
|
52
72
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasName") { self.name }
|
53
73
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasDescription") { self.description }
|
54
74
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#VATnumber") { self.vatNumber }
|
@@ -58,25 +78,6 @@ class DataFoodConsortium::Connector::Enterprise < DataFoodConsortium::Connector:
|
|
58
78
|
end
|
59
79
|
|
60
80
|
|
61
|
-
def addCustomerCategory(customerCategory)
|
62
|
-
self.customerCategories.push(customerCategory)
|
63
|
-
end
|
64
|
-
|
65
|
-
def addSupplyProduct(suppliedProduct)
|
66
|
-
self.suppliedProducts.push(suppliedProduct)
|
67
|
-
end
|
68
|
-
|
69
|
-
def addCatalogItem(catalogItem)
|
70
|
-
self.catalogItems.push(catalogItem)
|
71
|
-
end
|
72
|
-
|
73
|
-
def addSupplyProduct(suppliedProduct)
|
74
|
-
self.suppliedProducts.push(suppliedProduct)
|
75
|
-
end
|
76
|
-
|
77
|
-
def addCatalogItem(catalogItem)
|
78
|
-
self.catalogItems.push(catalogItem)
|
79
|
-
end
|
80
81
|
|
81
82
|
def addCustomerCategory(customerCategory)
|
82
83
|
self.customerCategories.push(customerCategory)
|
@@ -20,8 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
|
24
23
|
require "datafoodconsortium/connector/skos_concept"
|
24
|
+
|
25
25
|
require "virtual_assembly/semantizer"
|
26
26
|
|
27
27
|
class DataFoodConsortium::Connector::GeographicalOrigin < DataFoodConsortium::Connector::SKOSConcept
|
@@ -25,14 +25,26 @@ require 'json/ld'
|
|
25
25
|
|
26
26
|
class DataFoodConsortium::Connector::JsonLdSerializer
|
27
27
|
|
28
|
-
def initialize(context)
|
28
|
+
def initialize(context = nil)
|
29
29
|
@context = context
|
30
30
|
@hashSerializer = VirtualAssembly::Semantizer::HashSerializer.new
|
31
31
|
end
|
32
32
|
|
33
|
-
def process(subject)
|
34
|
-
|
35
|
-
|
33
|
+
def process(subject, *subjects)
|
34
|
+
subjects.insert(0, subject)
|
35
|
+
|
36
|
+
if (subjects.empty?)
|
37
|
+
return ""
|
38
|
+
end
|
39
|
+
|
40
|
+
inputs = []
|
41
|
+
|
42
|
+
subjects.each do |subject|
|
43
|
+
inputs.push(subject.serialize(@hashSerializer))
|
44
|
+
end
|
45
|
+
|
46
|
+
jsonLd = JSON::LD::API.compact(inputs, @context)
|
47
|
+
|
36
48
|
return JSON.generate(jsonLd)
|
37
49
|
end
|
38
50
|
|
@@ -22,21 +22,24 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
|
26
25
|
require "datafoodconsortium/connector/characteristic"
|
26
|
+
|
27
27
|
require "virtual_assembly/semantizer"
|
28
28
|
|
29
29
|
class DataFoodConsortium::Connector::NutrientCharacteristic < DataFoodConsortium::Connector::Characteristic
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
# @return [INutrientDimension]
|
33
34
|
attr_accessor :nutrientDimension
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
# @param nutrientDimension [INutrientDimension]
|
37
|
+
# @param unit [IUnit]
|
38
|
+
# @param value [Real]
|
39
|
+
def initialize(nutrientDimension: nil, unit: nil, value: 0.0)
|
40
|
+
super(unit: unit, value: value)
|
41
|
+
@nutrientDimension = nutrientDimension
|
37
42
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#NutrientCharacteristic"
|
38
|
-
self.nutrientDimension = nutrientDimension
|
39
|
-
|
40
43
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasNutrientDimension") { self.nutrientDimension }
|
41
44
|
end
|
42
45
|
|
@@ -29,18 +29,30 @@ class DataFoodConsortium::Connector::Offer
|
|
29
29
|
|
30
30
|
include VirtualAssembly::Semantizer::SemanticObject
|
31
31
|
|
32
|
+
# @return [IPrice]
|
32
33
|
attr_accessor :price
|
34
|
+
|
35
|
+
# @return [Real]
|
33
36
|
attr_accessor :stockLimitation
|
37
|
+
|
38
|
+
# @return [ICatalogItem]
|
34
39
|
attr_accessor :offeredItem
|
40
|
+
|
41
|
+
# @return [ICustomerCategory]
|
35
42
|
attr_accessor :offeredTo
|
36
43
|
|
37
|
-
|
38
|
-
|
44
|
+
# @param semanticId [String]
|
45
|
+
# @param price [IPrice]
|
46
|
+
# @param stockLimitation [Real]
|
47
|
+
# @param offeredItem [ICatalogItem]
|
48
|
+
# @param offeredTo [ICustomerCategory]
|
49
|
+
def initialize(semanticId, price: nil, stockLimitation: 0.0, offeredItem: nil, offeredTo: nil)
|
50
|
+
super(semanticId)
|
51
|
+
@price = price
|
52
|
+
@stockLimitation = stockLimitation
|
53
|
+
@offeredItem = offeredItem
|
54
|
+
@offeredTo = offeredTo
|
39
55
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Offer"
|
40
|
-
self.offeredItem = offeredItem
|
41
|
-
self.offeredTo = offeredTo
|
42
|
-
self.price = nil
|
43
|
-
self.stockLimitation = nil
|
44
56
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#price") { self.price }
|
45
57
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation }
|
46
58
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#offeredItem") { self.offeredItem }
|
@@ -48,9 +60,6 @@ class DataFoodConsortium::Connector::Offer
|
|
48
60
|
end
|
49
61
|
|
50
62
|
|
51
|
-
def addOffer(offer)
|
52
|
-
self..push(offer)
|
53
|
-
end
|
54
63
|
|
55
64
|
|
56
65
|
end
|
@@ -20,8 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
|
24
23
|
require "datafoodconsortium/connector/skos_concept"
|
24
|
+
|
25
25
|
require "virtual_assembly/semantizer"
|
26
26
|
|
27
27
|
class DataFoodConsortium::Connector::PartOrigin < DataFoodConsortium::Connector::SKOSConcept
|
@@ -29,28 +29,41 @@ class DataFoodConsortium::Connector::Person < DataFoodConsortium::Connector::Age
|
|
29
29
|
|
30
30
|
|
31
31
|
|
32
|
+
# @return [String]
|
32
33
|
attr_accessor :firstName
|
34
|
+
|
35
|
+
# @return [String]
|
33
36
|
attr_accessor :lastName
|
37
|
+
|
38
|
+
# @return [Onboardable]
|
34
39
|
attr_accessor :affiliatedOrganizations
|
35
40
|
|
36
|
-
|
37
|
-
|
41
|
+
# @param semanticId [String]
|
42
|
+
# @param firstName [String]
|
43
|
+
# @param lastName [String]
|
44
|
+
# @param affiliatedOrganizations [Onboardable]
|
45
|
+
# @param contacts [Contactable]
|
46
|
+
# @param localizations [Localizable]
|
47
|
+
def initialize(semanticId, firstName: "", lastName: "", affiliatedOrganizations: [], contacts: [], localizations: [])
|
48
|
+
super(semanticId, contacts: contacts, localizations: localizations)
|
49
|
+
@firstName = firstName
|
50
|
+
@lastName = lastName
|
51
|
+
@affiliatedOrganizations = affiliatedOrganizations
|
38
52
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Person"
|
39
|
-
self.firstName = firstName
|
40
|
-
self.lastName = lastName
|
41
|
-
self.affiliatedOrganizations = []
|
42
53
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#firstName") { self.firstName }
|
43
54
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#familyName") { self.lastName }
|
44
55
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#affiliates") { self.affiliatedOrganizations }
|
45
56
|
end
|
46
57
|
|
47
58
|
|
59
|
+
|
48
60
|
def affiliateTo(organization)
|
49
61
|
self.affiliatedOrganizations.push(organization)
|
50
62
|
end
|
51
63
|
|
64
|
+
|
52
65
|
def leaveAffiliatedOrganization(organization)
|
53
|
-
raise "Not implemented"
|
66
|
+
raise "Not yet implemented."
|
54
67
|
end
|
55
68
|
|
56
69
|
|
@@ -20,9 +20,9 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "datafoodconsortium/connector/characteristic"
|
23
24
|
|
24
25
|
|
25
|
-
require "datafoodconsortium/connector/characteristic"
|
26
26
|
|
27
27
|
require "virtual_assembly/semantizer"
|
28
28
|
|
@@ -30,13 +30,16 @@ class DataFoodConsortium::Connector::PhysicalCharacteristic < DataFoodConsortium
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
# @return [IPhysicalDimension]
|
33
34
|
attr_accessor :physicalDimension
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
# @param physicalDimension [IPhysicalDimension]
|
37
|
+
# @param unit [IUnit]
|
38
|
+
# @param value [Real]
|
39
|
+
def initialize(physicalDimension: nil, unit: nil, value: 0.0)
|
40
|
+
super(unit: unit, value: value)
|
41
|
+
@physicalDimension = physicalDimension
|
37
42
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#PhysicalCharacteristic"
|
38
|
-
self.physicalDimension = physicalDimension
|
39
|
-
|
40
43
|
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasPhysicalDimension") { self.physicalDimension }
|
41
44
|
end
|
42
45
|
|
@@ -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
|
+
require "virtual_assembly/semantizer"
|
25
|
+
|
26
|
+
class DataFoodConsortium::Connector::Price
|
27
|
+
|
28
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
29
|
+
|
30
|
+
# @return [Real]
|
31
|
+
attr_accessor :value
|
32
|
+
|
33
|
+
# @return [Real]
|
34
|
+
attr_accessor :vatRate
|
35
|
+
|
36
|
+
# @return [IUnit]
|
37
|
+
attr_accessor :unit
|
38
|
+
|
39
|
+
# @param value [Real]
|
40
|
+
# @param vatRate [Real]
|
41
|
+
# @param unit [IUnit]
|
42
|
+
def initialize(value: 0.0, vatRate: 0.0, unit: nil)
|
43
|
+
super()
|
44
|
+
@value = value
|
45
|
+
@vatRate = vatRate
|
46
|
+
@unit = unit
|
47
|
+
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#Price"
|
48
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#value") { self.value }
|
49
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#VATrate") { self.vatRate }
|
50
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasUnit") { self.unit }
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
end
|
@@ -21,23 +21,28 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
|
24
|
+
|
24
25
|
require "virtual_assembly/semantizer"
|
25
26
|
|
26
27
|
class DataFoodConsortium::Connector::QuantitativeValue
|
27
28
|
|
28
29
|
include VirtualAssembly::Semantizer::SemanticObject
|
29
30
|
|
30
|
-
|
31
|
-
attr_accessor :
|
31
|
+
# @return [IUnit]
|
32
|
+
attr_accessor :unit
|
33
|
+
|
34
|
+
# @return [Real]
|
35
|
+
attr_accessor :value
|
32
36
|
|
33
|
-
|
37
|
+
# @param unit [IUnit]
|
38
|
+
# @param value [Real]
|
39
|
+
def initialize(unit: nil, value: 0.0)
|
34
40
|
super()
|
41
|
+
@unit = unit
|
42
|
+
@value = value
|
35
43
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#QuantitativeValue"
|
36
|
-
self.
|
37
|
-
self.
|
38
|
-
|
39
|
-
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasUnit") { self.quantityUnit }
|
40
|
-
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#value") { self.quantityValue }
|
44
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasUnit") { self.unit }
|
45
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#value") { self.value }
|
41
46
|
end
|
42
47
|
|
43
48
|
|
@@ -29,19 +29,29 @@ class DataFoodConsortium::Connector::SKOSConcept
|
|
29
29
|
|
30
30
|
include VirtualAssembly::Semantizer::SemanticObject
|
31
31
|
|
32
|
+
# @return [ISKOSConcept]
|
32
33
|
attr_accessor :broaders
|
34
|
+
|
35
|
+
# @return [ISKOSConceptScheme]
|
33
36
|
attr_accessor :schemes
|
37
|
+
|
38
|
+
# @return [ISKOSConcept]
|
34
39
|
attr_accessor :narrowers
|
40
|
+
|
41
|
+
# @return [ISKOSLabel]
|
35
42
|
attr_accessor :prefLabels
|
36
43
|
|
37
|
-
|
44
|
+
# @param broaders [ISKOSConcept]
|
45
|
+
# @param schemes [ISKOSConceptScheme]
|
46
|
+
# @param narrowers [ISKOSConcept]
|
47
|
+
# @param prefLabels [ISKOSLabel]
|
48
|
+
def initialize(broaders: [], schemes: [], narrowers: [], prefLabels: [])
|
38
49
|
super()
|
50
|
+
@broaders = broaders
|
51
|
+
@schemes = schemes
|
52
|
+
@narrowers = narrowers
|
53
|
+
@prefLabels = prefLabels
|
39
54
|
self.semanticType = "http://www.w3.org/2004/02/skos/core#Concept"
|
40
|
-
|
41
|
-
self.broaders = []
|
42
|
-
self.schemes = []
|
43
|
-
self.narrowers = []
|
44
|
-
self.prefLabels = []
|
45
55
|
registerSemanticProperty("http://www.w3.org/2004/02/skos/core#broader") { self.broaders }
|
46
56
|
registerSemanticProperty("http://www.w3.org/2004/02/skos/core#inScheme") { self.schemes }
|
47
57
|
registerSemanticProperty("http://www.w3.org/2004/02/skos/core#narrower") { self.narrowers }
|
@@ -49,36 +59,28 @@ class DataFoodConsortium::Connector::SKOSConcept
|
|
49
59
|
end
|
50
60
|
|
51
61
|
|
52
|
-
def addBroader(broader)
|
53
|
-
self.broaders.push(broader)
|
54
|
-
end
|
55
62
|
|
56
|
-
def addScheme(scheme)
|
57
|
-
self.schemes.push(scheme)
|
58
|
-
end
|
59
63
|
|
60
|
-
def addNarrower(narrower)
|
61
|
-
self.narrowers.push(narrower)
|
62
|
-
end
|
63
64
|
|
64
|
-
|
65
|
-
self.prefLabels.push(prefLabel)
|
66
|
-
end
|
65
|
+
|
67
66
|
|
68
67
|
def removeBroader(broader)
|
69
|
-
raise "Not implemented"
|
68
|
+
raise "Not yet implemented."
|
70
69
|
end
|
71
70
|
|
71
|
+
|
72
72
|
def removeScheme(scheme)
|
73
|
-
raise "Not implemented"
|
73
|
+
raise "Not yet implemented."
|
74
74
|
end
|
75
75
|
|
76
|
+
|
76
77
|
def removeNarrower(narrower)
|
77
|
-
raise "Not implemented"
|
78
|
+
raise "Not yet implemented."
|
78
79
|
end
|
79
80
|
|
81
|
+
|
80
82
|
def removePrefLabel(prefLabel)
|
81
|
-
raise "Not implemented"
|
83
|
+
raise "Not yet implemented."
|
82
84
|
end
|
83
85
|
|
84
86
|
|
@@ -27,15 +27,38 @@ class DataFoodConsortium::Connector::SuppliedProduct < DataFoodConsortium::Conne
|
|
27
27
|
|
28
28
|
|
29
29
|
|
30
|
+
# @return [Real]
|
31
|
+
attr_accessor :totalTheoreticalStock
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
# @param semanticId [String]
|
34
|
+
# @param totalTheoreticalStock [Real]
|
35
|
+
# @param name [String]
|
36
|
+
# @param description [String]
|
37
|
+
# @param productType [IProductType]
|
38
|
+
# @param quantity [Quantifiable]
|
39
|
+
# @param alcoholPercentage [Real]
|
40
|
+
# @param lifetime [String]
|
41
|
+
# @param claims [Claimable]
|
42
|
+
# @param usageOrStorageConditions [String]
|
43
|
+
# @param allergenCharacteristics [IAllergenCharacteristic]
|
44
|
+
# @param nutrientCharacteristics [INutrientCharacteristic]
|
45
|
+
# @param physicalCharacteristics [IPhysicalCharacteristic]
|
46
|
+
# @param geographicalOrigin [IGeographicalOrigin]
|
47
|
+
# @param catalogItems [ICatalogItem]
|
48
|
+
# @param certifications [ICertification]
|
49
|
+
# @param natureOrigin [INatureOrigin]
|
50
|
+
# @param partOrigin [IPartOrigin]
|
51
|
+
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: [])
|
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)
|
53
|
+
@totalTheoreticalStock = totalTheoreticalStock
|
33
54
|
self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#SuppliedProduct"
|
34
|
-
|
35
|
-
|
36
|
-
|
55
|
+
registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#totalTheoreticalStock") { self.totalTheoreticalStock }
|
37
56
|
end
|
38
57
|
|
39
58
|
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
40
63
|
|
41
64
|
end
|
@@ -6,26 +6,27 @@ module DataFoodConsortium
|
|
6
6
|
require 'datafoodconsortium/connector/skos_parser'
|
7
7
|
require 'datafoodconsortium/connector/agent.rb'
|
8
8
|
require 'datafoodconsortium/connector/enterprise.rb'
|
9
|
-
require 'datafoodconsortium/connector/customer_category.rb'
|
10
9
|
require 'datafoodconsortium/connector/person.rb'
|
10
|
+
require 'datafoodconsortium/connector/customer_category.rb'
|
11
|
+
require 'datafoodconsortium/connector/offer.rb'
|
11
12
|
require 'datafoodconsortium/connector/repository.rb'
|
12
|
-
require 'datafoodconsortium/connector/
|
13
|
+
require 'datafoodconsortium/connector/price.rb'
|
13
14
|
require 'datafoodconsortium/connector/order.rb'
|
14
|
-
require 'datafoodconsortium/connector/
|
15
|
+
require 'datafoodconsortium/connector/catalog_item.rb'
|
15
16
|
require 'datafoodconsortium/connector/order_line.rb'
|
16
|
-
require 'datafoodconsortium/connector/address.rb'
|
17
|
-
require 'datafoodconsortium/connector/geographical_origin.rb'
|
18
|
-
require 'datafoodconsortium/connector/physical_characteristic.rb'
|
19
17
|
require 'datafoodconsortium/connector/allergen_dimension.rb'
|
20
|
-
require 'datafoodconsortium/connector/allergen_characteristic.rb'
|
21
|
-
require 'datafoodconsortium/connector/nutrient_characteristic.rb'
|
22
18
|
require 'datafoodconsortium/connector/characteristic.rb'
|
23
|
-
require 'datafoodconsortium/connector/
|
19
|
+
require 'datafoodconsortium/connector/address.rb'
|
20
|
+
require 'datafoodconsortium/connector/characteristic_dimension.rb'
|
21
|
+
require 'datafoodconsortium/connector/nutrient_characteristic.rb'
|
24
22
|
require 'datafoodconsortium/connector/part_origin.rb'
|
25
|
-
require 'datafoodconsortium/connector/quantitative_value.rb'
|
26
23
|
require 'datafoodconsortium/connector/unit.rb'
|
24
|
+
require 'datafoodconsortium/connector/quantitative_value.rb'
|
27
25
|
require 'datafoodconsortium/connector/certification.rb'
|
28
|
-
require 'datafoodconsortium/connector/
|
26
|
+
require 'datafoodconsortium/connector/product_type.rb'
|
27
|
+
require 'datafoodconsortium/connector/physical_characteristic.rb'
|
28
|
+
require 'datafoodconsortium/connector/allergen_characteristic.rb'
|
29
|
+
require 'datafoodconsortium/connector/geographical_origin.rb'
|
29
30
|
require 'datafoodconsortium/connector/nature_origin.rb'
|
30
31
|
require 'datafoodconsortium/connector/defined_product.rb'
|
31
32
|
require 'datafoodconsortium/connector/supplied_product.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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Lecoq
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtual_assembly-semantizer
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.
|
22
|
+
version: 1.0.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,35 @@ dependencies:
|
|
29
29
|
version: '1.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.
|
32
|
+
version: 1.0.3
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: minitest
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
33
61
|
description: A library to easily integrate the DFC standard within your application.
|
34
62
|
email: maxime@lecoqlibre.fr
|
35
63
|
executables: []
|
@@ -59,6 +87,7 @@ files:
|
|
59
87
|
- lib/datafoodconsortium/connector/part_origin.rb
|
60
88
|
- lib/datafoodconsortium/connector/person.rb
|
61
89
|
- lib/datafoodconsortium/connector/physical_characteristic.rb
|
90
|
+
- lib/datafoodconsortium/connector/price.rb
|
62
91
|
- lib/datafoodconsortium/connector/product_type.rb
|
63
92
|
- lib/datafoodconsortium/connector/quantitative_value.rb
|
64
93
|
- lib/datafoodconsortium/connector/repository.rb
|