New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DFC API] Add custom OFN product id to DFC SuppliedProduct #11378
[DFC API] Add custom OFN product id to DFC SuppliedProduct #11378
Conversation
@@ -1,5 +1,6 @@ | |||
# frozen_string_literal: true | |||
|
|||
require "data_food_consortium/connector/connector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require "data_food_consortium/connector/connector" | |
require "datafoodconsortium/connector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, maybe not the best change :P will read better
4b349ac
to
5c33bab
Compare
When the application is not preloaded then running Rspec doesn't know Rails until the spec helper is loaded. So we can't use Rails to find the path of the spec helper. This has been fixed before but the DFC Address code was developed at the same time and missed.
The Spree::Variant in OFN corresponds to a DFC SuppliedProduct. But several Spree::Variant can be grouped under one Spree::Product which wasn't exposed on the DFC API. I'm adding a custom property here which can be used internally and shouldn't break any other DFC tools. A gotcha of this first test implementation: The `ofn:` prefix has not been defined in the context. Software needs to know that this is an Open Food Network attribute or ignore it. We could define our own context and ontology and publish it on our website but I don't see any benefit of that at this point.
5c33bab
to
8b32ac2
Compare
8b32ac2
to
02f251c
Compare
In Rswag request specs, the `response` block is like `describe` and is just used to group several other blocks. It can be long and that's okay.
@mkllnk I am assuming this need to be tracked agains : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I have a small comment about formatting, but that is all.
engines/dfc_provider/lib/data_food_consortium/connector/importer.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Merging as no manual test needed. |
ℹ️ This is a funded feature. Please track your time in
#9170 OFN DFC Products
.What? Why?
The DFC doesn't model grouping of several products (variants). So we add an OFN custom property for our own integrations. Other software should ignore it. For other semantic web tools the
ofn:
URI is not defined and can't be resolved. We haven't defined our own ontology. But I don't see a need for that at the moment.What should we test?
Release notes
Changelog Category: Technical changes
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates