[
Lists Home |
Date Index |
Thread Index
]
A type system to a data model is a fundamental piece used to validate
when
the data is stored in the system that implements the datamodel AND when
the data
is manipulated using a syntax (some access language). This is the
principle on which
SQL is built and so is XQuery. It could be arguable, not good though,
whether to make
the type system part of the data model or of the language. We could even
have everything
as a BLOB or as strings and then associate type system at runtime. I am
not sure this is
what we want to do though.
Looking at validation issues:
1. When storing, it can be stored as anything. Just seqeunce of bytes or
binding the
datamodel types to the language the system is built in and then storing
it. The
step of validation may be optional here, so as to push the validation to
that stage when
the data is being accessed or updated. If I can grasp the discussion
here, this is porbably
the point Dare is making. The application level validation would be
necessary when types are
converted from one to another E.g. ODBC/JDBC drivers.
2. When accessing, the data will have to be validated when tied with a
type system according
to the definition of the type system. Now here, the implemetation will
have to take care of
the type system conformance, if it is not being done when the data was
stored originally.
I do not think this is a good idea. Imagine a database that stores
everything as strings and
then publishes the associated type system (one or more) and then leaves
it to the application
to validate the data according to the type system. I think this is the
second point that Dare
is trying to make when he says that XQuery could leave the type system
(specifically schema)
flexible to associate. But does this really make sense?
3. When updating the data, the values being updated may skip the type
validation, if the storage
does not enforce type checking when storing the data. But, to reflect
the right semantics of
the update operation, *someone* will have to do that. It will either be
the database system or
the application. But again, which is better? To allow the update to
happen (or defer), and then
check whether it is valid, or to check beforehand (by using a type
system associated with the data model)
and decide whether to update or not, or to report error?
The basic assumption here is that XQuery is a language for systems that
would store XML (relational/native)
and so knowledge of the associated type system matters.
-ranjeet
Imagine how much we could achieve if we do not care who gets the credit.
> -----Original Message-----
> From: Dare Obasanjo [mailto:dareo@microsoft.com]
> Sent: Tuesday, May 07, 2002 11:03 AM
> To: Jonathan Robie; xml-dev@lists.xml.org
> Subject: RE: [xml-dev] XQuery types was Re: [xml-dev] Yet another plea
> for XUpdate...
>
>
> I don't understand why you continue to miss my point. My
> original assertion which started this thread was that the
> XQuery WG was and is incorrect in stating that a static type
> system is necessary to add DML semantics to XQuery. The fact
> of the matter is that regardless of all the complexity you
> place on implementors (which will probably lead to a "Can
> anybody implement XQuery?" thread on XML-DEV in 12 months)
> the fact of the matter is that DML will still require
> post-update validation in a wide range of cases.
>
> Secondly, if XQuery wasn't so wedded to W3C XML Schema, the
> W3C wouldn't be forcing users of XQuery to also become users
> of W3C XML Schema but instead would allow them to use
> whatever XML schema technology they liked including DTDs and
> RELAX NG.
>
> -----Original Message-----
> From: Jonathan Robie
> [mailto:jonathan.robie@datadirect-technologies.com]
> Sent: Tue 5/7/2002 7:45 AM
> To: xml-dev@lists.xml.org
> Cc:
> Subject: RE: [xml-dev] XQuery types was Re: [xml-dev]
> Yet another plea for XUpdate...
>
>
>
> At 09:02 PM 5/6/2002 -0700, Dare Obasanjo wrote:
> >Please prove this assertion untrue. XML type systems
> (especially with
> >W3C XML Schema) are based on constraints. Constraints
> are runtime
> >issues. Queries like
> >
> >UPDATE
> > INSERT /person[@age] - 10 INTO /person/@age
> >
> >where the age attribute is a simpleType restriction of
> >xs:positiveInteger with minInclusive = 18 and
> maxInclusive = 44 cannot
> >be verified at compile time no matter how fancy your
> heuristics are.
>
> But the fact that there are errors you can't catch
> until runtime does not
> imply that you shouldn't catch other errors before
> running a program.
>
> Jonathan
>
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>
>
>
>
|