| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: XQuery question
>> The fact that is declarative is obvious, and if you want me to explain >> that yo you, I'm at a loss. Either get over it, or else stop the >> discussion.
Yep, I didn't claim that SQL is perfectly designed either, still the WITH RECURSIVE expressions are not *that* difficult to grasp.
>
> The "either get over it, or else stop discussion" is the argument of the
> weak who is not able to support his point differently.
>
Or is the argument of either the puzzled or the bored.
>>> Whether XQuery is relationally complete or not is of no relevance, >>> since it is not intended to be so, as the underlying data is not >>> relational, it is tree-shaped. >>> >> >> That's non-sense. Data is data. It comes from the plural of the latin >> "datum" which means a "given", therefore data is a collection of (given) >> facts . "Given facts" are proposition that are true. Relational >> databases hold a collection of facts and those have no "relational" >> shape. That's just non-sense good only for marketing brochures.
When you bind the variables (free terms) of a predicate you get a proposition. Let's stop quibbling over terms. Let me reiterate again, the predicate correspond to the "header" (by Date's terminology)/schema of a relation. Each individual tuple is a proposition.
And I think you are definitely wrong here: the values in the columns can be as complex as you like. Relational model can't care less of what kind of domains you use for the columns.
>> >> >> If you're willing to show me a useful "tree-shaped" logic, I'd be very >> curious to find out more about that.
Well, for what is worth I don't see how you express the above in XML either, although you can express that in standard SQL 99 as a constraint to be verified against data rather than data. I know how to express that in Prolog, however efforts to make the DBMSes a general purpose inference engine either failed or went out of steam (funding ?).
>> You are confused. Graphs and relations are almost indistigusihable from >> a logical point of view. A tree is a binary relation with certain >> properties.
Wait a second doc. A graph (directed and simple which is what most people use for practical purposes, but other cases can be ahndled relationally as well) is the pair G=(V, E) with E <= VxV, since V is already implied by E we can cut out the redundancy and just say E <= VxV which is a binary relation.
I don't know for the life of me what you mean by the "shape" of the graph. If you mean the picture you draw on a paper, only *that* is at a different level of abstraction.
I don't want to operate on the "picture" or the "shape" or the physical encoding, I want to operate as much as possible close to the mathematical definition of a mathematical concept.
>
> Relational databases are very declarative for *certain* kinds of data,
> i.e. such data that is inherently relational (addressbooks, booking
> system). On the other hand, while you are still able to represent
> graph-structured data in a relational database, this representation is
> always very "inconvenient" (if you like that better than
> "undeclarative") to use since the represented data is not immediately
> obvious.
>
I find this assertion gratuituous. Let me reiterate, I can logically equate a graph with a binary relation - it is most definitely not an encoding/translation kind of thingie. Using relations I can also represent graphs which allow several edges between 2 nodes, and I can also represent hypergraphs.
Just show me how you do that "conveniently", "intuitively" and declaratively with your imbricated pairs of tags !
>> >> In any case people when you say XML think about the <xml> </xml> data >> encoding no matter what you'd like them to think. >>
Well, maybe you have a paper or present here a brief summary so that I can "get" it what you mean by "XML data model".
>> Your opinion does not count as long as it is not backed by arguments.
When solving the same use case takes a handful of lines of code using relational algebra extended with transitive closure, while it may take screens of code using XQuery / XPATH / DOM API/ SAX APi whatever, that's where I can justifiably say that XML as a data model is unintuitive to unworkable.
>>> As for unnecessary complexity, I'd like again to refer to your SQL >>> example above. >>> >> >> For which you haven't provide a counter example. Show me a general >> transitive closure (not just recursive descent down the bracnches of a >> tree) over a binary relation and let's talk after that.
No, that's just implementation details. Transitive closure is a concept with a very simple definition which I already posted in this thread. As far as I have been tought defining concepts in terms of how you compute them is not the best way to do mathematics, and definitely it is not the declarative way that you claim.
Delarative means the "what" not the "how". The standard definiton of transitive closure is the what it is not the "how you calculate it", I refer you to any elementary introduction to algebra.
> It's just a matter of how I encode the graph. Your example
> XML document is not the appropriate representation of graph structures
> in a graph language, it is trying to "port" the insufficiencies of
> relational databases to XML. In XML, I don't need to encode the graph as
> binary relation, I can encode it as graph (under the assumption of a
> reasonable link mechanism).
>
Just post here a better encoding for a graph, together with the query. You're not going to kid me that trees are a good encoding for a graph while relations are not. The fact that you refuse to post anything at all concrete and come up with excuses is kind of telling, don't you think ?
>> And you also refuse to address the issue whether XQuery is relationally >> complete and at what cost (viz. query complexity, and runtime >> performance).
Maybe you can speculate on the utility of relational algebra (plus the transitive closure) in solving real use cases for real users. If your data model is going to support those use cases than it automatically means that it will be relationally complete. Or else, you can speculate what relational operators are unuseful and we don't need to support them.
I thought it was elementary that any new data model/query language proposal ought to be reltaionally complete (and in auseful sense of the word, not in the sense that for example "COBOL is turing complete").
Or if you want to set aside let's say relational division, you ought to justify why you want to do that. Don't you agree ?
> - I never claimed that XQuery was relationally complete
> - nor is it relevant, because XML is not relational (as I already
> stated), instead it is a set of
> terms
> - nor do I particularly like XQuery; in fact I am working on *replacing*
> XQuery with something
> better
>
> As to cost:
> - XQuery is merely a language specification which says nothing about
> implementation. There are
> very inefficient implementations, and also some which are better
> - XQuery and XML Querying is a very new issue, so optimization is
> currently just beginning to
> become an issue
> - XQuery, as a rather control-flow oriented language, does not leave
> much room for automatic
> query optimization (which is why we are working on a different language)
>
> 7
> I repeat it, I am NOT claiming that XQuery is good. I am claiming that
> an inherently tree or graph-shaped data representation language is often
> superior to flat relational tuples.
If you said "sometimes superior", I might give you a pass. And second, you have to come first with those data models so that we have something we can talk about and compare.
> I do NOT say that XML is a
> particularly good representation for tree- or graph-shaped data (Lisp
> S-expressions would achieve the same). However, XML is well
> standardized, it has a broad community and despite its deficiencies
> (like DTD, processing instructions, unfortunate link mechanisms, etc) is
> a reasonably good representation for such data.
>
Sure, COBOL was standardizzed and had a broad user community, it was the kid on the block in its days. CORBA was the same, what else ?
In the end all you have is vague promises , you have no coherent data model to show for it. And when pressed for concrete examples you back away saying that when you will have such and such.
The thread was about XQuery and XML in particular not about what's your dream data model.
>> This leaves you currently quite short of any serious arguments other >> than hand waving.
It's not an argument I express what I see, and it is a value judgement with regards to your contribution to this thread.
If you have a better data model proposed somewhere, I'll be happy to learn about. Otherwise just claiming that relational model is not good at representing graphs is hand waving to me (ok, it may be to you a subjective interpretation of "intuitivity" or other ethereal properties).
Best regards,
Costin
Received on Thu May 15 2003 - 14:11:05 CDT
![]() |
![]() |