|
From: Tyler C. <ty...@wa...> - 2006-02-03 15:07:19
|
On Feb 2, 2006, at 3:21 PM, Sandro Magi wrote: > I'm making a little headway with these schemas. I'm looking at=20 > org.yurl.Author at the moment since it seems to encapsulate most of=20 > elements: Link, Embed, methods, etc. Yes, the org.yurl.Author object is a good example to study to learn=20 about schemas. > Here is my current understanding: > > =A01. if an object has an explicit schema (ie. = yurl.org/wiki/Page.xml),=20 > then it does not require the schema attibute on individual nodes; ie.=20= > a Page only requires the 'schema' in the top-level node to identify it=20= > as a Page, whereas an object without a predefined schema would need a=20= > 'schema' attribute on each node. The general rule is that the schema MUST be explicitly stated on the=20 node, unless it can be unambiguously determined based on the schema and=20= branch of the containing node. For example, the=20 <http://yurl.org/Author> schema specifies the expected schema for the=20 'topic' branch as <http://web-calculus.org/string/String>. If you do a=20= "View Source" on one of the wiki editors, you will see that the schema=20= attribute on the 'topic' branch is not specified since the referred to=20= node is in fact a string. The recipient of the wiki editor node can=20 unambiguously determine the schema for the 'topic' node since the=20 schema for the top level node (the 'doc' branch) is specified and that=20= schema provides the expected schema for the 'topic' branch. > =A02. a yurl.org/Author also has an explicit/pre-defined schema, but = the=20 > method definitions seem to be "overridden" in the actual doc returned=20= > to the client; in yurl.org/Author, 'revoke' is defined as a=20 > yurl.org/Author-revoke, but the actual returned doc has a=20 > http://web-calculus.org/pointer/Link in its place, and a schema=20 > "override" to convey this information. The schema for pointer nodes is always explicitly stated. This feature=20= enables writing of a web-calculus spider which could traverse an=20 arbitrary graph of nodes, without needing to know the schema of any=20 encountered node. For example, such a spider could make a backup of your yurl.net wiki. > So this leads to a question: > > In this case, the Author methods translate into a set of=20 > http://web-calculus.org/pointer/Link in the returned document. Is this=20= > necessarily the case for all methods? Yes. > Can a method be returned as an http://web-calculus.org/pointer/Embed=20= > instead? No. > If so, what determines the Author methods should be of type Link in=20= > this particular case? An Embed link means: "replace this pointer node with the node at this=20 address". For a method, the client needs to retain the pointer so that=20= POST requests can be sent along it. So an object method is always=20 represented as a Link, which means: "replace this pointer node with a=20 link to the specified address". Tyler --- The web-calculus is the union of REST and capability-based security: http://www.waterken.com/dev/Web/ |