Re: What is an RDF Query?

>On Wed, Sep 12, 2001 at 10:40:56AM +0100, David Allsopp wrote:
>>
>>
>>  pat hayes wrote:
>>
>>  > OK, I took a look at 
>>http://lists.w3.org/Archives/Public/www-rdf-rules/#terms
>>  > and found this:
>>  > ----
>>  > rule
>>  >         Expression of query and assertion that causes the automatic
>>  > insertion of asserted statements wherever the query is matched.
>>  > -----
>>  > which may help to explain the (my) confusion. This notion of 'rule'
>>  > doesn't make sense to me. Why would matching a *query* produce the
>>  > insertion of *statements*?
>
>Be they in the original dataset or in temporary database from which
>the query response is culled, the consequence of a rule must be noted
>in order to be useful. I called that operation "inserting", perhaps
>wrongly (or incoherently).

NO, that's OK. The part I'm having trouble with here is why the 
initial trigger was called a *query* instead of an *assertion*. If I 
assert P and I know that (P implies Q) then its obviously correct to 
infer Q and assert it. But even if I know that (P implies Q), I'm not 
entitled to infer Q from P's being *queried*. If I know that men are 
mammals, and someone *asks* me if Joe is a man, I shouldn't conclude 
that Joe is a mammal. Maybe the answer to the question was 'No, Joe 
is a parrot'

>By the terms I used,
>   if P then Q
>can be described as a rule made of a query P and an assertion Q.

So you are using the term 'query' to indicate the antecedent of a 
rule, ie as a syntactic category in the rule language syntax, is that 
right? That is likely to create a lot of misunderstanding, I would 
suggest.


>
>>                               If we were to use a rule (in the usual
>>  > sense, now, not Eric's) in forward inference, then it would match an
>>  > assertion and produce a new assertion (as in inferring Q from P and
>>  > (if P then Q) ) , and if we are using it in backwards mode then it
>>  > would match a query and produce a new query (as in  going from ?Q and
>>  > (if P then Q) to ?P). These are really the 'same' inference,
>>  > logically speaking - modus ponens - but done in different
>>  > 'directions'. But I can't think of any way to take a rule, match it
>>  > to a query, and get an assertion.
>
>In my terms, that would be
>   (query1 + assertion1) + query2 => assertion2.
>   |------ rule1 ------|  |------ rule2 -------|

?? That doesn't seem to make sense. Can you explain how this applies 
to the example? There are only two propositional expressions: P and 
Q, and one rule ( P => Q ). Which of these is 'query1', etc.?

>
>I agree, I don't see this as useful except in doing rules about rules
>which would be used proof checking or other mechanisms to control the
>behaviour of an inferencing engine. Even there, I don't believe that
>rule1 is treated like a rule, ie. evaluated, so much as considered as
>a set of statements in matching query2.
>
>>  No, nobody's saying one should match a _rule_ against a _query_, I
>>  think.
>>
>>  As Pat says, the antecedent of a rule matches assertions. I think some
>>  people regard the antecedent as a query over the fact base ("Is this
>>  assertion in the fact base? If so, assert the consequent").
>
>I meant the query and assertion to be tied together. I state a rule in
>terms of a query and set of assertions.
>
>Looking for queries to match rules, as alluded to above, seems like a
>way one would optimize a backward chaining query to limit the working
>set:
>   dataset has a statements and two rules:
>     P
>     if P then Q
>     if Q then R
>   but has not done forward chaining. The query
>     R?
>   causes the inferencer to look for R in the dataset. The only
>   candidate is the rule "if Q then R" so it looks for Q in the
>   dataset etc.

The important point is that a query *must* involve backward 
reasoning. It isn't valid to reason forward from a query. (Of course, 
you can try answering the query by reasoning forwards, but then you 
are reasoning forward from assertions, not queries, in the hope of 
finding an answer. )

>I would say this is a perfectly reasonable strategy, but I was only
>trying to characterize those rules "if P then Q" and "if Q then R"
>in terms that would elucidate the parallels between "if P", "if Q"
>and "R?".
>
>>  In implementation terms, the antecedent may literally involve a query,
>>  because to match it against an assertion one has to extract assertions
>>  from a fact base (i.e. query a database looking for matching
>>  assertions). One might then speak of "matching the query" i.e.
>>  succeeding in matching the rule's antecedent with an assertion.  I think
>>  this is common (though clearly confusing) usage...

I hope it's not common, as it certainly is confusing. Its like 
calling the handle of hammer the "head" because it's the part you 
hold onto when you hit nails with the head.
Look, consider the simple rule (if P then Q) again. Sure, its the 
case that *if* you start with a query of Q, then this rule can 
generate a query of P, so you might call the P in the rule the 
'query-ish' part. But if you use the same rule with an assertion of P 
(not a query) then it will generate an assertion of Q. In the latter 
case, there aren't any queries involved at all.

>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).

The terminology is coming apart at the seams. What are 'the query 
part of queries'? (More to the point, what part of the queries is NOT 
the query part?) Query is not a syntactic category, it is a 
propositional attitude. The very same expression can be asserted or 
queried (or doubted, or questioned, or...).

>
>>  Perhaps the confusion lies in "query" as an expression (where some
>>  syntax, such as a question mark, indicates a question), and "query" as a
>>  implicit process, where assertions are compared.
>
>Is there a difference beyond the expectation of what to do with the
>results?

Yes.

Pat

-- 
---------------------------------------------------------------------
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 Monday, 17 September 2001 11:52:27 UTC