Skip to content
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

define "xref" as a "relation" #227

Closed
duglin opened this issue Jan 6, 2025 · 3 comments · Fixed by #239
Closed

define "xref" as a "relation" #227

duglin opened this issue Jan 6, 2025 · 3 comments · Fixed by #239

Comments

@duglin
Copy link
Contributor

duglin commented Jan 6, 2025

today it's:

"xref": {
  "name": "xref",
  "type": "url"
},

Actually, thinking more about this... if we made "type" = "relation", that makes "target" a required field. However, this is a problem because we don't know which GROUP/RESOURCE to point to. There could be any number of Groups that share the same Resource definition. Could this be an issue for "relation" in general because once we share resource definitions we really should support a "relation" pointing to any instance of that Resource type regardless of which Group it's in.

@duglin
Copy link
Contributor Author

duglin commented Jan 21, 2025

If we did this then:

"xref": {
  "name": "xref",
  "type": "url"
}

would change to something like (for endpoints/messages):

"xref": {
  "name": "xref",
  "type": "relation",
  "target": "/messagegroups/messages"
}

And each "xref" definition for each Resource defined in the model would be similarly customized. For example, messagegroups/messages would have - the same thing:

"xref": {
  "name": "xref",
  "type": "relation",
  "target": "/messagegroups/messages"
}

Actually this doesn't seem right and might be too restrictive since (I think) any "message" should be able to xref to any other "message" as long as all of the "message" definitions point to the same type-def via ximport. Let's discuss.

@duglin
Copy link
Contributor Author

duglin commented Jan 21, 2025

xref's target is always "self-xid" unless this Resource uses "ximport" then it's the target ximport's self-xid

duglin added a commit to duglin/xreg-spec that referenced this issue Jan 21, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227

Signed-off-by: Doug Davis <[email protected]>
@duglin
Copy link
Contributor Author

duglin commented Jan 21, 2025

@deissnerk can you look at the PR ( #239 ) and see if I got the URL/URI stuff right ?

duglin added a commit to duglin/xreg-spec that referenced this issue Jan 22, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227

Signed-off-by: Doug Davis <[email protected]>
duglin added a commit to duglin/xreg-spec that referenced this issue Jan 22, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"
- add "modelversion" as a model label

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227

Signed-off-by: Doug Davis <[email protected]>
duglin added a commit to duglin/xreg-spec that referenced this issue Jan 22, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"
- add "modelversion" as a model label
- make ?compact convert self, COLLECTONSurl, defaultverionurl into relative
  URLs if they're part of the response
- mandate that all relative URLs start with "/" and they're relative to the
  root path of the Registry

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227
Fixes: xregistry#189

Signed-off-by: Doug Davis <[email protected]>
duglin added a commit to duglin/xreg-spec that referenced this issue Jan 22, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"
- add "modelversion" as a model label
- make ?compact convert self, COLLECTONSurl, defaultverionurl into relative
  URLs if they're part of the response
- mandate that all relative URLs start with "/" and they're relative to the
  root path of the Registry
- ban model changes that turn on hasDoc if Resources have RESOURCE* attribute
  extension names

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227
Fixes: xregistry#189

Signed-off-by: Doug Davis <[email protected]>
duglin added a commit to duglin/xreg-spec that referenced this issue Jan 23, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"
- add "modelversion" as a model label
- make ?compact convert self, COLLECTONSurl, defaultverionurl into relative
  URLs if they're part of the response
- mandate that all relative URLs start with "/" and they're relative to the
  root path of the Registry
- ban model changes that turn on hasDoc if Resources have RESOURCE* attribute
  extension names

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227
Fixes: xregistry#189

Signed-off-by: Doug Davis <[email protected]>
duglin added a commit to duglin/xreg-spec that referenced this issue Jan 23, 2025
- Misc typos/clean-up
- Require `target` to NOT point to a model entity that uses `ximport`.
  Meaning, `target` is not transitive - to keep things simple.
- Tweak usage of `target`. Can be on any relative URL/URI, and if value starts
  with `/` then it must match the xid template. Similar for `relation` but
  `relation` must be an xid... but `target` is optional for all types.
- Add "deprecated" to messages and schemas
- define "xref" as a "relation" type with "target"="self-xid"
- add "modelversion" as a model label
- make ?compact convert self, COLLECTONSurl, defaultverionurl into relative
  URLs if they're part of the response
- mandate that all relative URLs start with "/" and they're relative to the
  root path of the Registry
- ban model changes that turn on hasDoc if Resources have RESOURCE* attribute
  extension names

Fixes: xregistry#236
Fixes: xregistry#226
Fixes: xregistry#227
Fixes: xregistry#189

Signed-off-by: Doug Davis <[email protected]>
@duglin duglin closed this as completed in 9466c08 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant