Skip to content

Commit c6cc2e5

Browse files
authored
Remove unnecessary either (#536)
1 parent c8aea2f commit c6cc2e5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

schema_salad/metaschema/link_res.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Link resolution
33
44
The schema may designate one or more fields as link fields that reference other
5-
objects. Processing must resolve links to either absolute URIs using the
5+
objects. Processing must resolve links to absolute URIs using the
66
following rules:
77
88
* If a reference URI is prefixed with `#` it is a relative

schema_salad/tests/metaschema-pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"```\n\nThis becomes:\n\n```\n",
1919
"{\n \"id\": \"http://example.com/base\",\n \"form\": {\n \"id\": \"http://example.com/base#one\",\n \"things\": [\n {\n \"id\": \"http://example.com/base#one/two\"\n },\n {\n \"id\": \"http://example.com/base#three\"\n },\n {\n \"id\": \"http://example.com/four#five\",\n },\n {\n \"id\": \"http://example.com/acid#six\",\n },\n {\n \"subscopeField\": {\n \"id\": \"http://example.com/base#one/thisIsASubscope/seven\"\n }\n }\n ],\n }\n}\n",
2020
"```\n",
21-
"## Link resolution\n\nThe schema may designate one or more fields as link fields that reference other\nobjects. Processing must resolve links to either absolute URIs using the\nfollowing rules:\n\n* If a reference URI is prefixed with `#` it is a relative\nfragment identifier. It is resolved relative to the base URI by setting\nor replacing the fragment portion of the base URI.\n\n* If a reference URI does not contain a scheme and is not prefixed with `#`\nit is a path relative reference. If the reference URI contains `#` in any\nposition other than the first character, the reference URI must be divided\ninto a path portion and a fragment portion split on the first instance of\n`#`. The path portion is resolved relative to the base URI by the following\nrule: if the path portion of the base URI ends in a slash `/`, append the\npath portion of the reference URI to the path portion of the base URI. If\nthe path portion of the base URI does not end in a slash, replace the final\npath segment with the path portion of the reference URI. Replace the\nfragment portion of the base URI with the fragment portion of the reference\nURI.\n\n* If a reference URI begins with a namespace prefix declared in `$namespaces`\nfollowed by a colon `:`, the prefix and colon must be replaced by the\nnamespace declared in `$namespaces`.\n\n* If a reference URI is an absolute URI consisting of a scheme and path,\nno processing occurs.\n\nLink resolution must not affect the base URI used to resolve identifiers\nand other links.\n\n### Link resolution example\n\nGiven the following schema:\n\n```\n",
21+
"## Link resolution\n\nThe schema may designate one or more fields as link fields that reference other\nobjects. Processing must resolve links to absolute URIs using the\nfollowing rules:\n\n* If a reference URI is prefixed with `#` it is a relative\nfragment identifier. It is resolved relative to the base URI by setting\nor replacing the fragment portion of the base URI.\n\n* If a reference URI does not contain a scheme and is not prefixed with `#`\nit is a path relative reference. If the reference URI contains `#` in any\nposition other than the first character, the reference URI must be divided\ninto a path portion and a fragment portion split on the first instance of\n`#`. The path portion is resolved relative to the base URI by the following\nrule: if the path portion of the base URI ends in a slash `/`, append the\npath portion of the reference URI to the path portion of the base URI. If\nthe path portion of the base URI does not end in a slash, replace the final\npath segment with the path portion of the reference URI. Replace the\nfragment portion of the base URI with the fragment portion of the reference\nURI.\n\n* If a reference URI begins with a namespace prefix declared in `$namespaces`\nfollowed by a colon `:`, the prefix and colon must be replaced by the\nnamespace declared in `$namespaces`.\n\n* If a reference URI is an absolute URI consisting of a scheme and path,\nno processing occurs.\n\nLink resolution must not affect the base URI used to resolve identifiers\nand other links.\n\n### Link resolution example\n\nGiven the following schema:\n\n```\n",
2222
"{\n \"$namespaces\": {\n \"acid\": \"http://example.com/acid#\"\n },\n \"$graph\": [{\n \"name\": \"ExampleType\",\n \"type\": \"record\",\n \"fields\": [{\n \"name\": \"link\",\n \"type\": \"string\",\n \"jsonldPredicate\": {\n \"_type\": \"@id\"\n }\n }]\n }]\n}\n",
2323
"```\n\nProcess the following example:\n\n```\n",
2424
"{\n \"$base\": \"http://example.com/base\",\n \"link\": \"http://example.com/base/zero\",\n \"form\": {\n \"link\": \"one\",\n \"things\": [\n {\n \"link\": \"two\"\n },\n {\n \"link\": \"#three\",\n },\n {\n \"link\": \"four#five\",\n },\n {\n \"link\": \"acid:six\",\n }\n ]\n }\n}\n",

0 commit comments

Comments
 (0)