mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix DFC context in spec example
This commit is contained in:
@@ -110,7 +110,7 @@ class QuantitativeValueBuilder < DfcBuilder
|
||||
else
|
||||
# Labels may be provided one day:
|
||||
# https://github.com/datafoodconsortium/connector-ruby/issues/18
|
||||
label = unit.semanticId.split("#").last || "items"
|
||||
label = unit.try(:semanticId)&.split("#")&.last || "items"
|
||||
["items", label, 1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,6 +32,9 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc-v1.7/swagger.yaml
|
||||
'dfc-b': "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#",
|
||||
'dfc-m': "http://static.datafoodconsortium.org/data/measures.rdf#",
|
||||
'dfc-pt': "http://static.datafoodconsortium.org/data/productTypes.rdf#",
|
||||
'dfc-b:hasUnit': {
|
||||
'@type': "@id"
|
||||
},
|
||||
},
|
||||
'@id': "http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0",
|
||||
'@type': "dfc-b:SuppliedProduct",
|
||||
|
||||
@@ -330,7 +330,7 @@ paths:
|
||||
dfc-b:hasType: http://static.datafoodconsortium.org/data/productTypes.rdf#non-local-vegetable
|
||||
dfc-b:hasQuantity:
|
||||
"@type": dfc-b:QuantitativeValue
|
||||
dfc-b:hasUnit: dfc-m:Piece
|
||||
dfc-b:hasUnit: dfc-m:Gram
|
||||
dfc-b:value: 3.0
|
||||
dfc-b:alcoholPercentage: 0.0
|
||||
dfc-b:lifetime: ''
|
||||
@@ -345,6 +345,8 @@ paths:
|
||||
dfc-b: http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#
|
||||
dfc-m: http://static.datafoodconsortium.org/data/measures.rdf#
|
||||
dfc-pt: http://static.datafoodconsortium.org/data/productTypes.rdf#
|
||||
dfc-b:hasUnit:
|
||||
"@type": "@id"
|
||||
"@id": http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Apple
|
||||
|
||||
Reference in New Issue
Block a user