[dsdl-discuss] Suggestion for adding properties to Schematron

From: Rick Jelliffe <rjelliffe@allette.com.au>
Date: Sat Jan 06 2007 - 01:52:51 UTC

I think there would be good value in adding a property element to
Schematron (and perhaps to have it available in all DSDL parts.)

<pattern ...>
   <rule context="name">
      <property name="sch:type" value="xs:NMTOKEN" />
      <assert test=" ... ">
      ...

So a rule could have zero or more property elements. The property elements
would be basically name/value pairs. The properties would be properties of
the concat( parent::sch:rule/@context, parent::sch:rule/@subject) node(s).

Such a mechanism would increase the declarative power of Schematron, in
particular to allow

 * Connection to DTTL and XSD types. XForms does this already, so it is a
proven system.

 * A better way to include integrity constraints (we took out sch:key and
made it xslt:key because it introduced an implementation dependency, but
I was never really happy with it

 * A way to allow more business rules and declarative information, and to
allow smarter interfaces. I am also interested in systems that convert
from grammars to Schematron, and I think it would be good to be able to
round-trip more information in the Schematron schema, such as keeping the
initial content model.

 * A potential way to tie to data models (e.g. an ER diagram) better.

My motivating need for this is a collaborative business rules development
system (web based) that a client is discussing. It would be really useful
to have these kinds of properties, because they want to be able to add
more metadata.

An abstract rule could be made which just contained properties, allowing
them to be bundled and named.

What about contention? I.e. where a node is assigned a property from one
pattern and then a contradictory property or value from another patterns?
I would overcome this merely by saying that the property is not a property
of the node itself, but a property of the node in a particular pattern and
a particular rule. So a property instance is a quintet
   [ name, value, node, pattern, rule]
and it is up to the application to sort out the difference. (At the
simplest, people can just put all their type properties into a single
pattern.)

Should there be a facet style mechanism, for parameters and facets?
   <property name="sch:type" value="xs:NMTOKEN">
      <facet name="maxLength" value="23" />
      ...
   </property>
If so, what should it be called? facet? arg? param?

This still avoids class-based modeling, because while one abstract rule
can include another, there is no sub/superclass relation between the
abstract rules (they are "mix-in" inheritance, if you like.)

Open Questions w.r.t. ISO DSDL
-------------------------------

Should this be in the Schematron namespace, or is it a general enough
feature that other parts of DSDL can use it? I.e. is this a new annex, a
new content model, a TR or a new part? I think it might be neater to
contain it to just Schematron, and any other editor who wanted it can
clone it into their namespace.

Is this (schematron+property+some conventions) powerful enough to be used
as DSDL part 6 Path-based integrity constraints? I suspect not.

Feedback welcome
Rick Jelliffe

--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Sat Jan 6 06:43:21 2007

This archive was generated by hypermail 2.1.8 : Sat Jan 06 2007 - 11:03:03 UTC