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

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: 21f3f3988c0fdd080af8e8c9a0c0343912648cc2c0f3fab972e5d6da1ee6671c
4
+ data.tar.gz: 919ae0069f01516cf456a82cf84ef9b6efe9d0dcdbca6feccaca26a249ce2c77
5
5
  SHA512:
6
- metadata.gz: b1556596e524f6f8dd613142c91f5ec9416de7465f331be9588ee15b9aebb181fd9540d4fd78344133968b72bdc9307664a5759a65b0184949a098ee8a9795d5
7
- data.tar.gz: 164ee84cd9f475081b94768da6321cb563b5e1ddf596ab84885dfa48adffa405caa1e45020b063fc290084acb3dff79e70b9612a8caf36c336ff34371a64bf46
6
+ metadata.gz: 75ff122063e028c2be3caa9512fb7da0972ac12923ee53989f26239cd3a2e43ccd9f59c6a6a9b3b1af1ac1bea2ba0072c267002130fc58045693e0c5480e2070
7
+ data.tar.gz: 709a67f6810fad8bf82e40297190ade26593bd58f1b45c57e52d9a3cb863738216acebbba192b7227b5e05f19261ff0137a8f7f4d37fdb310956b17125609dc1
@@ -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
 
@@ -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]
@@ -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.beta2
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