dfc-linkml-connector 2.0.6
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +78 -0
- data/contexts/context_2.0.0.json +544 -0
- data/lib/core/connector.rb +670 -0
- data/lib/core/json_ld_serializer.rb +92 -0
- data/lib/core/semantic_object.rb +103 -0
- data/lib/core/vocabulary_loader.rb +125 -0
- data/lib/dfc_linkml_connector.rb +102 -0
- data/lib/models/address.rb +68 -0
- data/lib/models/agent.rb +83 -0
- data/lib/models/allergen_characteristic.rb +57 -0
- data/lib/models/as_planned_consumption_flow.rb +25 -0
- data/lib/models/as_planned_local_consumption_flow.rb +25 -0
- data/lib/models/as_planned_local_production_flow.rb +25 -0
- data/lib/models/as_planned_local_transformation.rb +53 -0
- data/lib/models/as_planned_production_flow.rb +25 -0
- data/lib/models/as_planned_transformation.rb +38 -0
- data/lib/models/as_realized_consumption_flow.rb +25 -0
- data/lib/models/as_realized_production_flow.rb +25 -0
- data/lib/models/as_realized_transformation.rb +48 -0
- data/lib/models/brand.rb +33 -0
- data/lib/models/catalog.rb +43 -0
- data/lib/models/catalog_item.rb +93 -0
- data/lib/models/certfication.rb +43 -0
- data/lib/models/collection.rb +47 -0
- data/lib/models/concept.rb +82 -0
- data/lib/models/concept_scheme.rb +47 -0
- data/lib/models/consumption_flow.rb +67 -0
- data/lib/models/coordination.rb +62 -0
- data/lib/models/customer_category.rb +38 -0
- data/lib/models/defined_product.rb +178 -0
- data/lib/models/delivery_option.rb +48 -0
- data/lib/models/delivery_step.rb +25 -0
- data/lib/models/ditributed_representation.rb +47 -0
- data/lib/models/enterprise.rb +29 -0
- data/lib/models/feature.rb +57 -0
- data/lib/models/functional_product.rb +33 -0
- data/lib/models/geometry.rb +52 -0
- data/lib/models/how_subject.rb +47 -0
- data/lib/models/individual.rb +47 -0
- data/lib/models/ingredient.rb +38 -0
- data/lib/models/labelling_characteristic.rb +57 -0
- data/lib/models/length.rb +25 -0
- data/lib/models/localized_product.rb +68 -0
- data/lib/models/nutrient_characteristic.rb +57 -0
- data/lib/models/offer.rb +82 -0
- data/lib/models/opening_hours_specification.rb +62 -0
- data/lib/models/order.rb +115 -0
- data/lib/models/order_line.rb +86 -0
- data/lib/models/organization.rb +92 -0
- data/lib/models/payment_method.rb +43 -0
- data/lib/models/person.rb +38 -0
- data/lib/models/phone_number.rb +38 -0
- data/lib/models/physical_characteristic.rb +57 -0
- data/lib/models/physical_place.rb +58 -0
- data/lib/models/physical_product.rb +78 -0
- data/lib/models/pick_up_step.rb +25 -0
- data/lib/models/pickup_option.rb +33 -0
- data/lib/models/place.rb +28 -0
- data/lib/models/platform.rb +25 -0
- data/lib/models/point.rb +25 -0
- data/lib/models/polygon.rb +25 -0
- data/lib/models/price.rb +37 -0
- data/lib/models/product_batch.rb +53 -0
- data/lib/models/product_option.rb +28 -0
- data/lib/models/product_option_value.rb +25 -0
- data/lib/models/production_flow.rb +67 -0
- data/lib/models/properties.rb +47 -0
- data/lib/models/quantitative_value.rb +33 -0
- data/lib/models/real_stock.rb +38 -0
- data/lib/models/representation_pivot.rb +25 -0
- data/lib/models/represented_thing.rb +25 -0
- data/lib/models/route.rb +38 -0
- data/lib/models/sale_session.rb +92 -0
- data/lib/models/shipment.rb +77 -0
- data/lib/models/shipping_option.rb +58 -0
- data/lib/models/social_media.rb +33 -0
- data/lib/models/step.rb +48 -0
- data/lib/models/stock.rb +67 -0
- data/lib/models/supplied_product.rb +73 -0
- data/lib/models/technical_product.rb +38 -0
- data/lib/models/temperature.rb +28 -0
- data/lib/models/template_sale_session.rb +57 -0
- data/lib/models/theoritical_stock.rb +33 -0
- data/lib/models/transaction.rb +62 -0
- data/lib/models/transformation.rb +25 -0
- data/lib/models/value_r_e_c_u_r.rb +67 -0
- data/lib/models/variant.rb +33 -0
- data/lib/models/variant_caracteristic.rb +33 -0
- data/lib/models/vehicle.rb +58 -0
- data/lib/models/vevent.rb +62 -0
- data/lib/models/virtual_place.rb +33 -0
- data/lib/models/volume.rb +25 -0
- data/lib/models/weight.rb +25 -0
- data/lib/models/what_subject.rb +47 -0
- data/lib/models/where_subject.rb +47 -0
- data/lib/models/who_subject.rb +47 -0
- data/vocabularies/facet.jsonld +4130 -0
- data/vocabularies/measure.jsonld +2586 -0
- data/vocabularies/product_type.jsonld +10116 -0
- data/vocabularies/scope.jsonld +190 -0
- data/vocabularies/vocabulary_term.jsonld +502 -0
- metadata +199 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #How_Subject
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class HowSubject < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:How_Subject".freeze
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :date
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :description
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :characteristic_of
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :dimension
|
|
26
|
+
|
|
27
|
+
# @param semanticId [String]
|
|
28
|
+
# @param date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil
|
|
29
|
+
def initialize(semanticId, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil)
|
|
30
|
+
super(semanticId)
|
|
31
|
+
@date = date
|
|
32
|
+
@description = description
|
|
33
|
+
@name = name
|
|
34
|
+
@characteristic_of = characteristicOf
|
|
35
|
+
@dimension = dimension
|
|
36
|
+
self.semanticType = "dfc-b:How_Subject"
|
|
37
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
38
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
39
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
40
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
41
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #Individual
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class Individual < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:Individual".freeze
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :date
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :description
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :characteristic_of
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :dimension
|
|
26
|
+
|
|
27
|
+
# @param semanticId [String]
|
|
28
|
+
# @param date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil
|
|
29
|
+
def initialize(semanticId, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil)
|
|
30
|
+
super(semanticId)
|
|
31
|
+
@date = date
|
|
32
|
+
@description = description
|
|
33
|
+
@name = name
|
|
34
|
+
@characteristic_of = characteristicOf
|
|
35
|
+
@dimension = dimension
|
|
36
|
+
self.semanticType = "dfc-b:Individual"
|
|
37
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
38
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
39
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
40
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
41
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #Ingredient
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
require_relative 'what_subject'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module DfcLinkmlConnector
|
|
9
|
+
module Models
|
|
10
|
+
class Ingredient < WhatSubject
|
|
11
|
+
SEMANTIC_TYPE = "dfc-b:Ingredient".freeze
|
|
12
|
+
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :composed_of
|
|
15
|
+
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :is_ingredient_of
|
|
18
|
+
|
|
19
|
+
# @return [QuantitativeValue, String]
|
|
20
|
+
attr_accessor :has_quantity
|
|
21
|
+
|
|
22
|
+
# @param semanticId [String]
|
|
23
|
+
# @param date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, composedOf: nil, isIngredientOf: nil, hasQuantity: nil
|
|
24
|
+
def initialize(semanticId, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, composedOf: nil, isIngredientOf: nil, hasQuantity: nil)
|
|
25
|
+
super(semanticId, date: date, description: description, name: name, characteristicOf: characteristicOf, dimension: dimension)
|
|
26
|
+
@composed_of = composedOf
|
|
27
|
+
@is_ingredient_of = isIngredientOf
|
|
28
|
+
@has_quantity = hasQuantity
|
|
29
|
+
self.semanticType = "dfc-b:Ingredient"
|
|
30
|
+
registerSemanticProperty("dfc-b:composedOf", &method("composed_of")).valueSetter = method("composed_of=")
|
|
31
|
+
registerSemanticProperty("dfc-b:isIngredientOf", &method("is_ingredient_of")).valueSetter = method("is_ingredient_of=")
|
|
32
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("has_quantity")).valueSetter = method("has_quantity=")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #LabellingCharacteristic
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class LabellingCharacteristic < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:LabellingCharacteristic".freeze
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :labelling_characteristic_of
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :date
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :characteristic_of
|
|
26
|
+
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :dimension
|
|
29
|
+
|
|
30
|
+
# @return [Concept, String]
|
|
31
|
+
attr_accessor :labelling_dimension
|
|
32
|
+
|
|
33
|
+
# @param semanticId [String]
|
|
34
|
+
# @param labellingCharacteristicOf: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, labellingDimension: nil
|
|
35
|
+
def initialize(semanticId, labellingCharacteristicOf: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, labellingDimension: nil)
|
|
36
|
+
super(semanticId)
|
|
37
|
+
@labelling_characteristic_of = labellingCharacteristicOf
|
|
38
|
+
@date = date
|
|
39
|
+
@description = description
|
|
40
|
+
@name = name
|
|
41
|
+
@characteristic_of = characteristicOf
|
|
42
|
+
@dimension = dimension
|
|
43
|
+
@labelling_dimension = labellingDimension
|
|
44
|
+
self.semanticType = "dfc-b:LabellingCharacteristic"
|
|
45
|
+
registerSemanticProperty("dfc-b:labellingCharacteristicOf", &method("labelling_characteristic_of")).valueSetter = method("labelling_characteristic_of=")
|
|
46
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
47
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
48
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
49
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
50
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
51
|
+
registerSemanticProperty("dfc-b:hasLabellingDimension", &method("labelling_dimension")).valueSetter = method("labelling_dimension=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #Length
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
require_relative 'quantitative_value'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module DfcLinkmlConnector
|
|
9
|
+
module Models
|
|
10
|
+
class Length < QuantitativeValue
|
|
11
|
+
SEMANTIC_TYPE = "dfc-b:Length".freeze
|
|
12
|
+
|
|
13
|
+
# @param semanticId [String]
|
|
14
|
+
# @param date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, value: nil, unit: nil
|
|
15
|
+
def initialize(semanticId, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, value: nil, unit: nil)
|
|
16
|
+
super(semanticId, date: date, description: description, name: name, characteristicOf: characteristicOf, dimension: dimension, value: value, unit: unit)
|
|
17
|
+
|
|
18
|
+
self.semanticType = "dfc-b:Length"
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #LocalizedProduct
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
require_relative 'what_subject'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module DfcLinkmlConnector
|
|
9
|
+
module Models
|
|
10
|
+
class LocalizedProduct < WhatSubject
|
|
11
|
+
SEMANTIC_TYPE = "dfc-b:LocalizedProduct".freeze
|
|
12
|
+
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :image
|
|
15
|
+
|
|
16
|
+
# @return [Float]
|
|
17
|
+
attr_accessor :cost
|
|
18
|
+
|
|
19
|
+
# @return [Float]
|
|
20
|
+
attr_accessor :quantity
|
|
21
|
+
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :constitued_by
|
|
24
|
+
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :consumed_by
|
|
27
|
+
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :produced_by
|
|
30
|
+
|
|
31
|
+
# @return [QuantitativeValue, String]
|
|
32
|
+
attr_accessor :has_quantity
|
|
33
|
+
|
|
34
|
+
# @return [Array<SuppliedProduct, String>]
|
|
35
|
+
attr_accessor :reference
|
|
36
|
+
|
|
37
|
+
# @return [Array<PhysicalProduct, String>]
|
|
38
|
+
attr_accessor :represented_by
|
|
39
|
+
|
|
40
|
+
# @param semanticId [String]
|
|
41
|
+
# @param date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, image: nil, cost: nil, quantity: nil, constituedBy: nil, consumedBy: nil, producedBy: nil, hasQuantity: nil, reference: [], representedBy: []
|
|
42
|
+
def initialize(semanticId, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, image: nil, cost: nil, quantity: nil, constituedBy: nil, consumedBy: nil, producedBy: nil, hasQuantity: nil, reference: [], representedBy: [])
|
|
43
|
+
super(semanticId, date: date, description: description, name: name, characteristicOf: characteristicOf, dimension: dimension)
|
|
44
|
+
@image = image
|
|
45
|
+
@cost = cost
|
|
46
|
+
@quantity = quantity
|
|
47
|
+
@constitued_by = constituedBy
|
|
48
|
+
@consumed_by = consumedBy
|
|
49
|
+
@produced_by = producedBy
|
|
50
|
+
@has_quantity = hasQuantity
|
|
51
|
+
@reference = reference
|
|
52
|
+
@represented_by = representedBy
|
|
53
|
+
self.semanticType = "dfc-b:LocalizedProduct"
|
|
54
|
+
registerSemanticProperty("dfc-b:Image", &method("image")).valueSetter = method("image=")
|
|
55
|
+
registerSemanticProperty("dfc-b:cost", &method("cost")).valueSetter = method("cost=")
|
|
56
|
+
registerSemanticProperty("dfc-b:quantity", &method("quantity")).valueSetter = method("quantity=")
|
|
57
|
+
registerSemanticProperty("dfc-b:constituedBy", &method("constitued_by")).valueSetter = method("constitued_by=")
|
|
58
|
+
registerSemanticProperty("dfc-b:consumedBy", &method("consumed_by")).valueSetter = method("consumed_by=")
|
|
59
|
+
registerSemanticProperty("dfc-b:producedBy", &method("produced_by")).valueSetter = method("produced_by=")
|
|
60
|
+
registerSemanticProperty("dfc-b:hasQuantity", &method("has_quantity")).valueSetter = method("has_quantity=")
|
|
61
|
+
registerSemanticProperty("dfc-b:hasReference", &method("reference")).valueSetter = method("reference=")
|
|
62
|
+
registerSemanticProperty("dfc-b:representedBy", &method("represented_by")).valueSetter = method("represented_by=")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #NutrientCharacteristic
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class NutrientCharacteristic < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:NutrientCharacteristic".freeze
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :nutrient_characteristic_of
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :date
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :characteristic_of
|
|
26
|
+
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :dimension
|
|
29
|
+
|
|
30
|
+
# @return [Concept, String]
|
|
31
|
+
attr_accessor :nutrient_dimension
|
|
32
|
+
|
|
33
|
+
# @param semanticId [String]
|
|
34
|
+
# @param nutrientCharacteristicOf: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, nutrientDimension: nil
|
|
35
|
+
def initialize(semanticId, nutrientCharacteristicOf: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, nutrientDimension: nil)
|
|
36
|
+
super(semanticId)
|
|
37
|
+
@nutrient_characteristic_of = nutrientCharacteristicOf
|
|
38
|
+
@date = date
|
|
39
|
+
@description = description
|
|
40
|
+
@name = name
|
|
41
|
+
@characteristic_of = characteristicOf
|
|
42
|
+
@dimension = dimension
|
|
43
|
+
@nutrient_dimension = nutrientDimension
|
|
44
|
+
self.semanticType = "dfc-b:NutrientCharacteristic"
|
|
45
|
+
registerSemanticProperty("dfc-b:nutrientCharacteristicOf", &method("nutrient_characteristic_of")).valueSetter = method("nutrient_characteristic_of=")
|
|
46
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
47
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
48
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
49
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
50
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
51
|
+
registerSemanticProperty("dfc-b:hasNutrientDimension", &method("nutrient_dimension")).valueSetter = method("nutrient_dimension=")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
data/lib/models/offer.rb
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #Offer
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class Offer < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:Offer".freeze
|
|
11
|
+
|
|
12
|
+
# @return [Float]
|
|
13
|
+
attr_accessor :discount
|
|
14
|
+
|
|
15
|
+
# @return [Float]
|
|
16
|
+
attr_accessor :stock_limitation
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :concerned_by
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :price
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :listed_in
|
|
26
|
+
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :date
|
|
29
|
+
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :description
|
|
32
|
+
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :name
|
|
35
|
+
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :characteristic_of
|
|
38
|
+
|
|
39
|
+
# @return [String]
|
|
40
|
+
attr_accessor :dimension
|
|
41
|
+
|
|
42
|
+
# @return [CatalogItem, String]
|
|
43
|
+
attr_accessor :offers
|
|
44
|
+
|
|
45
|
+
# @return [CustomerCategory, String]
|
|
46
|
+
attr_accessor :offers_to
|
|
47
|
+
|
|
48
|
+
# @param semanticId [String]
|
|
49
|
+
# @param discount: nil, stockLimitation: nil, concernedBy: nil, price: nil, listedIn: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, offers: nil, offersTo: nil
|
|
50
|
+
def initialize(semanticId, discount: nil, stockLimitation: nil, concernedBy: nil, price: nil, listedIn: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, offers: nil, offersTo: nil)
|
|
51
|
+
super(semanticId)
|
|
52
|
+
@discount = discount
|
|
53
|
+
@stock_limitation = stockLimitation
|
|
54
|
+
@concerned_by = concernedBy
|
|
55
|
+
@price = price
|
|
56
|
+
@listed_in = listedIn
|
|
57
|
+
@date = date
|
|
58
|
+
@description = description
|
|
59
|
+
@name = name
|
|
60
|
+
@characteristic_of = characteristicOf
|
|
61
|
+
@dimension = dimension
|
|
62
|
+
@offers = offers
|
|
63
|
+
@offers_to = offersTo
|
|
64
|
+
self.semanticType = "dfc-b:Offer"
|
|
65
|
+
registerSemanticProperty("dfc-b:discount", &method("discount")).valueSetter = method("discount=")
|
|
66
|
+
registerSemanticProperty("dfc-b:stockLimitation", &method("stock_limitation")).valueSetter = method("stock_limitation=")
|
|
67
|
+
registerSemanticProperty("dfc-b:concernedBy", &method("concerned_by")).valueSetter = method("concerned_by=")
|
|
68
|
+
registerSemanticProperty("dfc-b:hasPrice", &method("price")).valueSetter = method("price=")
|
|
69
|
+
registerSemanticProperty("dfc-b:listedIn", &method("listed_in")).valueSetter = method("listed_in=")
|
|
70
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
71
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
72
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
73
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
74
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
75
|
+
registerSemanticProperty("dfc-b:offers", &method("offers")).valueSetter = method("offers=")
|
|
76
|
+
registerSemanticProperty("dfc-b:offersTo", &method("offers_to")).valueSetter = method("offers_to=")
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #OpeningHoursSpecification
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class OpeningHoursSpecification < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:OpeningHoursSpecification".freeze
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :day_of_week
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :opens
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :closes
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :date
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :description
|
|
26
|
+
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :characteristic_of
|
|
32
|
+
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :dimension
|
|
35
|
+
|
|
36
|
+
# @param semanticId [String]
|
|
37
|
+
# @param dayOfWeek: nil, opens: nil, closes: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil
|
|
38
|
+
def initialize(semanticId, dayOfWeek: nil, opens: nil, closes: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil)
|
|
39
|
+
super(semanticId)
|
|
40
|
+
@day_of_week = dayOfWeek
|
|
41
|
+
@opens = opens
|
|
42
|
+
@closes = closes
|
|
43
|
+
@date = date
|
|
44
|
+
@description = description
|
|
45
|
+
@name = name
|
|
46
|
+
@characteristic_of = characteristicOf
|
|
47
|
+
@dimension = dimension
|
|
48
|
+
self.semanticType = "dfc-b:OpeningHoursSpecification"
|
|
49
|
+
registerSemanticProperty("https://schema.org/dayOfWeek", &method("day_of_week")).valueSetter = method("day_of_week=")
|
|
50
|
+
registerSemanticProperty("https://schema.org/opens", &method("opens")).valueSetter = method("opens=")
|
|
51
|
+
registerSemanticProperty("dfc-b:closes", &method("closes")).valueSetter = method("closes=")
|
|
52
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
53
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
54
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
55
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
56
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
data/lib/models/order.rb
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Class from DFC Business Ontology: #Order
|
|
4
|
+
require_relative '../core/semantic_object'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module DfcLinkmlConnector
|
|
8
|
+
module Models
|
|
9
|
+
class Order < Core::SemanticObject
|
|
10
|
+
SEMANTIC_TYPE = "dfc-b:Order".freeze
|
|
11
|
+
|
|
12
|
+
# @return [Float]
|
|
13
|
+
attr_accessor :discount
|
|
14
|
+
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :order_number
|
|
17
|
+
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :fulfilment_status
|
|
20
|
+
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :order_status
|
|
23
|
+
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :payment_method
|
|
26
|
+
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :payment_status
|
|
29
|
+
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :sold_by
|
|
32
|
+
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :uses
|
|
35
|
+
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :date
|
|
38
|
+
|
|
39
|
+
# @return [String]
|
|
40
|
+
attr_accessor :description
|
|
41
|
+
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :name
|
|
44
|
+
|
|
45
|
+
# @return [String]
|
|
46
|
+
attr_accessor :characteristic_of
|
|
47
|
+
|
|
48
|
+
# @return [String]
|
|
49
|
+
attr_accessor :dimension
|
|
50
|
+
|
|
51
|
+
# @return [SaleSession, String]
|
|
52
|
+
attr_accessor :belongs_to
|
|
53
|
+
|
|
54
|
+
# @return [Array<OrderLine, String>]
|
|
55
|
+
attr_accessor :part
|
|
56
|
+
|
|
57
|
+
# @return [Agent, String]
|
|
58
|
+
attr_accessor :ordered_by
|
|
59
|
+
|
|
60
|
+
# @return [ShippingOption, String]
|
|
61
|
+
attr_accessor :selects
|
|
62
|
+
|
|
63
|
+
# @param semanticId [String]
|
|
64
|
+
# @param discount: nil, orderNumber: nil, fulfilmentStatus: nil, orderStatus: nil, paymentMethod: nil, paymentStatus: nil, soldBy: nil, uses: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, belongsTo: nil, part: [], orderedBy: nil, selects: nil
|
|
65
|
+
def initialize(semanticId, discount: nil, orderNumber: nil, fulfilmentStatus: nil, orderStatus: nil, paymentMethod: nil, paymentStatus: nil, soldBy: nil, uses: nil, date: nil, description: nil, name: nil, characteristicOf: nil, dimension: nil, belongsTo: nil, part: [], orderedBy: nil, selects: nil)
|
|
66
|
+
super(semanticId)
|
|
67
|
+
@discount = discount
|
|
68
|
+
@order_number = orderNumber
|
|
69
|
+
@fulfilment_status = fulfilmentStatus
|
|
70
|
+
@order_status = orderStatus
|
|
71
|
+
@payment_method = paymentMethod
|
|
72
|
+
@payment_status = paymentStatus
|
|
73
|
+
@sold_by = soldBy
|
|
74
|
+
@uses = uses
|
|
75
|
+
@date = date
|
|
76
|
+
@description = description
|
|
77
|
+
@name = name
|
|
78
|
+
@characteristic_of = characteristicOf
|
|
79
|
+
@dimension = dimension
|
|
80
|
+
@belongs_to = belongsTo
|
|
81
|
+
@part = part
|
|
82
|
+
@ordered_by = orderedBy
|
|
83
|
+
@selects = selects
|
|
84
|
+
self.semanticType = "dfc-b:Order"
|
|
85
|
+
registerSemanticProperty("dfc-b:discount", &method("discount")).valueSetter = method("discount=")
|
|
86
|
+
registerSemanticProperty("dfc-b:orderNumber", &method("order_number")).valueSetter = method("order_number=")
|
|
87
|
+
registerSemanticProperty("dfc-b:hasFulfilmentStatus", &method("fulfilment_status")).valueSetter = method("fulfilment_status=")
|
|
88
|
+
registerSemanticProperty("dfc-b:hasOrderStatus", &method("order_status")).valueSetter = method("order_status=")
|
|
89
|
+
registerSemanticProperty("dfc-b:hasPaymentMethod", &method("payment_method")).valueSetter = method("payment_method=")
|
|
90
|
+
registerSemanticProperty("dfc-b:hasPaymentStatus", &method("payment_status")).valueSetter = method("payment_status=")
|
|
91
|
+
registerSemanticProperty("dfc-b:soldBy", &method("sold_by")).valueSetter = method("sold_by=")
|
|
92
|
+
registerSemanticProperty("dfc-b:uses", &method("uses")).valueSetter = method("uses=")
|
|
93
|
+
registerSemanticProperty("dfc-b:date", &method("date")).valueSetter = method("date=")
|
|
94
|
+
registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=")
|
|
95
|
+
registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=")
|
|
96
|
+
registerSemanticProperty("dfc-b:characteristicOf", &method("characteristic_of")).valueSetter = method("characteristic_of=")
|
|
97
|
+
registerSemanticProperty("dfc-b:hasDimension", &method("dimension")).valueSetter = method("dimension=")
|
|
98
|
+
registerSemanticProperty("dfc-b:belongsTo", &method("belongs_to")).valueSetter = method("belongs_to=")
|
|
99
|
+
registerSemanticProperty("dfc-b:hasPart", &method("part")).valueSetter = method("part=")
|
|
100
|
+
registerSemanticProperty("dfc-b:orderedBy", &method("ordered_by")).valueSetter = method("ordered_by=")
|
|
101
|
+
registerSemanticProperty("dfc-b:selects", &method("selects")).valueSetter = method("selects=")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Original DFC v2 API aliases (see config/dfc-original-api.yaml).
|
|
105
|
+
alias_method :number, :order_number
|
|
106
|
+
alias_method :number=, :order_number=
|
|
107
|
+
alias_method :lines, :part
|
|
108
|
+
alias_method :lines=, :part=
|
|
109
|
+
alias_method :client, :ordered_by
|
|
110
|
+
alias_method :client=, :ordered_by=
|
|
111
|
+
|
|
112
|
+
Core::SemanticObject.type_registry[SEMANTIC_TYPE] = self
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|