Re: GRDDL implementation in Raptor

On Tue, 05 Apr 2005 15:00:27 +0200, Dominique Haza__l-Massieux <dom@w3.org> wrote:

> Le lundi 04 avril 2005 __ 11:38 +0100, Dave Beckett a __crit :
> > In a fit of coding enthusiasm just before going on vacation, I added
> > GRDDL support to my Raptor RDF parser & serialiser library based on
> > reading http://www.w3.org/2004/01/rdxh/spec quickly and using libxml2
> > and libxslt.
> 
> Wow! Great!
> 
> > It's only in raptor's CVS right now
> 
> To test it on my machine, I've downloaded the nightly snapshot from:
> http://download.librdf.org/snapshots/source/
> and it built the GRDDL parser once I made sure I had libxml2-dev and
> libxslt1-dev debian packages...

Yeah.

> > I think it's doing the right thing but I didn't spend a lot of time
> > checking.  When multiple transforms are present, do they make one graph?
> > I went with Yes.
> 
> That's right
> 
> >   Should users be able to select them by parameter?  I
> > went with No.  Are any XSLT parameters passed in?  I went with No.
> 
> Seems right as well.
> 
> >  but you can try it out in the demo
> > on the two examples I found:
> > http://librdf.org/parse?uri=http%3A%2F%2Fwww.w3.org%2F2003%2F12%2Frdf-
> > in-xhtml-xslts%2Fcomplete-example.html&language=grddl
> > 
> > http://librdf.org/parse?uri=http%3A%2F%2Fwww.w3.org%2F2004%2Flambda%
> > 2FSites%2Findex.html&language=grddl
> > 
> > or enter your own URIs at http://librdf.org/parse  and select parser
> > GRDDL.
> 
> I tried both the on-line version and the version compiled on my
> computer, and none of them was able to run any of the test cases of the
> test suite; I tried quickly to locate the bug, but didn't manage to find
> what was wrong; namely, it fails as follows:
> ./rapper -i grddl -o rdfxml ~/dev.w3.org/2005/grddl-ts/xhtmlWithGrddlProfile.html
> lt-rapper: Parsing file /home/dom/dev.w3.org/2005/grddl-ts/xhtmlWithGrddlProfile.html
> <?xml version="1.0" encoding="utf-8"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> XPath error : Invalid or inclomplete context

Yeah, I get this.  odd. The xhtml document seems valid so it must be
my xpath.

> lt-rapper: Error - URI file:///home/dom/dev.w3.org/2005/grddl-ts/xhtmlWithGrddlProfile.html:1 column 0 - Unable to evaluate XPath expression "//html:html/html:head[@profile='http://www.w3.org/2003/g/data-view']/html:link[@rel='transformation']/@href"
> lt-rapper: Failed to parse file /home/dom/dev.w3.org/2005/grddl-ts/xhtmlWithGrddlProfile.html grddl content
> </rdf:RDF>
> lt-rapper: Parsing returned 0 statements
> 
> 
> (The online version gives:
> http://librdf.org/parse?language=grddl&uri=http%3A%2F%2Fdev.w3.org%
> 2Fcvsweb%2F%7Echeckout%7E%2F2005%2Fgrddl-ts%2FxhtmlWithGrddlProfile.html
> %3Frev%3D1.1&content=&Run+Parser=Run+Parser&.cgifields=language
> -> 
> GRDDL parser failed with errors:
> 1:Unable to evaluate XPath expression "//html:html/html:head[@profile="http://www.w3.org/2003/g/data-view"]/html:link[@rel="transformation"]/@href"
> which is similar)

That wouldn't work even if the mysterious error above was fixed,
since the relative URI of the XSLT transformation isn't right for the
URLs from the cvsweb.  You'd need to put the testsuite somewhere in
the "real" web or run it from a cvs checkout as you are doing here.
 
> Looking at the code and the details you gave in your original message, I
> can tell that - were it to run - it would likely only pass the 1st test
> of the GRDDL test suite at:
> http://dev.w3.org/cvsweb/2005/grddl-ts/
> namely
> http://dev.w3.org/cvsweb/~checkout~/2005/grddl-ts/test-lists.rdf#xhtmlWithGrddlProfile

Somehow I missed finding this test suite, but I did say I was doing it
from a quick read through.

> Time permitting, I'll try to prepare a patch to get it run more tests...
> but that assumes I manage to fix the bug that prevents it from running
> in the first place.
> 
> Thanks for starting this! I can't wait to have GRDDL implemented in
> raptor!

My pleasure.

It might help if the xpaths to get the transforms were in the document too.

I should try alternative ones such as to find grddl in XML.  Guessing
something like //[@data-view:interpreter] with
  data-view defined as http://www.w3.org/2003/g/data-view#

Dave

Received on Wednesday, 6 April 2005 10:47:49 UTC