datafoodconsortium-connector 1.0.0.pre.alpha.7 → 1.0.0.pre.alpha.9
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 +5 -5
- data/lib/datafoodconsortium/connector/agent.rb +29 -31
- data/lib/datafoodconsortium/connector/allergen_characteristic.rb +5 -6
- data/lib/datafoodconsortium/connector/catalog.rb +53 -0
- data/lib/datafoodconsortium/connector/catalog_item.rb +13 -10
- data/lib/datafoodconsortium/connector/characteristic.rb +1 -2
- data/lib/datafoodconsortium/connector/connector.rb +3 -3
- data/lib/datafoodconsortium/connector/customer_category.rb +2 -2
- data/lib/datafoodconsortium/connector/defined_product.rb +31 -111
- data/lib/datafoodconsortium/connector/enterprise.rb +42 -22
- data/lib/datafoodconsortium/connector/nutrient_characteristic.rb +6 -7
- data/lib/datafoodconsortium/connector/offer.rb +6 -6
- data/lib/datafoodconsortium/connector/order.rb +39 -1
- data/lib/datafoodconsortium/connector/order_line.rb +39 -1
- data/lib/datafoodconsortium/connector/person.rb +14 -20
- data/lib/datafoodconsortium/connector/phone_number.rb +50 -0
- data/lib/datafoodconsortium/connector/physical_characteristic.rb +6 -7
- data/lib/datafoodconsortium/connector/price.rb +7 -6
- data/lib/datafoodconsortium/connector/quantitative_value.rb +5 -5
- data/lib/datafoodconsortium/connector/quantity.rb +50 -0
- data/lib/datafoodconsortium/connector/sale_session.rb +63 -0
- data/lib/datafoodconsortium/connector/skos_concept.rb +8 -31
- data/lib/datafoodconsortium/connector/skos_parser.rb +1 -2
- data/lib/datafoodconsortium/connector/social_media.rb +54 -0
- data/lib/datafoodconsortium/connector/supplied_product.rb +20 -13
- data/lib/datafoodconsortium/connector/technical_product.rb +59 -0
- data/lib/datafoodconsortium/connector.rb +17 -20
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5225fd19ef0b6bf69a76d49a056356e3b597fc0a1218f49987cb7d067fa1ffc
|
4
|
+
data.tar.gz: 399517064eca65753f2d915f7807c105f87e08eb68bf00b1d5b4c18bc4fc16d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6164d4c281396c07d80f69011fbf391ff92a5eac637d8028f95bee0efba3f41856bc8bd2a174775cacd3f9630e58ff4d9bbb8f98d932a3ff6cb62b26b4331b9
|
7
|
+
data.tar.gz: d94f2752a2c5eac1d675c1bce1248dea25f2491f96ce17a2535592af8c725af915ac7bd2b97e7261259367cd167611737ad96bb7cb5cb99434aa65df70bae263
|
@@ -50,11 +50,11 @@ class DataFoodConsortium::Connector::Address
|
|
50
50
|
@postalCode = postalCode
|
51
51
|
@city = city
|
52
52
|
@country = country
|
53
|
-
self.semanticType = "
|
54
|
-
registerSemanticProperty("
|
55
|
-
registerSemanticProperty("
|
56
|
-
registerSemanticProperty("
|
57
|
-
registerSemanticProperty("
|
53
|
+
self.semanticType = "dfc-b:Address"
|
54
|
+
registerSemanticProperty("dfc-b:hasStreet") { self.street }
|
55
|
+
registerSemanticProperty("dfc-b:hasPostalCode") { self.postalCode }
|
56
|
+
registerSemanticProperty("dfc-b:hasCity") { self.city }
|
57
|
+
registerSemanticProperty("dfc-b:hasCountry") { self.country }
|
58
58
|
end
|
59
59
|
|
60
60
|
|
@@ -22,50 +22,48 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
|
26
25
|
require "virtual_assembly/semantizer"
|
27
26
|
|
28
27
|
class DataFoodConsortium::Connector::Agent
|
29
28
|
|
30
29
|
include VirtualAssembly::Semantizer::SemanticObject
|
31
30
|
|
32
|
-
# @return [
|
33
|
-
attr_accessor :contacts
|
34
|
-
|
35
|
-
# @return [Localizable]
|
31
|
+
# @return [IAddress]
|
36
32
|
attr_accessor :localizations
|
37
33
|
|
34
|
+
# @return [IPhoneNumber]
|
35
|
+
attr_accessor :phoneNumbers
|
36
|
+
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :emails
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
attr_accessor :websites
|
42
|
+
|
43
|
+
# @return [ISocialMedia]
|
44
|
+
attr_accessor :socialMedias
|
45
|
+
|
38
46
|
# @param semanticId [String]
|
39
|
-
# @param
|
40
|
-
# @param
|
41
|
-
|
47
|
+
# @param localizations [IAddress]
|
48
|
+
# @param phoneNumbers [IPhoneNumber]
|
49
|
+
# @param emails [String]
|
50
|
+
# @param websites [String]
|
51
|
+
# @param socialMedias [ISocialMedia]
|
52
|
+
def initialize(semanticId, localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [])
|
42
53
|
super(semanticId)
|
43
|
-
@contacts = contacts
|
44
54
|
@localizations = localizations
|
45
|
-
|
46
|
-
|
55
|
+
@phoneNumbers = phoneNumbers
|
56
|
+
@emails = emails
|
57
|
+
@websites = websites
|
58
|
+
@socialMedias = socialMedias
|
59
|
+
self.semanticType = "dfc-b:Agent"
|
60
|
+
registerSemanticProperty("dfc-b:hasAddress") { self.localizations }
|
61
|
+
registerSemanticProperty("dfc-b:hasPhoneNumber") { self.phoneNumbers }
|
62
|
+
registerSemanticProperty("dfc-b:email") { self.emails }
|
63
|
+
registerSemanticProperty("dfc-b:websitePage") { self.websites }
|
64
|
+
registerSemanticProperty("dfc-b:hasSocialMedia") { self.socialMedias }
|
47
65
|
end
|
48
66
|
|
49
67
|
|
50
|
-
|
51
|
-
def addContact(contact)
|
52
|
-
self.contacts.push(contact)
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
def addLocalization(localization)
|
57
|
-
self.localizations.push(localization)
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
def removeContact(contact)
|
62
|
-
raise "Not yet implemented."
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
def removeLocalization(localization)
|
67
|
-
raise "Not yet implemented."
|
68
|
-
end
|
69
|
-
|
70
68
|
|
71
69
|
end
|
@@ -23,24 +23,23 @@
|
|
23
23
|
|
24
24
|
require "datafoodconsortium/connector/characteristic"
|
25
25
|
|
26
|
-
|
27
26
|
require "virtual_assembly/semantizer"
|
28
27
|
|
29
28
|
class DataFoodConsortium::Connector::AllergenCharacteristic < DataFoodConsortium::Connector::Characteristic
|
30
29
|
|
31
30
|
|
32
31
|
|
33
|
-
# @return [
|
32
|
+
# @return [ISKOSConcept]
|
34
33
|
attr_accessor :allergenDimension
|
35
34
|
|
36
|
-
# @param allergenDimension [
|
37
|
-
# @param unit [
|
35
|
+
# @param allergenDimension [ISKOSConcept]
|
36
|
+
# @param unit [ISKOSConcept]
|
38
37
|
# @param value [Real]
|
39
38
|
def initialize(allergenDimension: nil, unit: nil, value: 0.0)
|
40
39
|
super(unit: unit, value: value)
|
41
40
|
@allergenDimension = allergenDimension
|
42
|
-
self.semanticType = "
|
43
|
-
registerSemanticProperty("
|
41
|
+
self.semanticType = "dfc-b:AllergenCharacteristic"
|
42
|
+
registerSemanticProperty("dfc-b:hasAllergenDimension") { self.allergenDimension }
|
44
43
|
end
|
45
44
|
|
46
45
|
|
@@ -0,0 +1,53 @@
|
|
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::Catalog
|
30
|
+
|
31
|
+
include VirtualAssembly::Semantizer::SemanticObject
|
32
|
+
|
33
|
+
# @return [ICatalogItem]
|
34
|
+
attr_accessor :items
|
35
|
+
|
36
|
+
# @return [IEnterprise]
|
37
|
+
attr_accessor :maintainers
|
38
|
+
|
39
|
+
# @param semanticId [String]
|
40
|
+
# @param items [ICatalogItem]
|
41
|
+
# @param maintainers [IEnterprise]
|
42
|
+
def initialize(semanticId, items: [], maintainers: [])
|
43
|
+
super(semanticId)
|
44
|
+
@items = items
|
45
|
+
@maintainers = maintainers
|
46
|
+
self.semanticType = "dfc-b:Catalog"
|
47
|
+
registerSemanticProperty("dfc-b:lists") { self.items }
|
48
|
+
registerSemanticProperty("dfc-b:maintainedBy") { self.maintainers }
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
end
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
+
|
26
27
|
require "virtual_assembly/semantizer"
|
27
28
|
|
28
29
|
class DataFoodConsortium::Connector::CatalogItem
|
@@ -41,28 +42,30 @@ class DataFoodConsortium::Connector::CatalogItem
|
|
41
42
|
# @return [IOffer]
|
42
43
|
attr_accessor :offers
|
43
44
|
|
45
|
+
# @return [ICatalog]
|
46
|
+
attr_accessor :catalogs
|
47
|
+
|
44
48
|
# @param semanticId [String]
|
45
49
|
# @param product [IDefinedProduct]
|
46
50
|
# @param sku [String]
|
47
51
|
# @param stockLimitation [Real]
|
48
52
|
# @param offers [IOffer]
|
49
|
-
|
53
|
+
# @param catalogs [ICatalog]
|
54
|
+
def initialize(semanticId, product: nil, sku: "", stockLimitation: 0.0, offers: [], catalogs: [])
|
50
55
|
super(semanticId)
|
51
56
|
@product = product
|
52
57
|
@sku = sku
|
53
58
|
@stockLimitation = stockLimitation
|
54
59
|
@offers = offers
|
55
|
-
|
56
|
-
|
57
|
-
registerSemanticProperty("
|
58
|
-
registerSemanticProperty("
|
59
|
-
registerSemanticProperty("
|
60
|
+
@catalogs = catalogs
|
61
|
+
self.semanticType = "dfc-b:CatalogItem"
|
62
|
+
registerSemanticProperty("dfc-b:references") { self.product }
|
63
|
+
registerSemanticProperty("dfc-b:sku") { self.sku }
|
64
|
+
registerSemanticProperty("dfc-b:stockLimitation") { self.stockLimitation }
|
65
|
+
registerSemanticProperty("dfc-b:offeredThrough") { self.offers }
|
66
|
+
registerSemanticProperty("dfc-b:listedIn") { self.catalogs }
|
60
67
|
end
|
61
68
|
|
62
69
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
70
|
|
68
71
|
end
|
@@ -21,7 +21,6 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
|
24
|
-
|
25
24
|
require "datafoodconsortium/connector/quantitative_value"
|
26
25
|
|
27
26
|
require "virtual_assembly/semantizer"
|
@@ -31,7 +30,7 @@ class DataFoodConsortium::Connector::Characteristic < DataFoodConsortium::Connec
|
|
31
30
|
|
32
31
|
|
33
32
|
|
34
|
-
# @param unit [
|
33
|
+
# @param unit [ISKOSConcept]
|
35
34
|
# @param value [Real]
|
36
35
|
def initialize(unit: nil, value: 0.0)
|
37
36
|
super(unit: unit, value: value)
|
@@ -58,9 +58,9 @@ class DataFoodConsortium::Connector::Connector
|
|
58
58
|
# so the DFC's context can be used.
|
59
59
|
# See https://github.com/datafoodconsortium/connector-ruby/issues/11.
|
60
60
|
inputContext = {
|
61
|
-
"dfc-b" => "https://github.com/datafoodconsortium/ontology/releases/latest/download/
|
62
|
-
|
63
|
-
|
61
|
+
"dfc-b" => "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#",
|
62
|
+
"dfc-p" => "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_ProductGlossary.owl#",
|
63
|
+
"dfc-t" => "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_TechnicalOntology.owl#",
|
64
64
|
"dfc-m" => "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/measures.rdf#",
|
65
65
|
"dfc-pt" => "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
|
66
66
|
"dfc-f" => "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/facets.rdf#"
|
@@ -35,8 +35,8 @@ class DataFoodConsortium::Connector::CustomerCategory
|
|
35
35
|
def initialize(semanticId, description: "")
|
36
36
|
super(semanticId)
|
37
37
|
@description = description
|
38
|
-
self.semanticType = "
|
39
|
-
registerSemanticProperty("
|
38
|
+
self.semanticType = "dfc-b:CustomerCategory"
|
39
|
+
registerSemanticProperty("dfc-b:description") { self.description }
|
40
40
|
end
|
41
41
|
|
42
42
|
|
@@ -27,11 +27,6 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
30
|
require "virtual_assembly/semantizer"
|
36
31
|
|
37
32
|
class DataFoodConsortium::Connector::DefinedProduct
|
@@ -44,10 +39,10 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
44
39
|
# @return [String]
|
45
40
|
attr_accessor :description
|
46
41
|
|
47
|
-
# @return [
|
42
|
+
# @return [ISKOSConcept]
|
48
43
|
attr_accessor :productType
|
49
44
|
|
50
|
-
# @return [
|
45
|
+
# @return [IQuantity]
|
51
46
|
attr_accessor :quantity
|
52
47
|
|
53
48
|
# @return [Real]
|
@@ -56,7 +51,7 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
56
51
|
# @return [String]
|
57
52
|
attr_accessor :lifetime
|
58
53
|
|
59
|
-
# @return [
|
54
|
+
# @return [ISKOSConcept]
|
60
55
|
attr_accessor :claims
|
61
56
|
|
62
57
|
# @return [String]
|
@@ -71,38 +66,38 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
71
66
|
# @return [IPhysicalCharacteristic]
|
72
67
|
attr_accessor :physicalCharacteristics
|
73
68
|
|
74
|
-
# @return [
|
69
|
+
# @return [ISKOSConcept]
|
75
70
|
attr_accessor :geographicalOrigin
|
76
71
|
|
77
72
|
# @return [ICatalogItem]
|
78
73
|
attr_accessor :catalogItems
|
79
74
|
|
80
|
-
# @return [
|
75
|
+
# @return [ISKOSConcept]
|
81
76
|
attr_accessor :certifications
|
82
77
|
|
83
|
-
# @return [
|
78
|
+
# @return [ISKOSConcept]
|
84
79
|
attr_accessor :natureOrigin
|
85
80
|
|
86
|
-
# @return [
|
81
|
+
# @return [ISKOSConcept]
|
87
82
|
attr_accessor :partOrigin
|
88
83
|
|
89
84
|
# @param semanticId [String]
|
90
85
|
# @param name [String]
|
91
86
|
# @param description [String]
|
92
|
-
# @param productType [
|
93
|
-
# @param quantity [
|
87
|
+
# @param productType [ISKOSConcept]
|
88
|
+
# @param quantity [IQuantity]
|
94
89
|
# @param alcoholPercentage [Real]
|
95
90
|
# @param lifetime [String]
|
96
|
-
# @param claims [
|
91
|
+
# @param claims [ISKOSConcept]
|
97
92
|
# @param usageOrStorageConditions [String]
|
98
93
|
# @param allergenCharacteristics [IAllergenCharacteristic]
|
99
94
|
# @param nutrientCharacteristics [INutrientCharacteristic]
|
100
95
|
# @param physicalCharacteristics [IPhysicalCharacteristic]
|
101
|
-
# @param geographicalOrigin [
|
96
|
+
# @param geographicalOrigin [ISKOSConcept]
|
102
97
|
# @param catalogItems [ICatalogItem]
|
103
|
-
# @param certifications [
|
104
|
-
# @param natureOrigin [
|
105
|
-
# @param partOrigin [
|
98
|
+
# @param certifications [ISKOSConcept]
|
99
|
+
# @param natureOrigin [ISKOSConcept]
|
100
|
+
# @param partOrigin [ISKOSConcept]
|
106
101
|
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
102
|
super(semanticId)
|
108
103
|
@name = name
|
@@ -121,100 +116,25 @@ class DataFoodConsortium::Connector::DefinedProduct
|
|
121
116
|
@certifications = certifications
|
122
117
|
@natureOrigin = natureOrigin
|
123
118
|
@partOrigin = partOrigin
|
124
|
-
self.semanticType = "
|
125
|
-
registerSemanticProperty("
|
126
|
-
registerSemanticProperty("
|
127
|
-
registerSemanticProperty("
|
128
|
-
registerSemanticProperty("
|
129
|
-
registerSemanticProperty("
|
130
|
-
registerSemanticProperty("
|
131
|
-
registerSemanticProperty("
|
132
|
-
registerSemanticProperty("
|
133
|
-
registerSemanticProperty("
|
134
|
-
registerSemanticProperty("
|
135
|
-
registerSemanticProperty("
|
136
|
-
registerSemanticProperty("
|
137
|
-
registerSemanticProperty("
|
138
|
-
registerSemanticProperty("
|
139
|
-
registerSemanticProperty("
|
140
|
-
registerSemanticProperty("
|
119
|
+
self.semanticType = "dfc-b:DefinedProduct"
|
120
|
+
registerSemanticProperty("dfc-b:name") { self.name }
|
121
|
+
registerSemanticProperty("dfc-b:description") { self.description }
|
122
|
+
registerSemanticProperty("dfc-b:hasType") { self.productType }
|
123
|
+
registerSemanticProperty("dfc-b:hasQuantity") { self.quantity }
|
124
|
+
registerSemanticProperty("dfc-b:alcoholPercentage") { self.alcoholPercentage }
|
125
|
+
registerSemanticProperty("dfc-b:lifetime") { self.lifetime }
|
126
|
+
registerSemanticProperty("dfc-b:hasClaim") { self.claims }
|
127
|
+
registerSemanticProperty("dfc-b:usageOrStorageCondition") { self.usageOrStorageConditions }
|
128
|
+
registerSemanticProperty("dfc-b:hasAllergenCharacteristic") { self.allergenCharacteristics }
|
129
|
+
registerSemanticProperty("dfc-b:hasNutrientCharacteristic") { self.nutrientCharacteristics }
|
130
|
+
registerSemanticProperty("dfc-b:hasPhysicalCharacteristic") { self.physicalCharacteristics }
|
131
|
+
registerSemanticProperty("dfc-b:hasGeographicalOrigin") { self.geographicalOrigin }
|
132
|
+
registerSemanticProperty("dfc-b:referencedBy") { self.catalogItems }
|
133
|
+
registerSemanticProperty("dfc-b:hasCertification") { self.certifications }
|
134
|
+
registerSemanticProperty("dfc-b:hasNatureOrigin") { self.natureOrigin }
|
135
|
+
registerSemanticProperty("dfc-b:hasPartOrigin") { self.partOrigin }
|
141
136
|
end
|
142
137
|
|
143
138
|
|
144
|
-
|
145
|
-
def addClaim(claim)
|
146
|
-
self.claims.push(claim)
|
147
|
-
end
|
148
|
-
|
149
|
-
|
150
|
-
def removeClaim(claim)
|
151
|
-
raise "Not yet implemented."
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
def addAllergenCharacteristic(allergenCharacteristic)
|
156
|
-
self.allergenCharacteristics.push(allergenCharacteristic)
|
157
|
-
end
|
158
|
-
|
159
|
-
|
160
|
-
def addNutrientCharacteristic(nutrientCharacteristic)
|
161
|
-
self.nutrientCharacteristics.push(nutrientCharacteristic)
|
162
|
-
end
|
163
|
-
|
164
|
-
|
165
|
-
def addPhysicalCharacteristic(physicalCharacteristic)
|
166
|
-
self.physicalCharacteristics.push(physicalCharacteristic)
|
167
|
-
end
|
168
|
-
|
169
|
-
|
170
|
-
def addNatureOrigin(natureOrigin)
|
171
|
-
self.natureOrigin.push(natureOrigin)
|
172
|
-
end
|
173
|
-
|
174
|
-
|
175
|
-
def addPartOrigin(partOrigin)
|
176
|
-
self.partOrigin.push(partOrigin)
|
177
|
-
end
|
178
|
-
|
179
|
-
|
180
|
-
def removeAllergenCharacteristic(allergenCharacteristic)
|
181
|
-
raise "Not yet implemented."
|
182
|
-
end
|
183
|
-
|
184
|
-
|
185
|
-
def removeNutrientCharacteristic(nutrientCharacteristic)
|
186
|
-
raise "Not yet implemented."
|
187
|
-
end
|
188
|
-
|
189
|
-
|
190
|
-
def removePhysicalCharacteristic(physicalCharacteristic)
|
191
|
-
raise "Not yet implemented."
|
192
|
-
end
|
193
|
-
|
194
|
-
|
195
|
-
def removeNatureOrigin(natureOrigin)
|
196
|
-
raise "Not yet implemented."
|
197
|
-
end
|
198
|
-
|
199
|
-
|
200
|
-
def removePartOrigin(partOrigin)
|
201
|
-
raise "Not yet implemented."
|
202
|
-
end
|
203
|
-
|
204
|
-
|
205
|
-
def addCatalogItem(catalogItem)
|
206
|
-
self.catalogItems.push(catalogItem)
|
207
|
-
end
|
208
|
-
|
209
|
-
|
210
|
-
def addCertification(certification)
|
211
|
-
self.certifications.push(certification)
|
212
|
-
end
|
213
|
-
|
214
|
-
|
215
|
-
def removeCertification(certification)
|
216
|
-
raise "Not yet implemented."
|
217
|
-
end
|
218
|
-
|
219
139
|
|
220
140
|
end
|
@@ -20,11 +20,15 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
-
|
23
|
+
|
24
|
+
require "datafoodconsortium/connector/agent"
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
24
29
|
|
25
30
|
|
26
31
|
|
27
|
-
require "datafoodconsortium/connector/agent"
|
28
32
|
|
29
33
|
|
30
34
|
require "virtual_assembly/semantizer"
|
@@ -45,43 +49,59 @@ class DataFoodConsortium::Connector::Enterprise < DataFoodConsortium::Connector:
|
|
45
49
|
# @return [ICustomerCategory]
|
46
50
|
attr_accessor :customerCategories
|
47
51
|
|
48
|
-
# @return [
|
49
|
-
attr_accessor :
|
52
|
+
# @return [ICatalog]
|
53
|
+
attr_accessor :catalogs
|
50
54
|
|
51
55
|
# @return [ICatalogItem]
|
52
56
|
attr_accessor :catalogItems
|
53
57
|
|
58
|
+
# @return [ISuppliedProduct]
|
59
|
+
attr_accessor :suppliedProducts
|
60
|
+
|
61
|
+
# @return [ITechnicalProduct]
|
62
|
+
attr_accessor :technicalProducts
|
63
|
+
|
64
|
+
# @return [IPerson]
|
65
|
+
attr_accessor :mainContact
|
66
|
+
|
54
67
|
# @param semanticId [String]
|
55
68
|
# @param name [String]
|
56
69
|
# @param description [String]
|
57
70
|
# @param vatNumber [String]
|
58
71
|
# @param customerCategories [ICustomerCategory]
|
59
|
-
# @param
|
72
|
+
# @param catalogs [ICatalog]
|
60
73
|
# @param catalogItems [ICatalogItem]
|
61
|
-
# @param
|
62
|
-
# @param
|
63
|
-
|
64
|
-
|
74
|
+
# @param suppliedProducts [ISuppliedProduct]
|
75
|
+
# @param technicalProducts [ITechnicalProduct]
|
76
|
+
# @param mainContact [IPerson]
|
77
|
+
# @param localizations [IAddress]
|
78
|
+
# @param phoneNumbers [IPhoneNumber]
|
79
|
+
# @param emails [String]
|
80
|
+
# @param websites [String]
|
81
|
+
# @param socialMedias [ISocialMedia]
|
82
|
+
def initialize(semanticId, name: "", description: "", vatNumber: "", customerCategories: [], catalogs: [], catalogItems: [], suppliedProducts: [], technicalProducts: [], mainContact: nil, localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [])
|
83
|
+
super(semanticId, localizations: localizations, phoneNumbers: phoneNumbers, emails: emails, websites: websites, socialMedias: socialMedias)
|
65
84
|
@name = name
|
66
85
|
@description = description
|
67
86
|
@vatNumber = vatNumber
|
68
87
|
@customerCategories = customerCategories
|
69
|
-
@
|
88
|
+
@catalogs = catalogs
|
70
89
|
@catalogItems = catalogItems
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
registerSemanticProperty("
|
76
|
-
registerSemanticProperty("
|
77
|
-
registerSemanticProperty("
|
90
|
+
@suppliedProducts = suppliedProducts
|
91
|
+
@technicalProducts = technicalProducts
|
92
|
+
@mainContact = mainContact
|
93
|
+
self.semanticType = "dfc-b:Enterprise"
|
94
|
+
registerSemanticProperty("dfc-b:name") { self.name }
|
95
|
+
registerSemanticProperty("dfc-b:hasDescription") { self.description }
|
96
|
+
registerSemanticProperty("dfc-b:VATnumber") { self.vatNumber }
|
97
|
+
registerSemanticProperty("dfc-b:defines") { self.customerCategories }
|
98
|
+
registerSemanticProperty("dfc-b:maintains") { self.catalogs }
|
99
|
+
registerSemanticProperty("dfc-b:manages") { self.catalogItems }
|
100
|
+
registerSemanticProperty("dfc-b:supplies") { self.suppliedProducts }
|
101
|
+
registerSemanticProperty("dfc-b:proposes") { self.technicalProducts }
|
102
|
+
registerSemanticProperty("dfc-b:hasMainContact") { self.mainContact }
|
78
103
|
end
|
79
104
|
|
80
105
|
|
81
|
-
|
82
|
-
def addCustomerCategory(customerCategory)
|
83
|
-
self.customerCategories.push(customerCategory)
|
84
|
-
end
|
85
|
-
|
86
106
|
|
87
107
|
end
|
@@ -20,27 +20,26 @@
|
|
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
|
-
|
25
23
|
require "datafoodconsortium/connector/characteristic"
|
26
24
|
|
25
|
+
|
27
26
|
require "virtual_assembly/semantizer"
|
28
27
|
|
29
28
|
class DataFoodConsortium::Connector::NutrientCharacteristic < DataFoodConsortium::Connector::Characteristic
|
30
29
|
|
31
30
|
|
32
31
|
|
33
|
-
# @return [
|
32
|
+
# @return [ISKOSConcept]
|
34
33
|
attr_accessor :nutrientDimension
|
35
34
|
|
36
|
-
# @param nutrientDimension [
|
37
|
-
# @param unit [
|
35
|
+
# @param nutrientDimension [ISKOSConcept]
|
36
|
+
# @param unit [ISKOSConcept]
|
38
37
|
# @param value [Real]
|
39
38
|
def initialize(nutrientDimension: nil, unit: nil, value: 0.0)
|
40
39
|
super(unit: unit, value: value)
|
41
40
|
@nutrientDimension = nutrientDimension
|
42
|
-
self.semanticType = "
|
43
|
-
registerSemanticProperty("
|
41
|
+
self.semanticType = "dfc-b:NutrientCharacteristic"
|
42
|
+
registerSemanticProperty("dfc-b:hasNutrientDimension") { self.nutrientDimension }
|
44
43
|
end
|
45
44
|
|
46
45
|
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
+
|
26
27
|
require "virtual_assembly/semantizer"
|
27
28
|
|
28
29
|
class DataFoodConsortium::Connector::Offer
|
@@ -52,14 +53,13 @@ class DataFoodConsortium::Connector::Offer
|
|
52
53
|
@stockLimitation = stockLimitation
|
53
54
|
@offeredItem = offeredItem
|
54
55
|
@offeredTo = offeredTo
|
55
|
-
self.semanticType = "
|
56
|
-
registerSemanticProperty("
|
57
|
-
registerSemanticProperty("
|
58
|
-
registerSemanticProperty("
|
59
|
-
registerSemanticProperty("
|
56
|
+
self.semanticType = "dfc-b:Offer"
|
57
|
+
registerSemanticProperty("dfc-b:hasPrice") { self.price }
|
58
|
+
registerSemanticProperty("dfc-b:stockLimitation") { self.stockLimitation }
|
59
|
+
registerSemanticProperty("dfc-b:offeredItem") { self.offeredItem }
|
60
|
+
registerSemanticProperty("dfc-b:offeredTo") { self.offeredTo }
|
60
61
|
end
|
61
62
|
|
62
63
|
|
63
|
-
|
64
64
|
|
65
65
|
end
|