Re: What is an RDF Query?

>On Mon, Sep 17, 2001 at 10:54:13AM -0500, Pat Hayes wrote:
>>  >From: "Eric Prud'hommeaux" <eric@w3.org>
>>  >Subject: Re: What is an RDF Query?
>>  >Date: Fri, 14 Sep 2001 10:55:09 -0400
>  > >
>>  >>  Thanks for the clarification. I propose that we use a term for the
>>  >>  antecedent tthat is NOT "assertion". Furthur, I propose that this term
>>  >>  either be "query" or that the definition express the commonality with
>>  >>  queries.
>>  >
>>  >I propose that we do not do this.  I oppose calling the antecedant of a
>>  >rule anything other than the antecedant of a rule!  In particular, I
>>  >strongly oppose calling it a query, as there have been arguments that
>>  >the antecedant of a rule is not the same as a query.
>>
>>  I agree. Also, this proposed terminology embodies a confusion between
>>  the idea of a syntactic part (of a rule) on the one hand, and a
>>  propositional attitude (of being asserted or queried) on the other.
>>  The point is that the *very same* expression can be both asserted and
>>  queried; being an assertion or a query are not syntactic categories.
>>
>>  We already have a well-established and widely understood terminology
>>  for talking about rules. Let's stick to it and avoid creating
>>  confusion where none exists. Rules have antecedents and consequents,
>>  and are often (though not always) understood to have the logical
>>  force of implications, ie when asserted, they say that the
>>  antecedents entail the (disjunction of the) consequent(s). (In
>>  another sense of 'rule' they have no particular logical force, but
>>  are simply thought of as process specifications, like productions in
>>  a production system. Often, people switch back and forth between the
>>  'logical' and 'processing' ways of thinking, but the
>>  antecedent/consequent terminology works in both cases.)
>>
>>  The term 'query' has several meanings as well. If we are thinking
>>  logically, then an expression is a query just by virtue of being
>>  posed as a goal to be proved; its not a syntactic matter so much as a
>>  matter of pragmatics, so of course there is a "commonality" between
>>  queries and consequents (not antecedents), i.e. they are the same
>>  kinds of expressions; they can be unified by variable matching.
>>  (Though even there one has to keep the assertion/querying distinction
>>  clear since the same variables are treated differently in the two
>>  cases.) But 'query' is also used in a broader sense to mean something
>>  more complicated, a kind of description or specification of the data
>>  that is being requested, and may require more complicated kinds of
>>  processing than simply checking logical consequence. In this case it
>>  isn't so clear that there is any straightforward commonality between
>>  the query language and any part of the rule syntax.
>
>I agree with the ambiguity of "query". In fact, I poked fun at it:
>  >I think the reason it is/could be useful is that the query part of
>  >rules can be expressed in the same language as the query part of
>  >queries (which would be the greater part).
>
>Antecedent is a specialized term in logic that has more of an ordering
>implication to query and lay people as they (unclear antecedent?) are
>likely to fall back on the dictionary definition.

Why would anyone look in a dictionary for a technical meaning? (What 
if I had gone to Chambers to find out what the W3C meant by 
"resource"  or "indicator" ?)

(BTW, I find the assumption that 'lay people' know nothing about 
logic but everything about, say, Java programming or XML 
serialization, rather strange.  If we were talking about the Craig 
interpolation lemma, OK; but the notion of an 'antecedent' is going 
to give people nightmares?)

But OK, OK, lets avoid anything that might frighten the horses. Sigh.

>Perhaps both rule
>antecedent and query selector could be described in terms of a
>"pattern":

Maybe, though thats a very general-pupose word to use for such a 
special purpose. Better to use an obviously metaphoric word, eg see 
below.

>
>rule    ::= pattern assertion*
>query   ::= pattern [more crap]
>pattern ::= pTriple+
>pTriple :   some grouping of symbols in predicate, subject and object
>	    positions where each symbol may be a "variable"

Lets try to keep all words that assume any particular *role* out of 
the description of the *syntax*. That includes 'query', 'assertion', 
'goal', etc. .

Here's a neutral terminology that I learned from Stefan Decker:

atom ::= whatever is the 'atomic' kind of assertion form, but with 
variables (RDF triple, eg)
molecule ::= atom+ (basic propositional form; think of an RDF graph)
body ::= {molecule;}* (these are like a disjunction)
head ::= molecule
rule ::= body |- head

(or use => or something; though XML has kind of used up the ascii 
arrow marks, unfortunately.) (In fact you don't strictly need the 
molecules, but it makes for more compact rules in an RDF-like context 
since you can bundle a whole RDF graph into one 'assertion'.)

I'm presuming that we need some way to differentiate between the 
parts of the rule that are supposed to entail, or be invoked by, the 
other part, hence the head/tail distinction.  This assumes a 
'uniform' kind of rule, but you could alter the head/body syntaxes if 
you wanted to have different assertion/querying syntax. Better make 
sure they use the same kind of variables, though.

This allows assertion to be a rule with an empty body. A query could 
be a rule with an empty head, which has a kind of poetic quality. But 
notice that its not the body of the empty-headed rule that is the 
query, but the beheaded rule itself, eg (using this together with 
N-triples)
foo baz _:x .  ; |-
is a query, but just plain
foo baz _:x .
isn't either a query or a rule, its just a piece of RDF. It only gets 
to be asserted or queried or whatever when you put it into a rule (or 
query) somehow. It you write the *same* RDF in a different place in a 
rule, it might not be a query, eg
|- foo baz _:x .


>RDQL would have a pattern made of the WHERE and AND clauses:
>	WHERE  (?b, <rs:type>, <rs:Bag>), (?b, ?x, ?y)
>	AND    ! ( ?x eq <rs:type> && ?y eq <rs:Bag> )
>and algae's [1] would be make from the "ask" clause:
>	ask '((http://...#type ?annot http://...#Annotation)
>	      (http://...#Author ?annot "Joe")
>	      (http://...#Annotates ?annot ?doc))
>The RDQL above would be turned into a query with a SELECT:
>	SELECT ?b, ?y
>and the algae above would be turned into a query with a "collect":
>	collect '(?annot ?doc)
>or a rule with an "assert":
>	assert '((http://...#Annotator ?doc "Joe")
>or a more complex rule with created (anonymous) nodes:
>	assert '((http://...#Annotator ?doc ?#genidFoo)
>		(http://...#name ?genidFoo "Joe"))
>
>More pedantic issues:
>
>  Would an antecedent be different from a pattern (in these examples or
>  elsewhere)?

Category error, seems to me. Of course an antecedent is a pattern, 
but then so is almost everything else.

>  Would a query constraint be different from a pattern?

What is a query constraint ?

>
>  Are any of these terms universal enough to be use by both communities
>  on this list?
>
>  Perhaps "form" would be better than "pattern" - from wordmsyth [3]:
>	"structure or shape, as opposed to substance"
>
>I'm not trying to be a winer,

My dear fellow, you can be a winer all you like. I'm more of a 
single-malt Scotch man myself, but its not for me to make comments on 
other people's drinking habits.

Pat Hayes


-- 
---------------------------------------------------------------------
IHMC					(850)434 8903   home
40 South Alcaniz St.			(850)202 4416   office
Pensacola,  FL 32501			(850)202 4440   fax
phayes@ai.uwf.edu 
http://www.coginst.uwf.edu/~phayes

Received on Wednesday, 19 September 2001 12:33:42 UTC