datafoodconsortium-connector 1.0.0.pre.alpha.8 → 1.0.0.pre.alpha.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datafoodconsortium/connector/address.rb +5 -5
  3. data/lib/datafoodconsortium/connector/agent.rb +29 -31
  4. data/lib/datafoodconsortium/connector/allergen_characteristic.rb +5 -6
  5. data/lib/datafoodconsortium/connector/catalog.rb +53 -0
  6. data/lib/datafoodconsortium/connector/catalog_item.rb +13 -10
  7. data/lib/datafoodconsortium/connector/characteristic.rb +1 -2
  8. data/lib/datafoodconsortium/connector/connector.rb +2 -2
  9. data/lib/datafoodconsortium/connector/customer_category.rb +2 -2
  10. data/lib/datafoodconsortium/connector/defined_product.rb +31 -111
  11. data/lib/datafoodconsortium/connector/enterprise.rb +42 -22
  12. data/lib/datafoodconsortium/connector/nutrient_characteristic.rb +6 -7
  13. data/lib/datafoodconsortium/connector/offer.rb +6 -6
  14. data/lib/datafoodconsortium/connector/order.rb +39 -1
  15. data/lib/datafoodconsortium/connector/order_line.rb +39 -1
  16. data/lib/datafoodconsortium/connector/person.rb +14 -20
  17. data/lib/datafoodconsortium/connector/phone_number.rb +50 -0
  18. data/lib/datafoodconsortium/connector/physical_characteristic.rb +6 -7
  19. data/lib/datafoodconsortium/connector/price.rb +7 -6
  20. data/lib/datafoodconsortium/connector/quantitative_value.rb +5 -5
  21. data/lib/datafoodconsortium/connector/quantity.rb +50 -0
  22. data/lib/datafoodconsortium/connector/sale_session.rb +63 -0
  23. data/lib/datafoodconsortium/connector/skos_concept.rb +8 -31
  24. data/lib/datafoodconsortium/connector/skos_parser.rb +1 -2
  25. data/lib/datafoodconsortium/connector/social_media.rb +54 -0
  26. data/lib/datafoodconsortium/connector/supplied_product.rb +20 -13
  27. data/lib/datafoodconsortium/connector/technical_product.rb +59 -0
  28. data/lib/datafoodconsortium/connector.rb +17 -20
  29. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10cef79dc3231070626e77a12f301c6c1d931b3e9aa00455355001622f163d79
4
- data.tar.gz: d3ace7b1a70fa76a2770758dd70604a2581b90db81599927adddb783f8b3cec8
3
+ metadata.gz: d5225fd19ef0b6bf69a76d49a056356e3b597fc0a1218f49987cb7d067fa1ffc
4
+ data.tar.gz: 399517064eca65753f2d915f7807c105f87e08eb68bf00b1d5b4c18bc4fc16d4
5
5
  SHA512:
6
- metadata.gz: 1a43218d24441bd3f9983b2998ae7ebd5e9745723df8e991ee6d087b0ef0d2c8213e99e3ef5c054e34acb761f8e7e2c429a4f9943ccfef3f74e1be5082881577
7
- data.tar.gz: 1920c7915626aea13bcd63119ad35476b5d83c1afccebe9c05b31e0475598fe846efacfddb38632d7467e52833083c11baca289377f235a67e3b0bf3356d12d0
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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#Address"
54
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasStreet") { self.street }
55
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasPostalCode") { self.postalCode }
56
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasCity") { self.city }
57
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasCountry") { self.country }
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 [Contactable]
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 contacts [Contactable]
40
- # @param localizations [Localizable]
41
- def initialize(semanticId, contacts: [], localizations: [])
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
- self.semanticType = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#Agent"
46
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasAddress") { self.localizations }
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 [IAllergenDimension]
32
+ # @return [ISKOSConcept]
34
33
  attr_accessor :allergenDimension
35
34
 
36
- # @param allergenDimension [IAllergenDimension]
37
- # @param unit [IUnit]
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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#AllergenCharacteristic"
43
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasAllergenDimension") { self.allergenDimension }
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
- def initialize(semanticId, product: nil, sku: "", stockLimitation: 0.0, offers: [])
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
- self.semanticType = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#CatalogItem"
56
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#references") { self.product }
57
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#sku") { self.sku }
58
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation }
59
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#offeredThrough") { self.offers }
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 [IUnit]
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)
@@ -59,8 +59,8 @@ class DataFoodConsortium::Connector::Connector
59
59
  # See https://github.com/datafoodconsortium/connector-ruby/issues/11.
60
60
  inputContext = {
61
61
  "dfc-b" => "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#",
62
- #"dfc-p" => "http://static.datafoodconsortium.org/ontologies/DFC_ProductOntology.owl#",
63
- #"dfc-t" => "http://static.datafoodconsortium.org/ontologies/DFC_TechnicalOntology.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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#CustomerCategory"
39
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#description") { self.description }
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 [IProductType]
42
+ # @return [ISKOSConcept]
48
43
  attr_accessor :productType
49
44
 
50
- # @return [Quantifiable]
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 [Claimable]
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 [IGeographicalOrigin]
69
+ # @return [ISKOSConcept]
75
70
  attr_accessor :geographicalOrigin
76
71
 
77
72
  # @return [ICatalogItem]
78
73
  attr_accessor :catalogItems
79
74
 
80
- # @return [ICertification]
75
+ # @return [ISKOSConcept]
81
76
  attr_accessor :certifications
82
77
 
83
- # @return [INatureOrigin]
78
+ # @return [ISKOSConcept]
84
79
  attr_accessor :natureOrigin
85
80
 
86
- # @return [IPartOrigin]
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 [IProductType]
93
- # @param quantity [Quantifiable]
87
+ # @param productType [ISKOSConcept]
88
+ # @param quantity [IQuantity]
94
89
  # @param alcoholPercentage [Real]
95
90
  # @param lifetime [String]
96
- # @param claims [Claimable]
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 [IGeographicalOrigin]
96
+ # @param geographicalOrigin [ISKOSConcept]
102
97
  # @param catalogItems [ICatalogItem]
103
- # @param certifications [ICertification]
104
- # @param natureOrigin [INatureOrigin]
105
- # @param partOrigin [IPartOrigin]
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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#DefinedProduct"
125
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#name") { self.name }
126
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#description") { self.description }
127
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasType") { self.productType }
128
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasQuantity") { self.quantity }
129
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#alcoholPercentage") { self.alcoholPercentage }
130
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#lifetime") { self.lifetime }
131
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasClaim") { self.claims }
132
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#usageOrStorageCondition") { self.usageOrStorageConditions }
133
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasAllergenCharacteristic") { self.allergenCharacteristics }
134
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasNutrientCharacteristic") { self.nutrientCharacteristics }
135
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasPhysicalCharacteristic") { self.physicalCharacteristics }
136
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasGeographicalOrigin") { self.geographicalOrigin }
137
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#referencedBy") { self.catalogItems }
138
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasCertification") { self.certifications }
139
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasNatureOrigin") { self.natureOrigin }
140
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasPartOrigin") { self.partOrigin }
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
- require "datafoodconsortium/connector/supplied_product"
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 [SuppliedProduct]
49
- attr_accessor :suppliedProducts
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 suppliedProducts [SuppliedProduct]
72
+ # @param catalogs [ICatalog]
60
73
  # @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)
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
- @suppliedProducts = suppliedProducts
88
+ @catalogs = catalogs
70
89
  @catalogItems = catalogItems
71
- self.semanticType = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#Enterprise"
72
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasName") { self.name }
73
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasDescription") { self.description }
74
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#VATnumber") { self.vatNumber }
75
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#defines") { self.customerCategories }
76
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#supplies") { self.suppliedProducts }
77
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#manages") { self.catalogItems }
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 [INutrientDimension]
32
+ # @return [ISKOSConcept]
34
33
  attr_accessor :nutrientDimension
35
34
 
36
- # @param nutrientDimension [INutrientDimension]
37
- # @param unit [IUnit]
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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#NutrientCharacteristic"
43
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#hasNutrientDimension") { self.nutrientDimension }
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 = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#Offer"
56
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#price") { self.price }
57
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation }
58
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#offeredItem") { self.offeredItem }
59
- registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#offeredTo") { self.offeredTo }
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