From 7dc6cb151db0aed055dc2937eb3a48dd5d18655c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 3 Jul 2023 13:27:24 +1000 Subject: [PATCH] Include DFC context in spec example The DFC Prototype does include the context while the output of the DFC Connector refers to the URL of the published context. While that's more efficient, it's also brittle because the context is updated from time to time. That happened three days ago and working with the newly published context breaks our integration until we get an updated version of the DFC Connector containing the new URLs for datatypes. --- .../dfc_provider/spec/requests/supplied_products_spec.rb | 6 +++++- swagger/dfc-v1.7/swagger.yaml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/dfc_provider/spec/requests/supplied_products_spec.rb b/engines/dfc_provider/spec/requests/supplied_products_spec.rb index 4e0484799d..c506869e22 100644 --- a/engines/dfc_provider/spec/requests/supplied_products_spec.rb +++ b/engines/dfc_provider/spec/requests/supplied_products_spec.rb @@ -30,7 +30,11 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc-v1.7/swagger.yaml # supply it. I couldn't do it with rswag when requiring it. parameter name: :supplied_product, in: :body, required: false, schema: { example: { - '@context': "http://static.datafoodconsortium.org/ontologies/context.json", + '@context': { + '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#", + }, '@id': "http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0", '@type': "dfc-b:SuppliedProduct", 'dfc-b:name': "Apple", diff --git a/swagger/dfc-v1.7/swagger.yaml b/swagger/dfc-v1.7/swagger.yaml index 473bda2f7b..c7b5ebcb17 100644 --- a/swagger/dfc-v1.7/swagger.yaml +++ b/swagger/dfc-v1.7/swagger.yaml @@ -308,7 +308,10 @@ paths: application/json: schema: example: - "@context": http://static.datafoodconsortium.org/ontologies/context.json + "@context": + 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# "@id": http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0 "@type": dfc-b:SuppliedProduct dfc-b:name: Apple