
Dear GRAAP members, one of the last open issues for the next release of our spec was the semantics of compositors and the use of templates. There were some concerns about using compositors on a template as well as offer/agreement level, potentially introducing semantic ambiguity as to who must or can exercise options. After some discussion since the last call, Toshi, karl and I propose the following, to be discussed in today's call: 1. Compositors have agreement offer-level semantics only. They are not to be interpreted as choices of the initiator. 2. To express more flexibility, we propose to extend the CreationConstraints as follows: Add an attribute "mode" to Location that can be "insert" or "replace". If the value is set to replace, have another attribute "before" with values of positive integers and "end". With those instruments in addition to complex types in creation contraints we can express, for example, the following: ... <wsag:ServiceDescriptionTerm> <ns1:docroot> <ns1:fieldA>myfixedvalue</ns1:fieldB> <ns1:fieldB>default value</ns1:fieldB> </ns1:docroot> </wsag:ServiceDescriptionTerm> ... <CreationConstraints> <Item name="i1"> <Location mode="replace">//ns1:fieldB<Location> <xsd:restriction base="xsd:string"> <xsd:enumeration value="foo"/> <xsd:enumeration value="bar"/> </xsd:restriction> </Item> <Item name="i2"> <Location mode="insert" before="end">//ns1:docroot<Location> <xsd:sequence maxOccurs="128"> <xsd:element ref="ns1:fieldC"/> // You could inline a more complex element here. <xsd:choice minOccurs="0"> // To any fieldB element, we can add more arbitrary input, e.g., file names etc. <xs:element ref=wsgram:FileStageIn minOccurs=0 maxOccurs=unbounded/> </xsd:choice> </xsd:sequence> </Item> </CreationConstraints> Using the added expressivness of the Location element, we can deal with zero or more cardinalities. I propose to use schema for associating the occurrance of one element (fieldC) with another (fieldC). You cannot express this in either the Infoset notation nor the compositors. This way, we achieve a pretty powerful composition semantics, do not replicate expressivness covered by schema and don't need template-level compositors. Talk to you at 11 EST, Heiko ----- Heiko Ludwig, Dr. rer. pol. IBM TJ Watson Research Center, PO Box 704, Yorktown, NY, 10598 hludwig@us.ibm.com, tel. +1 914 784 7160, mob. +1 646 675 8469 http://www.research.ibm.com/people/h/hludwig/

Heiko and GRAAP: I think I have narrowed down my discomfort with the current template proposal... basically, I think we are on the right track with the creation constraints but the prototype aspect is still too biased towards a particular flavor of domain-specific term language that is "flat" and has no variable-cardinality content. Once you start wanting to admit a domain language with optional fields or repeatable fields WITHOUT TOTALLY CONSTRAINING ITS USE, this approach gets in the way. EVALUATION CRITERIA We of course need to keep focused on delivering a specification, so I am writing this email with the intent that people can review my suggestions and decide if they make sense and are easy enough to write into the specification without any non-trivial change to the schedule, i.e. Heiko should feel that it isn't more complex or open-ended than his proposal in terms of specification content, and that it also seems beneficial, and others should agree as well. :-) My concept of an "ideal" template is one that does the following in a very concise manner (in rough order of importance): 1. identify the domain-specific language(s) that are allowed in terms 2. specify the prototype values for terms, e.g. fixed or default** values which are specific to one WS-Agreement service rather than schema-level fixed/default values 3. specify other more general content restrictions, e.g. identify a place where the domain-language has open content and specify a smaller list of recognized extensions that are acceptable 4. related to (1), specify the compositional rules/restrictions for terms in an offer, e.g. the whole "template composition" discussion. this is basically a matter of asserting restrictions to the generic wsag:compositor syntax of the offer. 5. assumes schema-level understanding of the content model in the absence of prototypes and restrictions, i.e. do not require the template to re-state the structural requirements of the domain language if the WS-Agreement service is not trying to restrict it further In other words, the offer MUST (SHOULD?) conform to the WS-Agreement envelope and domain-specific term schemas, and it also MUST (SHOULD?) conform to the additional prototypes and restrictions of the template! The current proposal doesn't allow concise mixing of the prototype and restriction mechanisms. You end up having to either generate a large set of creation constraints that express the different parts of the domain schema (redundantly) against a prototype, or you cannot use the prototype feature and you provide one more compact creation constraint. My view is that the current prototype mechanism is not valuable enough to keep, when a slight modification to the constraint model can cover the case where it is concise (a simple fixed list of values). ALTERNATE PROPOSAL Make the entire template a set of constraint rules which have a new "triggering" and "reference" model: they refer to the eventual offer document by XPath instead of the (now non-existent) prototype document. Furthermore, they are softened by default to only apply IF their XPath reference matches content in the prototype. (If they select an empty "nodeset" from the offer, they are ignored by default.) An extra attribute is permitted to override this soft triggering model and REQUIRE that the nodeset references by the Xpath (even if empty) match the constraint's content model. <Item> <Location required="boolean"?>XPath</Location> ...XSD content model... </Item> Whatever content in the offer is addressed by /Item/Location must conform to the content model in the rule. The Location is evaluated with the wsag:offer element as the root. This content model can be any of the following to cover our use cases: 1. a literal value or subtree to cover the fixed/prototype case 2. a simple restriction for the old enumeration use case 3. a complex restriction/group for the new structural restriction 4. an attribute group to cover the bases for reasonable XPath references? There is an implicit rule in every template which could be made explicit without harm: <Item> <Location required=true>/wsag:AgreementOffer</Location> <xsd:sequence> <xsd:element ref="wsag:AgreementOffer"/> </xsd:sequence> </Item> Which by itself means that the offer must conform to the WS-Agreement normative schema. A minimal open-ended template might just want to identify the domain language and a simple compositor structure without making additional restrictions: <Item> <Location required=true> /wsag:AgreementOffer/wsag:Terms/wsag:All/* </Location> <xsd:sequence> <xsd:element ref="wsag:ServiceDescriptionTerm"/> </xsd:sequence> </Item> <Item> <Location>//wsag:ServiceDescriptionTerm/*</Location> <xsd:sequence> <xsd:element ref="tns:docroot"/> </xsd:sequence> </Item> The first rule says that the offer must have the very simple form of an All compositor with one child element ServiceDescriptionTerm... the number of children could be opened up with cardinality attributes in the sequence definition of the rule. Alternatively, someone could write a rule with Location /wsag:AgreementOffer and then provide more inline typing to give a restriction of it? The second rule says that the (any) service description term must have the tns:docroot domain-specific element in it. A benefit of this approach for complex domain languages is that the variable structure of the domain language is preserved with all its flexibility UNLESS the template lists constraints against the structure. Someone more familiar with XPath and/or XSD may be able to show a more compact way to write both of these conditions into one rule. To do the fixed value fieldA from Heiko's email: <Item> <Location>//tns:docroot/fieldA/text()</Location> <wsag:literal>fixed value</wsag:literal> </Item> i.e. we define one "literal" content model to handle the prototype cases concisely. (Is there an XSD feature that works as well? The most concise I can think of is a one-element enumeration restriction...) These rules can be overlapping at different depths in the tree, so that the "top-level" rules fix the superstructure with brief ref=elementname descriptions of structure, implying that the general purpose elementname schema is acceptable, while later rules further restrict the use of that schema by referencing substructures in the descendents of elementname. Thus, I hope I have demonstrated that this approach is just as expressive in terms of conveying information about offer requirements to the human. I do not think we have use-cases in mind yet where we can evaluate the automatic consumption of templates by schema-aware software. :-( I think this is more general and consistent w/ the nodeset/infoset model of XPath selection, e.g. rules select parts of the offer and define schematic requirements on those selected parts. EXAMPLE Here is the concrete example w/ the same implied offer content as Heiko's email example, e.g. I've left out the same contextual bits as were left out in his! <template> <Item> <Location required=true>//wsag:ServiceDescriptionTerm/*</Location> <xsd:sequence> <xsd:element ref="tns:docroot"/> </xsd:sequence> </Item> <Item> <Location>//tns:docroot/fieldA/text()</Location> <wsag:literal>fixed value</wsag:literal> </Item> <Item> <Location>//tns:docroot/fieldB/text()</Location> <xsd:restriction base="xsd:string"> <xsd:enumeration value="foo"/> <xsd:enumeration value="bar"/> </xsd:restriction> </Item> <Item> <Location>//tns:docroot/fieldC</Location> <xsd:sequence> <xsd:element ref="tns:fieldC" maxOccurs="128"/> </xsd:sequence> </Item> <Item> <Location>//tns:docroot/[fn:namespace-uri()!=http://tns/path]</Location> <xsd:sequence> <xsd:element ref="wsgram:FileStageIn" minOccurs=0 maxOccurs=unbounded/> </xsd:sequence> </Item> </template> Note that the only reason I have to assert a constraint for fieldC is because I am restricting its cardinality. Otherwise, I could leave it off and the consumer of the template would assume the schema definition for tns:docroot is the only constraint, e.g. fieldC would be unbounded or whatever cardinality is given in the schema. karl ** I want to raise the idea that a default value semantics (B) that differs from the domain-specific schema is a confusing topic. Shouldn't a term document have the same meaning everywhere? (Shouldn't the domain schema remain normative for interpreting the absence of content?) If we want to advertise a "default", maybe it should really be a weaker form of constraint which has the meaning "we recommend this value if you don't have any other preference", but it is still the initiators responsibility to fill in some value? -- Karl Czajkowski karlcz@univa.com

Karl, thank you for your specific proposal. This enables some concrete discussion. Overall, I see a trade-off between your proposal (let's call it offer pointer proposal (OPP) ) and the one we came up yesterday (template pointer proposal (TPP) ) are quite similar in expressiveness.The OPP requires a little less specification lines while the TPP is a little easier to implement in a verifier and provide a good aditor. Also, The TPP seems to be a bit more convenient for a mostly static template with fields of moderate complexity while the OFP appears to be easier when a template is very open, with relatively "big" fields in a rudimentary main agreement prototype but insertable content using prototype content in and for the fill-in items. I will detail this in a second. First, i want to raise my only real conceptual concern with the OPP: There is a dependency between items which is a little bit hidden in the XPATHs, which we don't require as location instrument. An item 1 at /a/b/c can only be inserted if /a/b exist. If /a/b is optional, determined by choosing to fill in another item 2, item 1 depends on item 2. This dependency is only understandable by analysing the XPATH expression, which is no tpart of the standard. This is a serioud concern. It could be dealt with by explicitly listing dependencies, but this is additional hastle. My other concerns mostly relate to the pragmatics and my lack of understanding of how to implement this well: - The pointers in the OFP may point to not yet existing locations in the editing process of the templates. XPATHs, if this is the chosen location mechanism (and I guess it will), are not nice to write by hand reliably, really. Ideally, you want to have an editor where you can point to an element and the XPath is returned. Xerces, for example supports this. With OPP pointers the author is probably on its own, as far as I understand the current tooling environment. - For the same reason, the pointers to potential future offer locations, the consistency check of authored templates is more difficult, or at least appears to me so as of now. - The verification of an offer with its constraints appears to become harder. In the TPP approach, all item constraint follow the exact interpretation semantics of the schema, no assumptions. One can verify an items value by taking the XML to which an XPath points, take the XML schema constraint associated with item and match it, e.g., using standard Xerces funtionality. In the OPP case, when verifying an item, one has to look through all items to analyze which contraints or type definitions apply and then merge them with the local constraint to execute the full verification using an XML parser - and hope that they are more consistent. Hence, for evaluating our alternatives, we must take into account the dependency issue as well as the pragmatic concerns that I was raising. An additional decision -criterion is where we see the most probable uses cases: relatively simple fill-in items or items with a lot of compostitional complexity that must be guided. Heiko ---- Heiko Ludwig, Dr. rer. pol. IBM TJ Watson Research Center, PO Box 704, Yorktown, NY, 10598 hludwig@us.ibm.com, tel. +1 914 784 7160, mob. +1 646 675 8469 http://www.research.ibm.com/people/h/hludwig/ Karl Czajkowski <karlcz@univa.com> wrote on 07/20/2005 02:13:50 PM:
Heiko and GRAAP:
I think I have narrowed down my discomfort with the current template proposal... basically, I think we are on the right track with the creation constraints but the prototype aspect is still too biased towards a particular flavor of domain-specific term language that is "flat" and has no variable-cardinality content. Once you start wanting to admit a domain language with optional fields or repeatable fields WITHOUT TOTALLY CONSTRAINING ITS USE, this approach gets in the way.
EVALUATION CRITERIA
We of course need to keep focused on delivering a specification, so I am writing this email with the intent that people can review my suggestions and decide if they make sense and are easy enough to write into the specification without any non-trivial change to the schedule, i.e. Heiko should feel that it isn't more complex or open-ended than his proposal in terms of specification content, and that it also seems beneficial, and others should agree as well. :-)
My concept of an "ideal" template is one that does the following in a very concise manner (in rough order of importance):
1. identify the domain-specific language(s) that are allowed in terms
2. specify the prototype values for terms, e.g. fixed or default** values which are specific to one WS-Agreement service rather than schema-level fixed/default values
3. specify other more general content restrictions, e.g. identify a place where the domain-language has open content and specify a smaller list of recognized extensions that are acceptable
4. related to (1), specify the compositional rules/restrictions for terms in an offer, e.g. the whole "template composition" discussion. this is basically a matter of asserting restrictions to the generic wsag:compositor syntax of the offer.
5. assumes schema-level understanding of the content model in the absence of prototypes and restrictions, i.e. do not require the template to re-state the structural requirements of the domain language if the WS-Agreement service is not trying to restrict it further
In other words, the offer MUST (SHOULD?) conform to the WS-Agreement envelope and domain-specific term schemas, and it also MUST (SHOULD?) conform to the additional prototypes and restrictions of the template!
The current proposal doesn't allow concise mixing of the prototype and restriction mechanisms. You end up having to either generate a large set of creation constraints that express the different parts of the domain schema (redundantly) against a prototype, or you cannot use the prototype feature and you provide one more compact creation constraint.
My view is that the current prototype mechanism is not valuable enough to keep, when a slight modification to the constraint model can cover the case where it is concise (a simple fixed list of values).
ALTERNATE PROPOSAL
Make the entire template a set of constraint rules which have a new "triggering" and "reference" model: they refer to the eventual offer document by XPath instead of the (now non-existent) prototype document. Furthermore, they are softened by default to only apply IF their XPath reference matches content in the prototype. (If they select an empty "nodeset" from the offer, they are ignored by default.) An extra attribute is permitted to override this soft triggering model and REQUIRE that the nodeset references by the Xpath (even if empty) match the constraint's content model.
<Item> <Location required="boolean"?>XPath</Location> ...XSD content model... </Item>
Whatever content in the offer is addressed by /Item/Location must conform to the content model in the rule. The Location is evaluated with the wsag:offer element as the root. This content model can be any of the following to cover our use cases:
1. a literal value or subtree to cover the fixed/prototype case
2. a simple restriction for the old enumeration use case
3. a complex restriction/group for the new structural restriction
4. an attribute group to cover the bases for reasonable XPath references?
There is an implicit rule in every template which could be made explicit without harm:
<Item> <Location required=true>/wsag:AgreementOffer</Location> <xsd:sequence> <xsd:element ref="wsag:AgreementOffer"/> </xsd:sequence> </Item>
Which by itself means that the offer must conform to the WS-Agreement normative schema.
A minimal open-ended template might just want to identify the domain language and a simple compositor structure without making additional restrictions:
<Item> <Location required=true> /wsag:AgreementOffer/wsag:Terms/wsag:All/* </Location> <xsd:sequence> <xsd:element ref="wsag:ServiceDescriptionTerm"/> </xsd:sequence> </Item> <Item> <Location>//wsag:ServiceDescriptionTerm/*</Location> <xsd:sequence> <xsd:element ref="tns:docroot"/> </xsd:sequence> </Item>
The first rule says that the offer must have the very simple form of an All compositor with one child element ServiceDescriptionTerm... the number of children could be opened up with cardinality attributes in the sequence definition of the rule. Alternatively, someone could write a rule with Location /wsag:AgreementOffer and then provide more inline typing to give a restriction of it?
The second rule says that the (any) service description term must have the tns:docroot domain-specific element in it. A benefit of this approach for complex domain languages is that the variable structure of the domain language is preserved with all its flexibility UNLESS the template lists constraints against the structure.
Someone more familiar with XPath and/or XSD may be able to show a more compact way to write both of these conditions into one rule.
To do the fixed value fieldA from Heiko's email:
<Item> <Location>//tns:docroot/fieldA/text()</Location> <wsag:literal>fixed value</wsag:literal> </Item>
i.e. we define one "literal" content model to handle the prototype cases concisely. (Is there an XSD feature that works as well? The most concise I can think of is a one-element enumeration restriction...)
These rules can be overlapping at different depths in the tree, so that the "top-level" rules fix the superstructure with brief ref=elementname descriptions of structure, implying that the general purpose elementname schema is acceptable, while later rules further restrict the use of that schema by referencing substructures in the descendents of elementname.
Thus, I hope I have demonstrated that this approach is just as expressive in terms of conveying information about offer requirements to the human. I do not think we have use-cases in mind yet where we can evaluate the automatic consumption of templates by schema-aware software. :-( I think this is more general and consistent w/ the nodeset/infoset model of XPath selection, e.g. rules select parts of the offer and define schematic requirements on those selected parts.
EXAMPLE
Here is the concrete example w/ the same implied offer content as Heiko's email example, e.g. I've left out the same contextual bits as were left out in his!
<template> <Item> <Location required=true>//wsag:ServiceDescriptionTerm/*</Location> <xsd:sequence> <xsd:element ref="tns:docroot"/> </xsd:sequence> </Item>
<Item> <Location>//tns:docroot/fieldA/text()</Location> <wsag:literal>fixed value</wsag:literal> </Item>
<Item> <Location>//tns:docroot/fieldB/text()</Location> <xsd:restriction base="xsd:string"> <xsd:enumeration value="foo"/> <xsd:enumeration value="bar"/> </xsd:restriction> </Item>
<Item> <Location>//tns:docroot/fieldC</Location> <xsd:sequence> <xsd:element ref="tns:fieldC" maxOccurs="128"/> </xsd:sequence> </Item>
<Item> <Location>//tns:docroot/[fn:namespace-uri()!=http://tns/path]</Location> <xsd:sequence> <xsd:element ref="wsgram:FileStageIn" minOccurs=0 maxOccurs=unbounded/> </xsd:sequence> </Item> </template>
Note that the only reason I have to assert a constraint for fieldC is because I am restricting its cardinality. Otherwise, I could leave it off and the consumer of the template would assume the schema definition for tns:docroot is the only constraint, e.g. fieldC would be unbounded or whatever cardinality is given in the schema.
karl
** I want to raise the idea that a default value semantics (B) that differs from the domain-specific schema is a confusing topic. Shouldn't a term document have the same meaning everywhere? (Shouldn't the domain schema remain normative for interpreting the absence of content?) If we want to advertise a "default", maybe it should really be a weaker form of constraint which has the meaning "we recommend this value if you don't have any other preference", but it is still the initiators responsibility to fill in some value?
-- Karl Czajkowski karlcz@univa.com

On Jul 21, Heiko Ludwig modulated: ...
First, i want to raise my only real conceptual concern with the OPP: There is a dependency between items which is a little bit hidden in the XPATHs, which we don't require as location instrument. An item 1 at /a/ b/c can only be inserted if /a/b exist. If /a/b is optional, determined by choosing to fill in another item 2, item 1 depends on item 2. This dependency is only understandable by analysing the XPATH expression, which is no tpart of the standard. This is a serioud concern. It could be dealt with by explicitly listing dependencies, but this is additional hastle.
Yes, there is clearly a lot of modeling decisions for the template creator which can make the template more or less readable and informative for understanding the acceptable offer space. However, I think that is really true with the TPP approach too, e.g. deciding what to put in the prototype and what to put in the constraint schema. In either case, I think there is a possibly tricky inference step to determine from a template what kind of offer to produce, though I think both cases are relatively straightforward to validate offers after the fact. (More below.) I suspect that in practice, other abastract, domain-specific resource properties will help guide this process so that the template is understood within a context and need only be consulted for its "restrictions" rather than for ultimate guidance on "what are the agreements all about?"
My other concerns mostly relate to the pragmatics and my lack of understanding of how to implement this well:
- The pointers in the OFP may point to not yet existing locations in the editing process of the templates. XPATHs, if this is the chosen location mechanism (and I guess it will), are not nice to write by hand reliably, really. Ideally, you want to have an editor where you can point to an element and the XPath is returned. Xerces, for example supports this. With OPP pointers the author is probably on its own, as far as I understand the current tooling environment.
However, we know that the TPP format really only works for flat/simple domain languages (because once it gets non-flat and non-simple, you end up having to cram all the information into the constraint(s) rather than the prototype). I would argue that in the flat/simple language use case, it is not actually that difficult to generate the XPath expressions by hand. So, you don't really get any major benefit from editor-generated XPath expressions in either case! :-) So yes, definitely XPath can be tricky but I hope you see value in allowing its use for those cases where it can be expressive in moderation. Unless I am confused, I think the OPP approach still allows the more "conservative" granularity of the TPP where only a few relatively deterministic Locations are used and the constraints are more complete document elements, e.g. one constraint can act as the "prototype" though it is in schema format instead of doc format. Additionally, I guess we could add a special "prototype" constraint, akin to the "literal" part of the proposal, as long as we can come up with the right validation rules? (Do we need to have a prototype that gives positive restrictions, like "this element, if it appears, has to have this value", from negative restrictions like, "only these elements are allowed".) The downside would be that this is basically adding more WS-Agreement specific content modeling, for what is arguably syntactic sugar of equivalently expressive XSD.
- For the same reason, the pointers to potential future offer locations, the consistency check of authored templates is more difficult, or at least appears to me so as of now.
- The verification of an offer with its constraints appears to become harder. In the TPP approach, all item constraint follow the exact interpretation semantics of the schema, no assumptions. One can verify an items value by taking the XML to which an XPath points, take the XML schema constraint associated with item and match it, e.g., using standard Xerces funtionality. In the OPP case, when verifying an item, one has to look through all items to analyze which contraints or type definitions apply and then merge them with the local constraint to execute the full verification using an XML parser - and hope that they are more consistent.
I think the verification of an offer is straightforward as a multi-step process for OPP: 1. validate offer using WS-Agreement normative schema and the domain-specific schema (assuming the infrastructure can do type validation of open-content elements) 2. for each Item, do: find xpath selection using Item/Location against offer doc if selection nodeset is non-empty OR Item/Location/@required=true then validate nodeset using Item/child[2] content model endif The validation stops on the first validation sub-step that fails. Of course, the validate routine in step (2) has to handle our special forms e.g. wsag:literal or wsag:prototype if we support them, while calling the XSD-aware libraries to handle the XSD schematic fragments. I assume the process would have to be similar to validate the TPP constraints? Or, do you see a way to merge the constraints into a new schema that is used to validate in one pass? It seems you either need to generate a schema transliteration of the prototype as a restriction of the base type, or do some other structural unification of offer and prototype to make sure there is nothing "deviating" (either extra or missing) in the offer that is not allowed by a constraint. In either case, it seems a robust implementation should do the step (1) of validating using the unconstrained WS-Agreement and domain-specific schemas to make sure we are only processing restrictions and not some other strange dialect...
Hence, for evaluating our alternatives, we must take into account the dependency issue as well as the pragmatic concerns that I was raising. An additional decision -criterion is where we see the most probable uses cases: relatively simple fill-in items or items with a lot of compostitional complexity that must be guided.
Heiko
Do you see the value of the prototype as a convenience for authoring templates for for consuming them? I am wondering if it would help to discuss a "template authoring strategy" where a prototype can be automagically converted into OPP form? (not that I already have one handy) I also have to admit one hesitation I have to all of this if you want to talk pragmatics: I don't really know how this simple concept of "restricting" an open standard schema like WS-Agreement and/or domain languages works in practice with tools. It means we are basically defining alternative type and element definitions for things in standard namespaces! Superficially, this sort of thing seems like it would be frowned upon, since the standard QNames are supposed to be "write once" and by a different authority to boot! I think this is an area where experimentation will have to be done, because clearly these sorts of restricting profiles are critical to the notion of Grid interop... karl -- Karl Czajkowski karlcz@univa.com
participants (2)
-
Heiko Ludwig
-
Karl Czajkowski