Re: Expressiveness of RDF as Rule Conclusion Language (was Re: W hat is an RDF Query? )

>  >    [me]
>>     >I can think of two
>>     >responses:
>>     >
>>     >a) Don't require it to be a legal RDF graph.  Make it an "RDF graph
>>     >schema," that is, something containing variables that becomes an RDF
>>     >graph when nodes are substituted for the variables.
>>
>>     [Pat Hayes]
>>     That *is* a legal RDF graph. RDF graphs have blank nodes which have
>>     exactly the semantics of existential variables.
>>
>>     [me]
>>     [This idea] leave[s] the variables without explicit scope, as in
>>     >Prolog.  If you want explicit scope, things get more interesting.
>>
>>     True; the implied scope is the graph. This makes things much easier.
>>
>>  Okay, if you change Sandro's "document scope" to "graph scope," you're
>>  right.  But then a rule like
>>
>>   (R1 ?x ?y) |-   (R2 ?y ?x)
>>
>>  becomes unstatable, because the ?x and ?y in the graph on the left are
>>  different variables from the ?x and ?y in the graph on the right.
>>
>>  Unless I'm missing something.
>
>This is where I'm stuck, too.  It seems like this approach is very
>close to being dirt simple and fairly useful, but I can't quite get it
>to work.  :-)       That's what I meant by asking for ideas about how
>to make certain nodes variables, and how it would be nice to just use
>bNodes, but I don't know how.
>
>I was just reading Russel & Norvig [1] saying that a KB should, when
>asked "does there exist x, y such that P(x,y)" not only say "Yes", but
>also give you bindings from the existential variables to terms in the
>KB.  Which suggests it's not too strange to refer to variables outside
>their scope.

That is OK, as long as you don't get them confused with the 'same' 
variable used inside a different scope. The code has to somehow know 
when two variables are supposed to be from the same scope and when 
not. Invent some way of identifying scopes (eg the uri of the 
graph/rule?) and use that as a prefix on the variable name, say. But 
I bet there are more efficient ways to do it.

>   Unfortunately, RDF/XML makes it really hard -- it's
>not like RDF/N-Triples where you do know a label for the node, you're
>just not supposed to use it.

Oh, it is IMPOSSIBLE in RDF/XML. Forget about XML and stick to 
N-triples, which is really just graphs with handy-dandy labels for 
the, er, unlabelled nodes. You need those to record the substitutions.

As you say, its dirt simple, as long as you take a little care to not 
get your variables crossed. The state is recorded in a substitution 
list (bNode -> labels), and you can apply one of these to another by 
composing the mappings. (Use hash tables if you like.) Jos deRoo has 
working code, and Stefan Decker has a complete rule system in Prolog.

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, 10 October 2001 17:18:33 UTC