[foaf-dev] foaf validator

Jonas Smedegaard dr at jones.dk
Sun Aug 7 14:23:59 CEST 2011

On 11-08-06 at 11:08am, Mischa Tuffield wrote:
> On 6 Aug 2011, at 01:13, Jonas Smedegaard wrote:
> > I have fought for a long time to both support content-negotiation 
> > and serve RDF as nice directory URLs rather than exposing the ugly 
> > extension.  I use Apache2 but haven't figured out how to make it 
> > rank RDF higher than GPG sigs.
> So, yeah the problem the validator is choking is because of its turtle 
> parser isn't great. This is a bug in the RAP PHP library, which isn't 
> maintained anymore, I have forked it in github, and will look into why 
> n3 parser is crapping out in the future, but not today...

Uhm, possibly that issue plays a role too, but what I meant above was 
*not* that Turtle was served instead of RDF/XML, but that my current 
Apache2 content negotiation setup favors "*.rdf.pgp" over "*.rdf".

> But to your point above, your apache setup isn't quite right: 
> When i : 
> `curl  -H 'Accept: application/rdf+xml, application/rdf+turtle, application/x-turtle, text/turtle, application/xml, */*' 'http://dr.jones.dk/me/'` 
> I get back turtle ... 

I believe your test is flawed: when *both* leaving out "q" ratings and 
including a wildcard, it is essentially equal to this:

curl -H 'Accept: */*' 'http://dr.jones.dk/me/'

This is probably what you intended:

curl -H 'Accept: application/rdf+xml, application/rdf+turtle;q=0.5, application/x-turtle;q=0.4, text/turtle;q=0.3, application/xml;q=0.2, */*;q=0.1' 'http://dr.jones.dk/me/'

...which delivers the RDF/XML format :-)

Alternatively if you wanted to test _my_ priorities then you should 
leave out the trailing wildcard, like this:

curl -H 'Accept: application/rdf+xml, application/rdf+turtle, application/x-turtle, text/turtle, application/xml' 'http://dr.jones.dk/me/'

...which delivers the Turtle format.  Which is IMO not "wrong" of my 
setup, but wrong of you if really you favor RDF/XML over Turtle. :-)

The issue I raised is this:

curl -H 'Accept: application/rdf+xml, application/pgp-signature' 'http://dr.jones.dk/me/'

...which delivers the PGP signature rather than the RDF/XML.

Hmm.  It occurs to me just now that the GPG signature really isn't same 
content in a different format, so should simply use a different stem. 
Will try that after posting this (so the test right above hopefully 
leads to serving the RDF/XML pretty soon).

> RAP's rdfxml parser is way better than its turtle/n3 one, if you could 
> have a look at your http://dr.jones.dk/me/ to make it return RDF/XML 
> when a client says it prefers it then the validator will work, till i 
> look at the n3 parsing.

As argued above I claim that my server _does_ respect RDF/XML favored 
over Turtle - when properly hinted!

> This is the best description of how to set up your apache instance to 
> server up conneg'd RDF:
> http://www.w3.org/TR/swbp-vocab-pub/ 

Thanks.  That is indeed a nice document (I knew it already).  Does not 
include GPG signing in its examples, though, which is (or was) my 

> > Took me some time to find a method that works both ways: I can 
> > generate RDF and from the RDF generate the exact same Turtle file.  
> > Added that reverse script now as well: rdf2turtle.sh
> Um, I think there is some confusion when you use the term 'RDF', you 
> seem to use it to refer to RDF/XML. This is not the case, 'RDF' is a 
> data model as per the 'RDF Concepts/Abstract syntax' W3C note, RDF/XML 
> (ugly) and Turtle (pretty) are both serialisation of the RDF 
> data-model... A minor point, thought you appreciate it though.

You are right, off course.  And I appreciate being corrected!

> Furthermore, libraptor, and the command line tool which comes with it 
> `rapper`, is totally the tool of awesome you want when converting 
> between the various RDF serialisations.

Agreed. My scripts are essentially small wrappers around rapper.

> You must have that installed on your machine, I recall you pointing to 
> the ubuntu bug report (which I didn't understand) about libraptor1 and 
> libraptor2 dependency stuff.. hrrmm. You should totally check it out, 
> it is an awesome bit of RDF conversion magic. And finally on this 
> rant, I keep saying this `if libraptor can't parse it, it isn't RDF 
> ...` :)

I do not recall that conversation, but most likely I have referred to a 
_Debian_ bug (I am a Debian Developer and use only "the real thing", not 
Ubuntu or any other derivative).

> > Oh, btw: I thought I'd done the WoT setup properly using GPG 
> > signing.  What am I missing there to be "compliant" with your 
> > validator?
> You have the following relevant triples

[details snip]

> Which are fine I guess, but they are leaving "a lot to the 
> imagination", what my validator is checking for is for more of the 
> details of your GPG key to be listed within the RDF,

[working example snipped]

Thanks.  Quite helpful.

No space in my brain to fully grasp that at the moment, though, so will 
postpone further tuning of my FOAF for later: Have a deadline on a 
webdesign for a client to reach before I go to CCCamp11 to promote 
FreedomBox on tuesday and one week forward.

Kind regards,

 - Jonas


Gave "Walking dead" a try but is not to the liking of me and my 
girlfriend.  Thanks anyway for the (implicit) suggestion.

 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://lists.foaf-project.org/pipermail/foaf-dev/attachments/20110807/7a6f59db/attachment.pgp 

More information about the foaf-dev mailing list