feat(hydra): use hydra:memberAssertion instead of owl:equivalentClass#7944
Open
abderrahimghazali wants to merge 1 commit intoapi-platform:mainfrom
Open
feat(hydra): use hydra:memberAssertion instead of owl:equivalentClass#7944abderrahimghazali wants to merge 1 commit intoapi-platform:mainfrom
abderrahimghazali wants to merge 1 commit intoapi-platform:mainfrom
Conversation
Per the Hydra Core spec (hydra-cg.com/spec/latest/core/), entrypoint collection properties now declare member semantics via a `hydra:memberAssertion` block (subject/property/object) rather than the legacy `owl:equivalentClass`/`owl:allValuesFrom` restriction. Aligns the API documentation with the modern term and removes the awkward OWL block. Refs api-platform#2827, HydraCG/Specifications#195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per the Hydra Core spec (introduced in HydraCG/Specifications#195 and later renamed
manages→memberAssertion), entrypoint collection properties now declare what kind of resources they manage via ahydra:memberAssertionblock rather than the legacyowl:equivalentClass/owl:allValuesFromrestriction.The Hydra JSON-LD vocabulary already exposes
memberAssertion,subject,property, andobject(seesrc/JsonLd/HydraContext.php);hydra:managesis now flagged asarchaicwith a comment pointing tohydra:memberAssertion. This PR aligns the documentation output with the modern term and removes the awkward OWL block dunglas pointed to in the issue.Before
After
Changes
src/Hydra/Serializer/DocumentationNormalizer.php— replace theowl:equivalentClassblock withhydra:memberAssertioninpopulateEntrypointProperties().src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php— update both prefixed and prefix-less fixtures (testNormalize,testNormalizeWithoutPrefix).Follow-up
api-platform/api-doc-parsercurrently parses theowl:equivalentClassblock to discover member types — it will need a follow-up patch to readhydra:memberAssertioninstead. Filing this as draft pending that patch.Test plan
vendor/bin/phpunit src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php— 7/7 passvendor/bin/phpunit src/Hydra/Tests— 50/50 passvendor/bin/phpunit tests/JsonLd— 21/21 pass