Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request api-platform#1467 from dunglas/fix-owl
Browse files Browse the repository at this point in the history
Fix owl:allValuesFrom when using IRIs
  • Loading branch information
dunglas authored Oct 31, 2017
2 parents a9672b0 + e6b302e commit 2f2c569
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/Hydra/Serializer/DocumentationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ private function populateEntrypointProperties(string $resourceClass, ResourceMet
'domain' => '#Entrypoint',
'rdfs:label' => "The collection of $shortName resources",
'rdfs:range' => [
'hydra:Collection',
['@id' => 'hydra:Collection'],
[
'owl:equivalentClass' => [
'owl:onProperty' => 'hydra:member',
'owl:allValuesFrom' => "#$shortName",
'owl:onProperty' => ['@id' => 'hydra:member'],
'owl:allValuesFrom' => ['@id' => $prefixedShortName],
],
],
],
Expand Down
40 changes: 20 additions & 20 deletions tests/Hydra/Serializer/DocumentationNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ public function testNormalize()
'hydra:title' => 'Test Api',
'hydra:description' => 'test ApiGerard',
'hydra:supportedClass' => [
0 => [
[
'@id' => '#dummy',
'@type' => 'hydra:Class',
'rdfs:label' => 'dummy',
'hydra:title' => 'dummy',
'hydra:description' => 'dummy',
'hydra:supportedProperty' => [
0 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#dummy/name',
Expand All @@ -153,7 +153,7 @@ public function testNormalize()
'hydra:writable' => true,
'hydra:description' => 'name',
],
1 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#dummy/description',
Expand All @@ -168,7 +168,7 @@ public function testNormalize()
'hydra:writable' => true,
'hydra:description' => 'description',
],
2 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#dummy/relatedDummy',
Expand All @@ -185,23 +185,23 @@ public function testNormalize()
],
],
'hydra:supportedOperation' => [
0 => [
[
'@type' => ['hydra:Operation', 'schema:FindAction'],
'hydra:method' => 'GET',
'hydra:title' => 'foobar',
'rdfs:label' => 'foobar',
'returns' => '#dummy',
'hydra:foo' => 'bar',
],
1 => [
[
'@type' => ['hydra:Operation', 'schema:ReplaceAction'],
'expects' => '#dummy',
'hydra:method' => 'PUT',
'hydra:title' => 'Replaces the dummy resource.',
'rdfs:label' => 'Replaces the dummy resource.',
'returns' => '#dummy',
],
2 => [
[
'@type' => ['hydra:Operation', 'schema:FindAction'],
'hydra:method' => 'GET',
'hydra:title' => 'Retrieves a relatedDummy resource.',
Expand All @@ -210,44 +210,44 @@ public function testNormalize()
],
],
],
1 => [
[
'@id' => '#Entrypoint',
'@type' => 'hydra:Class',
'hydra:title' => 'The API entrypoint',
'hydra:supportedProperty' => [
0 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#Entrypoint/dummy',
'@type' => 'hydra:Link',
'rdfs:label' => 'The collection of dummy resources',
'domain' => '#Entrypoint',
'rdfs:range' => [
'hydra:Collection',
['@id' => 'hydra:Collection'],
[
'owl:equivalentClass' => [
'owl:onProperty' => 'hydra:member',
'owl:allValuesFrom' => '#dummy',
'owl:onProperty' => ['@id' => 'hydra:member'],
'owl:allValuesFrom' => ['@id' => '#dummy'],
],
],
],
'hydra:supportedOperation' => [
0 => [
[
'@type' => ['hydra:Operation', 'schema:FindAction'],
'hydra:method' => 'GET',
'hydra:title' => 'Retrieves the collection of dummy resources.',
'rdfs:label' => 'Retrieves the collection of dummy resources.',
'returns' => 'hydra:Collection',
],
1 => [
[
'@type' => ['hydra:Operation', 'schema:CreateAction'],
'expects' => '#dummy',
'hydra:method' => 'POST',
'hydra:title' => 'Creates a dummy resource.',
'rdfs:label' => 'Creates a dummy resource.',
'returns' => '#dummy',
],
2 => [
[
'@type' => ['hydra:Operation', 'schema:FindAction'],
'hydra:method' => 'GET',
'hydra:title' => 'Retrieves a relatedDummy resource.',
Expand All @@ -268,12 +268,12 @@ public function testNormalize()
'returns' => '#EntryPoint',
],
],
2 => [
[
'@id' => '#ConstraintViolation',
'@type' => 'hydra:Class',
'hydra:title' => 'A constraint violation',
'hydra:supportedProperty' => [
0 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#ConstraintViolation/propertyPath',
Expand All @@ -287,7 +287,7 @@ public function testNormalize()
'hydra:readable' => true,
'hydra:writable' => false,
],
1 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#ConstraintViolation/message',
Expand All @@ -303,13 +303,13 @@ public function testNormalize()
],
],
],
3 => [
[
'@id' => '#ConstraintViolationList',
'@type' => 'hydra:Class',
'subClassOf' => 'hydra:Error',
'hydra:title' => 'A constraint violation list',
'hydra:supportedProperty' => [
0 => [
[
'@type' => 'hydra:SupportedProperty',
'hydra:property' => [
'@id' => '#ConstraintViolationList/violations',
Expand Down

0 comments on commit 2f2c569

Please sign in to comment.