[foaf-dev] foaf validator

Mischa Tuffield mischa.tuffield at garlik.com
Sat Aug 6 12:08:43 CEST 2011

Good morning, 

On 6 Aug 2011, at 01:13, Jonas Smedegaard wrote:

> On 11-08-06 at 12:18am, Mischa Tuffield wrote:
>> Hi Jonas, 
>> On 5 Aug 2011, at 19:08, Jonas Smedegaard wrote:
>>> I tried validating my own FOAF file:
>>> http://foaf.qdos.com/validator/uri?URI=http://dr.jones.dk/me/index.rdf
>>> I am puzzled about the results - seems to me that the warnings for 
>>> tests 1-3 is bogus as those allegedly missing declarations indeed 
>>> exist in my file.  Or am I composing my FOAF data wrongly?
>> when you parse http://dr.jones.dk/me/index.rdf none of the triples in 
>> the document talk about the URI which the document was fetched from. 
>> So yeah your foaf document has an rdf:type 
>> foaf:PersonalProfileDocument triple, but the subject of that tripe is 
>> <http://dr.jones.dk/me/> due to the use of :
>> xml:base="http://dr.jones.dk/me/" in your rdf:xml
> Ah.  Thanks!
> 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...

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 ... 

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. 

This is the best description of how to set up your apache instance to server up conneg'd RDF:


>> FWIW, I believe the validator was only giving off "Warnings" not 
>> errors.
> Yes.  I strive for perfection, and thus want also warnings fixed. :-)


>>> My FOAF file was generated from http://dr.jones.dk/me/index.ttl 
>>> using mkfoaf.sh available below http://dr.jones.dk/foaf/ .
>> yay to ttl :) I will have a look at mkfoaf.sh at some point ...
> There is not much to the script, actually.  The other scripts in same 
> dir might be more interesting ;-)
> 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.

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. 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 ...` :)

> 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

<http://dr.jones.dk/me/> <http://xmlns.com/wot/0.1/assurance> <http://dr.jones.dk/me/index.rdf.asc> .
<http://dr.jones.dk/me/index.rdf.asc> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/wot/0.1/Endorsement> .
<http://dr.jones.dk/me/index.rdf.asc> <http://xmlns.com/wot/0.1/endorser> <http://dr.jones.dk/me/#pubkey> .
_:bnode0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/wot/0.1/PubKey> .
_:bnode0 <http://xmlns.com/wot/0.1/pubkeyAddress> <http://dr.jones.dk/me/index.rdf.asc> .

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, so that one does need to understand signatures and stuff at the point of parsing the RDF.

The validator is looking for a thing, which has some details, and which is related to a foaf:Person URI, the foaf:Person URI of the foaf:primaryTopic of the foaf:Document which has a wot:assurance. 

This is what I have in my foaf file, and it is pretty much what the validator is looking for (yes, based on my reading of the WoT ontology, but I am open to suggestions): 

_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/wot/0.1/PubKey> .
_:bnode1 <http://xmlns.com/wot/0.1/fingerprint> "18A2AF280CA59E77AE512BB39ED0B04E51F2F7EF" .
_:bnode1 <http://xmlns.com/wot/0.1/hex_id> "51F2F7EF" .
_:bonde1 <http://xmlns.com/wot/0.1/identity> <http://mmt.me.uk/foaf.rdf#mischa> .
_:bnode1 <http://xmlns.com/wot/0.1/length> "4096"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bnode1 <http://xmlns.com/wot/0.1/pubkeyAddress> <http://mmt.me.uk/mischa.pubkey.asc> .
<http://mmt.me.uk/foaf.rdf>  a foaf:PersonalProfileDocument . 
<http://mmt.me.uk/foaf.rdf> foaf:primaryTopic <http://mmt.me.uk/foaf.rdf#mischa> .
<http://mmt.me.uk/foaf.rdf> <http://xmlns.com/wot/0.1/assurance> <http://mmt.me.uk/foaf.rdf.asc> .

I.e. This is a document about a person, it talks about lots of people, but the primary focus of the document is Alice. The document has an assurance document, which is signed by a PubKey, which is an identity of Alice, our protagonist... 

I hope that helps!

>> Am liking your arabic foaf:nick, 
>> يونس
>> In Farsi we have a sound closer to the english "Je" than the arabic 
>> "You" sounding letter at the start of the foaf:nick, you could also 
>> add a:
>> <foaf:nick>جنس</foaf:nick>
> Great. Added now!
>> Otherwise it all looks good, /me waves and says thanks in public for 
>> all the debian stuff you have been doing, THANK YOU!
> Thanks for the kind words.
>> Mischa *goes back to watching "Walking Dead" ...
> Hmm - didn't know that one.  Seems interesting!
> - Jonas
> -- 
> * Jonas Smedegaard - idealist & Internet-arkitekt
> * Tlf.: +45 40843136  Website: http://dr.jones.dk/
> [x] quote me freely  [ ] ask before reusing  [ ] keep private
> _______________________________________________
> foaf-dev mailing list
> foaf-dev at lists.foaf-project.org
> http://lists.foaf-project.org/mailman/listinfo/foaf-dev

Mischa Tuffield PhD
Email: mischa.tuffield at garlik.com
Homepage - http://mmt.me.uk/
+44(0)208 439 8200  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.foaf-project.org/pipermail/foaf-dev/attachments/20110806/f4e8804b/attachment.htm 

More information about the foaf-dev mailing list