Is XPATH the way to search a data model?
Matthew Graham
mjg at cacr.caltech.edu
Tue May 18 09:52:49 PDT 2004
> > >
> > > 2) Can it have astronomical knowledge built into it, or is it just a
> > > sort of dumb regexp system for structured text? What I mean is, if for
> > > instance you searched a StandardQuantity for a Frame (Frame "A") holding
> > > the 3 axes:
> > >
> > > (heliocentric radio velocity, ICRS RA, ICRS Dec)
> > >
> > > could XPATH do anything sensible if the StdQ did not contain this exact
> > > Frame, but instead contained a Frame (Frame "B") containing the 3 axes:
> > >
> > > (Galactic longitude, geocentric frequency, galactic latitude)
> >
> > Yes, you can limit the match based on the child node, e.g. your XPath
> > might look like:
> >
> > //standardQ[CoordQuantity/axes/helioRadioVelocity]
> >
> > will only grab the standardQ with a heliocentric radio velocity axis. To do this
> > search "right" XQuery is called for, e.g.
> >
> > for $quantity in //standardQuantity
> > where //$quantity[CoordQuantity/axes/helioRadioVelocity]
> > and //$quantity[CoordQuantity/axes/RA]
> > and //$quantity[CoordQuantity/axes/DE]
> > return $quantity
> >
> > would only return quantities that *had* heliocentric radio velocity, ICRS RA, ICRS Dec
> > in the frame, and all other quantities would be ignored.
>
> > If you need to process equivalent frames (e.g. axes are different,
> > but could be converted via a mapping), you can select those and
> > pass them off to an application...
>
> So your answer seems to be no - xpath/xquery cannot do intelligent
> searching of the type I described, in that you need to use some other
> application. In the above you say "you can select those..." - but how
> would this selection be done - who would do it (i.e. who is the "you" in
> your text)? Tell me where you would put the intelligence which allows the
> data model searching system to realise that Frame A can be derived from
> Frame B and which allows the Mapping between them to be constructed.
XQuery is actually a fully-functional language and you can implement your
own functions in it so if you wanted this type of "intelligent" search
then you could just code it up and use that.
Cheers,
Matthew
More information about the dm
mailing list