W3C home > Mailing lists > Public > public-rif-wg@w3.org > October 2008

RE: side/side vs. left/right

From: Hassan Ait-Kaci <hak@ilog.com>
Date: Wed, 1 Oct 2008 01:41:09 -0700
Message-ID: <9FC9C6B2EA71ED4B826F55AC7C8B9AAB01F336BF@mvmbx01.ilog.biz>
To: "Stella Mitchell" <cleo@us.ibm.com>
Cc: "RIF WG" <public-rif-wg@w3.org>
Hi Stella,

I appreciate the time and effort you are spending learning how to use
Jacc. I think it'll be worth your (and this WG's) time in the long run.

Re: your questions, my answers are below.  I also updated the BLD->XML
(meta-)compiler release on my web page with modified grammar annotations
as per your needs (see the *.grm files). The new zipped bundle is in:
http://wikix.ilog.fr/wiki/pub/Main/HassanAitKaci/ilog.rif.bld-v0.1.zip.

One last remark (and request): as I was (but vainly) trying to explain
yesterday during the telecon, I am currently hard-pressed not having time
on my hands to maintain an obsolete version vs. trying to develop a new
version (with still a few tricky parts remaining to program). Even though
I try to do my best time-sharing among all my activities, this RIF thing
is now taking more time that I can reasonably spare. So, again, I would
like to focus on the new version as soon as possible.

At any rate, the release that I have made (for the previous BLD version)
cannot yet handle namespace declarations such as the 4th one you want
- i.e., xsi:schemaLocation - see comments below). The other things you
needed are simple to do.

> So, instead of :
> 
>    <?xml version="1.0" encoding="UTF-8"?>
>    <rif:document xmlns:rif="http://www.w3.org/2008/rif">
>         <Group>
>               .......
>         </Group>
>    </Document>
> 
> I would like:
> 
>    <?xml version="1.0" encoding="UTF-8"?>
>    <rif:document xmlns:rif="http://www.w3.org/2008/rif">
>    <payload>
>       <Group>
>            .......
>       </Group>
>    </payload>  
> </Document>
> 
> Could you tell me how to do this by modifying the .grm files?

Yes. Edit source/BLD.grm and change the rule:

/**
 * Root grammar rule for Basic Logic Dialect (BLD):
 */
RifDocument
  : Group
  { showXml(); }  // show the XML tree
  ;

to the pair of rules:

/**
 * Root grammar rule for Basic Logic Dialect (BLD):
 */
RifDocument
  : OuterDocument
  { showXml(); }  // show the XML tree
  ;

OuterDocument
  : Group
  [ L:"payload" C:(1) ]
  ;

> Also, I'd like to change:
> 
>     <rif:document xmlns:rif="http://www.w3.org/2008/rif">
> 
> to
> 
>   <Document
>       xmlns="http://www.w3.org/2007/rif#"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:xs="http://www.w3.org/2001/XMLSchema#"
>       xsi:schemaLocation= "http://www.w3.org/2007/rif# http://www.jdrew.org/rif/bld/LC/BLDRule.xsd">  
> 
> For this, I'm not sure how to achieve the 1st and 4th attributes
> (default namespace, and schema location)

Still in source/BLD.grm, change the 'xmlroot' annotation:

// Define the XML tree root element to be 'rif:document':
%xmlroot "rif" "document"

to:

// Define the XML tree root element to be 'Document':
%xmlroot "Document"

Regarding the 3 first of the 4 namespace declarations that you need,
simply specify the following 'xmlns' annotations in source/BLD.grm:

// Declare the 'rif', 'xsi', and 'xs' XML namespaces:
%xmlns "rif" "http://www.w3.org/2007/rif#"
%xmlns "xsi" "http://www.w3.org/2001/XMLSchema-instance"
%xmlns "xs"  "http://www.w3.org/2001/XMLSchema#"

As for the 4th one, the released system cannot (yet?) handle those.  As
a matter of fact, I have yet to understand what this is used for. It is
easy to introduce in the next release. For now, sorry - comment it out. 

Note also that relative IRI's are not (yet?)  handled; so the "rif"
namespace declaration above is not the same as the Base pragma of the
current version.

Finally, I also updated the Jacc documentation in the release to also
describe the XML annotation commands (they were missing from the
previous released Jacc doc).

Thanks again, and good luck!

-hak

PS/ Please read the annotation manual in docs/JaccXmlAnnotationManual.pdf.
--
Hassan At-Kaci  *  ILOG, Inc. - Product Division R&D
http://koala.ilog.fr/wiki/bin/view/Main/HassanAitKaci



-----Original Message-----
From: Stella Mitchell [mailto:cleo@us.ibm.com]
Sent: Wed 10/1/2008 2:33 AM
To: Hassan Ait-Kaci
Subject: Re: side/side vs. left/right
 
Hi Hassan,

Thanks for this. I was able to make several changes
in the output XML,  but I'm having trouble wrapping the 
outermost  <group> with <payload>. 

 So, instead of :

   <?xml version="1.0" encoding="UTF-8"?>
   <rif:document xmlns:rif="http://www.w3.org/2008/rif">
        <Group>

              .......
 
        </Group>
   </Document>


I would like:

   <?xml version="1.0" encoding="UTF-8"?>
   <rif:document xmlns:rif="http://www.w3.org/2008/rif">
   <payload>
      <Group>

           .......
 
      </Group>
   </payload> 
</Document>


Could you tell me how to do this by modifying the .grm files?


Also, I'd like to change:

    <rif:document xmlns:rif="http://www.w3.org/2008/rif">

to

  <Document 
      xmlns="http://www.w3.org/2007/rif#"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema#"
      xsi:schemaLocation= "http://www.w3.org/2007/rif# 
http://www.jdrew.org/rif/bld/LC/BLDRule.xsd"> 

For this, I'm not sure how to achieve the 1st and 4th attributes
(default namespace, and schema location)


Thanks,
Stella






"Hassan Ait-Kaci" <hak@ilog.com> 
Sent by: public-rif-wg-request@w3.org
09/30/2008 11:53 AM

To
<public-rif-wg@w3.org>
cc
"harold boley" <Harold.Boley@nrc-cnrc.gc.ca>
Subject
side/side vs. left/right







Regarding Harold's and Christian's worry to have an up-to-date XML 
vocabulary
for the RIF->XML compiler I delivered, if you read the provided 
documentation
of the tool that I delivered already, you will realize that can update the 
type
of XML patterns that are generated for the syntax simply by editing the 
file
BLC.grm located in subdirectory sources/. Simply change:

Equal
  : Term EQUAL Term
  [ L:"Equal" C:(side.1 side.3) ]
  ;

to:

Equal
  : Term EQUAL Term
  [ L:"Equal" C:(left.1 right.3) ]
  ;

and recompile (i.e., do "ant all"). That's all. The same for
other changes that you wish can of couse be done.

The *whole point* of my tool is that it allows one to easily change the 
format of
the generate XML. So I am not needed for such changes...

-hak
--
Hassan At-Kaci  *  ILOG, Inc. - Product Division R&D
http://koala.ilog.fr/wiki/bin/view/Main/HassanAitKaci
Received on Wednesday, 1 October 2008 08:41:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:33:55 GMT