alps-io / spec

ALPS Specification documents.
59 stars 13 forks source link

Purpose of nested descriptor siblings not clear #80

Open dschulten opened 8 years ago

dschulten commented 8 years ago

Quote from the spec:

--- snip ---

If 'descriptor' is declared at the top level of an ALPS document, then a client SHOULD assume that 'descriptor' can appear anywhere in a runtime message.

If 'descriptor' is nested, i.e. declared as a child of another descriptor, then:

  1. A client SHOULD assume them to appear in any sibling 'descriptor' element and recursively in their child descriptors.
  2. A client SHOULD NOT assume that it can appear anywhere outside of parent descriptor, unless it was explicitly referenced by another descriptor in 'href' attribute. In that case the same rules are applied to 'descriptor' containing 'href' attribute.

A nested item may not occur outside its parent, except when explicitly referenced from the outside. (seems clear)

But I have difficulties to understand statement 1.

When I read the word "them" in 1. as "A client SHOULD assume that the nested descriptor may appear in any sibling 'descriptor' element and recursively in their child descriptors"

<descriptor id="parent">
  <descriptor id="child" >
    <descriptor id="grandchild1"/>
  </descriptor>
  <descriptor id="sibling" >
     <descriptor id="grandchild2"/>
  </descriptor>  
</descriptor>

It seems to say that 'child' implicitly is also present within 'sibling' and within 'grandchild2' and any deeper level below 'sibling', but not implicitly present below 'child'. Do I read that correctly? If so, what is the purpose of this?

Cheers

mamund commented 8 years ago

DS:

sorry for the long silence on this.

this is an attempt to give some guidance (not spec, i guess) on how to handle "scoping" issues for ALPS documents. the point we're trying to make here is:

nesting descriptors is limiting their assumed scope. if i declare at the top of the document, then it should be assumed to have a scope of global. however, if i declare <descriptor id="givenName" /> within another descriptor (e.g. <descriptor id="person">....) then it should be assumed to be within the scope of "person", not the global document.

this is still open for discussion but i hope this helps clear it up.

if you'd like to suggest an improvement feel free to do a fork/PR on that.

cheers.

mamund Mike Amundsen +1.859.757.1449 skype: mca.amundsen http://amundsen.com/blog/ http://twitter.com/mamund https://github.com/mamund http://linkedin.com/in/mamund

On Wed, Oct 28, 2015 at 4:21 PM, Dietrich Schulten <notifications@github.com

wrote:

Quote from the spec:

--- snip ---

If 'descriptor' is declared at the top level of an ALPS document, then a client SHOULD assume that 'descriptor' can appear anywhere in a runtime message.

If 'descriptor' is nested, i.e. declared as a child of another descriptor, then:

1.

A client SHOULD assume them to appear in any sibling 'descriptor' element and recursively in their child descriptors. 2.

A client SHOULD NOT assume that it can appear anywhere outside of parent descriptor, unless it was explicitly referenced by another descriptor in 'href' attribute. In that case the same rules are applied to 'descriptor' containing 'href' attribute.


I have difficulties to understand statement 1.

A nested item may not occur outside its parent, except when explicitly referenced from the outside. (seems clear)

But when I read "them" in 1. as: A nested descriptor may "appear in any sibling 'descriptor' element and recursively in their child descriptors"

It seems to say that 'child' implicitly is also present within 'sibling' and within 'grandchild2' and any deeper level below 'sibling', but not implicitly present below 'child' . Do I read that correctly? If so, what is the purpose of this?

Cheers Dietrich

— Reply to this email directly or view it on GitHub https://github.com/alps-io/spec/issues/80.