W3C home > Mailing lists > Public > www-rdf-logic@w3.org > May 2001

Re: N3 vs. XML

From: Drew McDermott <drew.mcdermott@yale.edu>
Date: Tue, 22 May 2001 16:08:01 -0400 (EDT)
Message-Id: <200105222008.QAA23771@pantheon-po02.its.yale.edu>
To: www-rdf-logic@w3.org

Sorry to leave so much of the original message intact in my reply, but
I couldn't see how to edit it down.

   From: jos.deroo.jd@belgium.agfa.com
   X-PH: V4.4@mr3
   Cc: www-rdf-logic@w3.org
   Date: Tue, 22 May 2001 17:39:36 +0100
   X-Mimetrack: Serialize by Router on BY-INETOUT/Central/LEV/DE/BAYER(Release 5.0.7 |March
    21, 2001) at 05/22/2001 05:39:46 PM
   Mime-Version: 1.0
   Content-Type: text/plain; charset=us-ascii


   Drew,

   correction: the ouput should actually look like

   <!-- Processed by Id: cwm.py,v 1.46 2001/05/21 14:35:47 connolly Exp -->
   <!--     using base file:/n3/sensor.n3-->


   <rdf:RDF xmlns:control="foo:control#"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:math="foo:math#"
       xmlns:sensor="foo:sensor#"
       xmlns="http://www.w3.org/2000/10/swap/log#">

       <rdf:Description>
	   <is rdf:parseType=":quote">
	       <rdf:Description rdf:about="foo:sensor#thermostat">
		   <math:greaterThan>30</math:greaterThan>
	       </rdf:Description>
	   </is>
	   <implies rdf:parseType=":quote">
	       <rdf:Description rdf:about="foo:control#furnace">
		   <control:setTo>1</control:setTo>
	       </rdf:Description>
	   </implies>
       </rdf:Description>
   </rdf:RDF>

   (so with 'is' and 'quote' in http://www.w3.org/2000/10/swap/log# )
   which is to my knowledge perfect RDF/XML
   e.g. Sirpac gives
   --------------------------------------------------------------------------------
   triple("file:sensor.rdf#genid1", "http://www.w3.org/2000/10/swap/log#is", litera
   l("
	       <rdf:Description xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-
   ns#' rdf:about='foo:sensor#thermostat'>
		   <math:greaterThan xmlns:math='foo:math#'>30</math:greaterThan>
	       </rdf:Description>
	   "))
   triple("file:sensor.rdf#genid1", "http://www.w3.org/2000/10/swap/log#implies", l
   iteral("
	       <rdf:Description xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-
   ns#' rdf:about='foo:control#furnace'>
		   <control:setTo xmlns:control='foo:control#'>1</control:setTo>
	       </rdf:Description>
	   "))
   Total statements: 2
   ---------------------------------------------------------------------------------
   and Jena gives
   ---------------------------------------------------------------------------------
   <rdf:RDF
     xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
     xmlns:RDFNsId0='http://www.w3.org/2000/10/swap/log#' >
     <rdf:Description rdf:about='#RDFAnonId1'>
       <RDFNsId0:is>
	       &lt;rdf:Description rdf:about=&quot;foo:sensor#thermostat&quot;&gt;
		   &lt;math:greaterThan&gt;30&lt;/math:greaterThan&gt;
	       &lt;/rdf:Description&gt;
	   </RDFNsId0:is>
       <RDFNsId0:implies>
	       &lt;rdf:Description rdf:about=&quot;foo:control#furnace&quot;&gt;
		   &lt;control:setTo&gt;1&lt;/control:setTo&gt;
	       &lt;/rdf:Description&gt;
	   </RDFNsId0:implies>
     </rdf:Description>
   </rdf:RDF>
   ----------------------------------------------------------------------------------
   (there is still no canonical pasrer output format, but that's another problem)

   Of course, the current RDF processors are not further parsing the quoted
   (don't shoot the messenger) content, ...

This seems to be a new form of reification, in which the embedded RDF
is treated as a string.  (I take it that both of the two forms above
mean essentially the same thing, namely: Pretend there are no angle
brackets or other characters with XML meaning in the quoted material;
it's just uninterpreted characters.)

   ...but so what.

Well.  It seems quite obvious to me that being able to insert quoted
strings into formulas solves nothing.  Compare the following:

if "a lua e azul" then "sou imperador de Portugal"
if "(exists (x) (jumps-over x moon))" then "(exists (x) (is x cow))"
if "ps-over x exists))(moon (x) (jum" then "( (is x cow) x (exists))"

The first doesn't establish or require that anyone know Portuguese.
The second doesn't establish or require that predicate calculus be
part of our formalism.  I threw in the third to illustrate the fact
that the apparent meaningfulness of the first two is an illusion; 
the third sentence means just as much or as little as the other two.
Talking about strings doesn't mean talking about what those strings
might talk about if you knew what language they were in.

   > What if I wanted to say
   >
   >   (forall (x)
   >      {sensor:thermostat  math:equal ?x}
   >      log:implies
   >      {control:furnace control:setTo ?x})
   >
   > possibly without the explicit quantifier.  Would Quote still be
   > sufficient?

   I don't know that syntax, what is it? i also don't understand the question?

It's the same as the previous syntax, with a universally quantified
variable ?x, either explicit or (by the usual Prolog convention)
implicit.  It says "If the sensor reads ?x, then the furnace control
is set to ?x."  (A linear thermostat, which is not really very
useful.)  The point is that I would like to "quantify in" to the
pieces of an implication.  But if we're really passing quoted strings
around, there's no way to do that.  I would need to "quasiquote,"
which gets pretty ugly.

Example:

    (forall (x)
       (if (animal x)
           (exists (y)
              (and (head y x)
		   (if (not (attached y x))
		       (dead x))))))

"For all x, if x is an animal then it has a head, and if that head is
not attached to x, x is dead."

Consider the rendering of the last IF.  It can't be talking about the
strings "(not (attached y x))" and "(dead x)", because what I really
mean is what you get by substituting (the names of?) x and y into
those strings and then interpreting those strings as predicate
calculus. Even worse, the entire last IF is inside a big string from
the first IF, so some occurrences of x are inside two layers of
quotes, some inside one layer.  Blech.

So N3 seems not to be immune from RDF leprosy after all.

                                             -- Drew McDermott
Received on Tuesday, 22 May 2001 16:08:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:45:38 UTC