datafoodconsortium-connector 2.0.0.pre.beta1 → 2.0.0.pre.beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0e356ba982a9fff2482bb21802f6d899d851224c451212a8d95db595139f7be
4
- data.tar.gz: 33e1c188c09cd6b7c859d04ca72f35163020d7ea63768a06acc4a067d06dbe70
3
+ metadata.gz: 581bae0586ebf6cf9dcb504c10bfaa0fbd1155fa8bb1d1330aba42f8f91337b2
4
+ data.tar.gz: 223421816663630ea42b0a65f6ea57497fd610f1fafea13a851fb619238d35e3
5
5
  SHA512:
6
- metadata.gz: b1556596e524f6f8dd613142c91f5ec9416de7465f331be9588ee15b9aebb181fd9540d4fd78344133968b72bdc9307664a5759a65b0184949a098ee8a9795d5
7
- data.tar.gz: 164ee84cd9f475081b94768da6321cb563b5e1ddf596ab84885dfa48adffa405caa1e45020b063fc290084acb3dff79e70b9612a8caf36c336ff34371a64bf46
6
+ metadata.gz: d5398d680c53a8ad2c62bd660e62c9f546fa7b0687db45da10d560cece279bfb02d15d518ef3c26c500c1bd3f2161aead2d715086a362616d62606a1d6ed6353
7
+ data.tar.gz: e638609b3097af42efc693f241712b91619152fa67ef59ce8863ec1085b54e847c97f4e3518a051d91be044b614584e64b2013080f0bfa0cf9730f227588e856
@@ -22,6 +22,7 @@
22
22
 
23
23
 
24
24
 
25
+
25
26
  require "virtual_assembly/semantizer"
26
27
 
27
28
  class DataFoodConsortium::Connector::Agent
@@ -35,7 +35,7 @@ class DataFoodConsortium::Connector::Catalog
35
35
  # @return [ICatalogItem]
36
36
  attr_accessor :items
37
37
 
38
- # @return [IEnterprise]
38
+ # @return [IOrganization]
39
39
  attr_accessor :maintainers
40
40
 
41
41
  # @return [DateTime]
@@ -46,7 +46,7 @@ class DataFoodConsortium::Connector::Catalog
46
46
 
47
47
  # @param semanticId [String]
48
48
  # @param items [ICatalogItem]
49
- # @param maintainers [IEnterprise]
49
+ # @param maintainers [IOrganization]
50
50
  # @param beginDate [DateTime]
51
51
  # @param endDate [DateTime]
52
52
  def initialize(semanticId, items: [], maintainers: [], beginDate: nil, endDate: nil)
@@ -18,16 +18,13 @@ module DataFoodConsortium
18
18
  "http://www.datafoodconsortium.org/"
19
19
  )
20
20
 
21
- # This was the file the DFC website refers to in a link header.
22
21
  alias_preloaded(
23
- "https://www.datafoodconsortium.org/wp-content/plugins/wordpress-context-jsonld/context.jsonld",
22
+ "https://w3id.org/dfc/ontology/context/context_2.0.0.json",
24
23
  "http://www.datafoodconsortium.org/"
25
24
  )
26
25
 
27
- # This is the old URL that's not online anymore.
28
- # Keep it for compatiblity with all versions before 1.8.
29
26
  alias_preloaded(
30
- "http://static.datafoodconsortium.org/ontologies/context.json",
27
+ "https://cdn.jsdelivr.net/gh/datafoodconsortium/ontology/context/context_2.0.0.json",
31
28
  "http://www.datafoodconsortium.org/"
32
29
  )
33
30
 
@@ -24,6 +24,7 @@
24
24
 
25
25
 
26
26
 
27
+
27
28
  require "virtual_assembly/semantizer"
28
29
 
29
30
  class DataFoodConsortium::Connector::Order
@@ -58,6 +59,9 @@ class DataFoodConsortium::Connector::Order
58
59
  # @return [ISKOSConcept]
59
60
  attr_accessor :paymentStatus
60
61
 
62
+ # @return [IPaymentMethod]
63
+ attr_accessor :paymentMethod
64
+
61
65
  # @param semanticId [String]
62
66
  # @param number [String]
63
67
  # @param date [String]
@@ -68,7 +72,8 @@ class DataFoodConsortium::Connector::Order
68
72
  # @param fulfilmentStatus [ISKOSConcept]
69
73
  # @param orderStatus [ISKOSConcept]
70
74
  # @param paymentStatus [ISKOSConcept]
71
- def initialize(semanticId, number: nil, date: nil, saleSession: nil, lines: [], client: nil, soldBy: nil, fulfilmentStatus: nil, orderStatus: nil, paymentStatus: nil)
75
+ # @param paymentMethod [IPaymentMethod]
76
+ def initialize(semanticId, number: nil, date: nil, saleSession: nil, lines: [], client: nil, soldBy: nil, fulfilmentStatus: nil, orderStatus: nil, paymentStatus: nil, paymentMethod: nil)
72
77
  super(semanticId)
73
78
  @number = number
74
79
  @date = date
@@ -79,6 +84,7 @@ class DataFoodConsortium::Connector::Order
79
84
  @fulfilmentStatus = fulfilmentStatus
80
85
  @orderStatus = orderStatus
81
86
  @paymentStatus = paymentStatus
87
+ @paymentMethod = paymentMethod
82
88
  self.semanticType = "dfc-b:Order"
83
89
  registerSemanticProperty("dfc-b:orderNumber", &method("number")).valueSetter = method("number=")
84
90
  registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
@@ -89,6 +95,7 @@ class DataFoodConsortium::Connector::Order
89
95
  registerSemanticProperty("dfc-b:hasFulfilmentStatus", &method("fulfilmentStatus")).valueSetter = method("fulfilmentStatus=")
90
96
  registerSemanticProperty("dfc-b:hasOrderStatus", &method("orderStatus")).valueSetter = method("orderStatus=")
91
97
  registerSemanticProperty("dfc-b:hasPaymentStatus", &method("paymentStatus")).valueSetter = method("paymentStatus=")
98
+ registerSemanticProperty("dfc-b:hasPaymentMethod", &method("paymentMethod")).valueSetter = method("paymentMethod=")
92
99
  end
93
100
 
94
101
 
@@ -37,13 +37,13 @@ class DataFoodConsortium::Connector::Person < DataFoodConsortium::Connector::Age
37
37
  # @return [String]
38
38
  attr_accessor :lastName
39
39
 
40
- # @return [IEnterprise]
40
+ # @return [IOrganization]
41
41
  attr_accessor :affiliatedOrganizations
42
42
 
43
43
  # @param semanticId [String]
44
44
  # @param firstName [String]
45
45
  # @param lastName [String]
46
- # @param affiliatedOrganizations [IEnterprise]
46
+ # @param affiliatedOrganizations [IOrganization]
47
47
  # @param localizations [IAddress]
48
48
  # @param phoneNumbers [IPhoneNumber]
49
49
  # @param emails [String]
@@ -46,10 +46,10 @@ class DataFoodConsortium::Connector::PhysicalPlace
46
46
  attr_accessor :openingHours
47
47
 
48
48
  # @return [IAddress]
49
- attr_accessor :addresses
49
+ attr_accessor :address
50
50
 
51
51
  # @return [IPerson]
52
- attr_accessor :mainContact
52
+ attr_accessor :mainContacts
53
53
 
54
54
  # @return [ITheoreticalStock]
55
55
  attr_accessor :theoreticalStocks
@@ -66,20 +66,20 @@ class DataFoodConsortium::Connector::PhysicalPlace
66
66
  # @param hostedSaleSessions [ISaleSession]
67
67
  # @param phoneNumbers [IPhoneNumber]
68
68
  # @param openingHours [IOpeningHoursSpecification]
69
- # @param addresses [IAddress]
70
- # @param mainContact [IPerson]
69
+ # @param address [IAddress]
70
+ # @param mainContacts [IPerson]
71
71
  # @param theoreticalStocks [ITheoreticalStock]
72
72
  # @param realStocks [IRealStock]
73
73
  # @param features [IGeoJsonFeature]
74
- def initialize(semanticId, name: nil, description: nil, hostedSaleSessions: [], phoneNumbers: [], openingHours: [], addresses: [], mainContact: nil, theoreticalStocks: [], realStocks: [], features: [])
74
+ def initialize(semanticId, name: nil, description: nil, hostedSaleSessions: [], phoneNumbers: [], openingHours: [], address: nil, mainContacts: [], theoreticalStocks: [], realStocks: [], features: [])
75
75
  super(semanticId)
76
76
  @name = name
77
77
  @description = description
78
78
  @hostedSaleSessions = hostedSaleSessions
79
79
  @phoneNumbers = phoneNumbers
80
80
  @openingHours = openingHours
81
- @addresses = addresses
82
- @mainContact = mainContact
81
+ @address = address
82
+ @mainContacts = mainContacts
83
83
  @theoreticalStocks = theoreticalStocks
84
84
  @realStocks = realStocks
85
85
  @features = features
@@ -89,8 +89,8 @@ class DataFoodConsortium::Connector::PhysicalPlace
89
89
  registerSemanticProperty("dfc-b:hosts", &method("hostedSaleSessions")).valueSetter = method("hostedSaleSessions=")
90
90
  registerSemanticProperty("dfc-b:hasPhoneNumber", &method("phoneNumbers")).valueSetter = method("phoneNumbers=")
91
91
  registerSemanticProperty("dfc-b:hasOpeningHours", &method("openingHours")).valueSetter = method("openingHours=")
92
- registerSemanticProperty("dfc-b:hasAddress", &method("addresses")).valueSetter = method("addresses=")
93
- registerSemanticProperty("dfc-b:hasMainContact", &method("mainContact")).valueSetter = method("mainContact=")
92
+ registerSemanticProperty("dfc-b:hasAddress", &method("address")).valueSetter = method("address=")
93
+ registerSemanticProperty("dfc-b:hasMainContact", &method("mainContacts")).valueSetter = method("mainContacts=")
94
94
  registerSemanticProperty("dfc-b:localizes", &method("theoreticalStocks")).valueSetter = method("theoreticalStocks=")
95
95
  registerSemanticProperty("dfc-b:stores", &method("realStocks")).valueSetter = method("realStocks=")
96
96
  registerSemanticProperty("dfc-b:hasGeoJsonFeature", &method("features")).valueSetter = method("features=")
@@ -30,6 +30,7 @@ require "datafoodconsortium/connector/defined_product"
30
30
 
31
31
 
32
32
 
33
+
33
34
  require "virtual_assembly/semantizer"
34
35
 
35
36
  class DataFoodConsortium::Connector::SuppliedProduct < DataFoodConsortium::Connector::DefinedProduct
@@ -39,12 +40,16 @@ class DataFoodConsortium::Connector::SuppliedProduct < DataFoodConsortium::Conne
39
40
  # @return [Real]
40
41
  attr_accessor :totalTheoreticalStock
41
42
 
43
+ # @return [ILocalizedProduct]
44
+ attr_accessor :localizedProducts
45
+
42
46
 
43
47
 
44
48
 
45
49
 
46
50
  # @param semanticId [String]
47
51
  # @param totalTheoreticalStock [Real]
52
+ # @param localizedProducts [ILocalizedProduct]
48
53
  # @param name [String]
49
54
  # @param description [String]
50
55
  # @param productType [ISKOSConcept]
@@ -64,11 +69,13 @@ class DataFoodConsortium::Connector::SuppliedProduct < DataFoodConsortium::Conne
64
69
  # @param images [String]
65
70
  # @param variants [IDefinedProduct]
66
71
  # @param referenceProductOptions [IProductOption]
67
- def initialize(semanticId, totalTheoreticalStock: nil, name: nil, description: nil, productType: nil, quantity: nil, alcoholPercentage: nil, lifetime: nil, claims: [], usageOrStorageConditions: nil, allergenCharacteristics: [], nutrientCharacteristics: [], physicalCharacteristics: [], geographicalOrigin: nil, catalogItems: [], certifications: [], natureOrigin: [], partOrigin: [], images: [], variants: [], referenceProductOptions: [])
72
+ def initialize(semanticId, totalTheoreticalStock: nil, localizedProducts: [], name: nil, description: nil, productType: nil, quantity: nil, alcoholPercentage: nil, lifetime: nil, claims: [], usageOrStorageConditions: nil, allergenCharacteristics: [], nutrientCharacteristics: [], physicalCharacteristics: [], geographicalOrigin: nil, catalogItems: [], certifications: [], natureOrigin: [], partOrigin: [], images: [], variants: [], referenceProductOptions: [])
68
73
  super(semanticId, name: name, description: description, productType: productType, quantity: quantity, alcoholPercentage: alcoholPercentage, lifetime: lifetime, claims: claims, usageOrStorageConditions: usageOrStorageConditions, allergenCharacteristics: allergenCharacteristics, nutrientCharacteristics: nutrientCharacteristics, physicalCharacteristics: physicalCharacteristics, geographicalOrigin: geographicalOrigin, catalogItems: catalogItems, certifications: certifications, natureOrigin: natureOrigin, partOrigin: partOrigin, images: images, variants: variants, referenceProductOptions: referenceProductOptions)
69
74
  @totalTheoreticalStock = totalTheoreticalStock
75
+ @localizedProducts = localizedProducts
70
76
  self.semanticType = "dfc-b:SuppliedProduct"
71
77
  registerSemanticProperty("dfc-b:totalTheoreticalStock", &method("totalTheoreticalStock")).valueSetter = method("totalTheoreticalStock=")
78
+ registerSemanticProperty("dfc-b:referenceOf", &method("localizedProducts")).valueSetter = method("localizedProducts=")
72
79
  end
73
80
 
74
81
 
@@ -7,7 +7,6 @@ module DataFoodConsortium
7
7
  require 'datafoodconsortium/connector/agent.rb'
8
8
  require 'datafoodconsortium/connector/certification.rb'
9
9
  require 'datafoodconsortium/connector/customer_category.rb'
10
- require 'datafoodconsortium/connector/enterprise.rb'
11
10
  require 'datafoodconsortium/connector/organization.rb'
12
11
  require 'datafoodconsortium/connector/person.rb'
13
12
  require 'datafoodconsortium/connector/phone_number.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datafoodconsortium-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.beta1
4
+ version: 2.0.0.pre.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Lecoq
@@ -51,7 +51,6 @@ files:
51
51
  - lib/datafoodconsortium/connector/defined_product.rb
52
52
  - lib/datafoodconsortium/connector/delivery_option.rb
53
53
  - lib/datafoodconsortium/connector/delivery_step.rb
54
- - lib/datafoodconsortium/connector/enterprise.rb
55
54
  - lib/datafoodconsortium/connector/flow.rb
56
55
  - lib/datafoodconsortium/connector/importer.rb
57
56
  - lib/datafoodconsortium/connector/json_ld_serializer.rb
@@ -70,7 +69,6 @@ files:
70
69
  - lib/datafoodconsortium/connector/pickup_option.rb
71
70
  - lib/datafoodconsortium/connector/pickup_step.rb
72
71
  - lib/datafoodconsortium/connector/planned_consumption_flow.rb
73
- - lib/datafoodconsortium/connector/planned_flow.rb
74
72
  - lib/datafoodconsortium/connector/planned_local_consumption_flow.rb
75
73
  - lib/datafoodconsortium/connector/planned_local_production_flow.rb
76
74
  - lib/datafoodconsortium/connector/planned_local_transformation.rb
@@ -1,109 +0,0 @@
1
- # MIT License
2
- #
3
- # Copyright (c) 2023 Maxime Lecoq <maxime@lecoqlibre.fr>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- require "datafoodconsortium/connector/agent"
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- require "virtual_assembly/semantizer"
35
-
36
- class DataFoodConsortium::Connector::Enterprise < DataFoodConsortium::Connector::Agent
37
-
38
- SEMANTIC_TYPE = "dfc-b:Enterprise".freeze
39
-
40
- # @return [String]
41
- attr_accessor :name
42
-
43
- # @return [String]
44
- attr_accessor :description
45
-
46
- # @return [String]
47
- attr_accessor :vatNumber
48
-
49
- # @return [ICustomerCategory]
50
- attr_accessor :customerCategories
51
-
52
- # @return [ICatalog]
53
- attr_accessor :catalogs
54
-
55
- # @return [ICatalogItem]
56
- attr_accessor :catalogItems
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
-
67
- # @param semanticId [String]
68
- # @param name [String]
69
- # @param description [String]
70
- # @param vatNumber [String]
71
- # @param customerCategories [ICustomerCategory]
72
- # @param catalogs [ICatalog]
73
- # @param catalogItems [ICatalogItem]
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
- # @param logo [String]
83
- # @param customerCategoriesMembership [ICustomerCategory]
84
- def initialize(semanticId, name: nil, description: nil, vatNumber: nil, customerCategories: [], catalogs: [], catalogItems: [], suppliedProducts: [], technicalProducts: [], mainContact: nil, localizations: [], phoneNumbers: [], emails: [], websites: [], socialMedias: [], logo: nil, customerCategoriesMembership: [])
85
- super(semanticId, localizations: localizations, phoneNumbers: phoneNumbers, emails: emails, websites: websites, socialMedias: socialMedias, logo: logo, customerCategoriesMembership: customerCategoriesMembership)
86
- @name = name
87
- @description = description
88
- @vatNumber = vatNumber
89
- @customerCategories = customerCategories
90
- @catalogs = catalogs
91
- @catalogItems = catalogItems
92
- @suppliedProducts = suppliedProducts
93
- @technicalProducts = technicalProducts
94
- @mainContact = mainContact
95
- self.semanticType = "dfc-b:Enterprise"
96
- registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
97
- registerSemanticProperty("dfc-b:hasDescription", &method("description")).valueSetter = method("description=")
98
- registerSemanticProperty("dfc-b:VATnumber", &method("vatNumber")).valueSetter = method("vatNumber=")
99
- registerSemanticProperty("dfc-b:defines", &method("customerCategories")).valueSetter = method("customerCategories=")
100
- registerSemanticProperty("dfc-b:maintains", &method("catalogs")).valueSetter = method("catalogs=")
101
- registerSemanticProperty("dfc-b:manages", &method("catalogItems")).valueSetter = method("catalogItems=")
102
- registerSemanticProperty("dfc-b:supplies", &method("suppliedProducts")).valueSetter = method("suppliedProducts=")
103
- registerSemanticProperty("dfc-b:proposes", &method("technicalProducts")).valueSetter = method("technicalProducts=")
104
- registerSemanticProperty("dfc-b:hasMainContact", &method("mainContact")).valueSetter = method("mainContact=")
105
- end
106
-
107
-
108
-
109
- end
@@ -1,42 +0,0 @@
1
- # MIT License
2
- #
3
- # Copyright (c) 2023 Maxime Lecoq <maxime@lecoqlibre.fr>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- require "datafoodconsortium/connector/flow"
24
- require "virtual_assembly/semantizer"
25
-
26
- class DataFoodConsortium::Connector::PlannedFlow < DataFoodConsortium::Connector::Flow
27
-
28
- # @return [IPlannedTransformation]
29
- attr_accessor :transformation
30
-
31
- # @param transformation [IPlannedTransformation]
32
- # @param quantity [IQuantity]
33
- def initialize(transformation: nil, quantity: nil)
34
- super(quantity: quantity)
35
- @transformation = transformation
36
-
37
- registerSemanticProperty("dfc-b:incomeOf", &method("transformation")).valueSetter = method("transformation=")
38
- end
39
-
40
-
41
-
42
- end