Version 2.0.0#30
Conversation
mkllnk
left a comment
There was a problem hiding this comment.
The CI build is broken due to an old bundler version. Are you planning to fix that or should I have a look?
OK I let you have a look, thanks @mkllnk. |
|
I updated the Ruby versions. Bundler is installing now but the specs are still out of date and it's not compatible with Ruby 4 yet. |
|
OK, I've added the w3id and jsdeliver aliases and deleted the Enterprise class. Released as https://rubygems.org/gems/datafoodconsortium-connector/versions/2.0.0.pre.beta2. |
|
I've just released a new version containing some fixes: https://rubygems.org/gems/datafoodconsortium-connector/versions/2.0.0.pre.beta3. There are still some fixes to do. |
|
I've just released https://rubygems.org/gems/datafoodconsortium-connector/versions/2.0.0.pre.beta4. It should be complete now in term of feature. Still have to make the tests to pass. |
|
Should we add a class for an LDP container to the library? Containers are part of the standard now. I just created this within OFN: # frozen_string_literal: true
module DfcProvider
# The DFC v2 mandates the use of LDP containers to list resources.
# The Connector didn't provide a class for that, so we add it here.
class Container
include VirtualAssembly::Semantizer::SemanticObject
SEMANTIC_TYPE = "ldp:Container"
attr_accessor :members
def initialize(semantic_id, members: [])
super(semantic_id)
self.semanticType = SEMANTIC_TYPE
@members = members
registerSemanticProperty("ldp:contains", &method("members")).valueSetter = method("members=")
end
end
end |
|
@mkllnk I've released v2.0.0-beta6 which fixes the tests. Ready for testing. We should add more tests to test new classes. There is still one error in the tests which might be related to a taxonomy URL issue: the context links |
Do we want the ids of taxons to include versions? In that case |
You're right, there was a URI to change in the |
|
|
||
| id = object.value.sub( | ||
| "http://static.datafoodconsortium.org/data/measures.rdf#", "dfc-m:" | ||
| "http://w3id.org/dfc/taxonomies/v2.0.0/measures.rdf#", "dfc-m:" |
There was a problem hiding this comment.
Is there any file referencing this? When I visit the URL, I'm redirected to https://cdn.jsdelivr.net/gh/datafoodconsortium/taxonomies@v2.0.0/measures.rdf which contains the right ids without /v2.0.0.
There was a problem hiding this comment.
Apparently there are. Fixing this allowed to pass the test "imports a graph including anonymous objects" from the file spec/importer_spec.rb.
There was a problem hiding this comment.
You introduced the spec/importer.rb containing this code snippet in the connector-codegen repo on Jan 7, 2024 with this commit stating:
This was copied from Open Food Network and only changes static files. The next commits will improve this by leveraging the code generator.
In the ruby-connector repo it has been introduced by this commit
There was a problem hiding this comment.
The original spec was for the original context referencing https://github.com/datafoodconsortium/taxonomies/releases/latest/download/. You updated that spec to include the v2.0.0 string but that's not real data. The new context would not contain the version string, right?
I think that this code for backwards-compatibility can be removed now. We just use the new context in v2.
- let(:product_data_with_context_v1_8) do
+ let(:product_data_with_context_v2) do
<<~JSON
{
"@context": {
- "dfc-b": "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#",
- "dfc-m": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/measures.rdf#",
- "dfc-pt": "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
+ "dfc-b": "http://w3id.org/dfc/ontology/v2.0.0/src/DFC_BusinessOntology.owl#",
+ "dfc-m": "http://w3id.org/dfc/taxonomies/v2.0.0/measures.rdf#",
+ "dfc-pt": "http://w3id.org/dfc/taxonomies/v2.0.0/productTypes.rdf#",| "http://www.datafoodconsortium.org/wp-content/plugins/wordpress-context-jsonld/context_2.0.0.jsonld", | ||
| URL_NORMALISED | ||
| ) | ||
|
|
||
| # This was the file the DFC website refers to in a link header. | ||
| alias_preloaded( | ||
| "http://www.datafoodconsortium.org/wp-content/plugins/wordpress-context-jsonld/context.jsonld", | ||
| "http://www.datafoodconsortium.org/wp-content/plugins/wordpress-context-jsonld/context_2.0.0.jsonld", |
There was a problem hiding this comment.
This is a duplicate now. The context is only available with version number. We can remove one of these aliases.
Why do we still publish the context on the Wordpress site? Isn't the w3id.org URL the one everyone should use? It redirects to JSDelivr and it makes sense to add that alias, in case someone wants to avoid the redirect. But what's the use case for the Wordpress link now?
I guess that the link header points there but it could just point to the w3id URL, right?
There was a problem hiding this comment.
Yes, right, I've deleted the duplicate preload. Maybe it has been included when I merged manually.
OK I agree the WP link seems useless now. We should use the JSDelivr URL.
I don't know if we want to keep the Link: <...>; rel="alternate" to link the domain with the context? If so it would make more sense to add this link to the dfc-standard.org domain which should be used as the standard new official URL while datafoodconsortium.org is about the french-only project.
There was a problem hiding this comment.
I don't know if we want to keep the Link: <...>; rel="alternate" to link the domain with the context? If so it would make more sense to add this link to the dfc-standard.org domain which should be used as the standard new official URL while datafoodconsortium.org is about the french-only project.
That makes sense. But most implementations should link to a specific version on w3id anyway, I think. The dfc-standard.org reference would be for examples and applications that thrive for maximum compatibility with all versions (>= 2.0).
Created from closed #29.