[rdfweb-dev] lightweight php rdf/xml parser

Julian Bond julian_bond at voidstar.com
Sat Jul 24 09:09:45 UTC 2004


Danny Ayers <danny666 at virgilio.it> wrote:
>Julian Bond wrote:
>> Note that findRegex() was needed due to the multiple relationship 
>>schema in use. It's not very elegant.
>
>Can you please give an example of what you've been using this for - I'm 
>not trying to be purist (moi!) but am wondering if the same kind of 
>thing might be achieved at the XML level, maybe filling a dictionary of 
>simple element/content pairs on parse..?  I could be wrong, but the 
>regexp might cause a bit of performance hit, and lose the benefit of 
>the XML stuff's namespace handling.

http://www.perceive.net/schemas/20031015/relationship/relationship.rdf#
http://www.perceive.net/schemas/20021119/relationship/relationship.rdf#
http://purl.org/vocab/relationship/

These namespaces are all being used in extant FOAF. There may be more. 
They are broadly the same but with varying numbers of properties defined 
each of which is in the same format. So the application needs to know 
that they're equivalent. It was easier to write stupid code that just 
looked for "%relationship%" and grabbed everything after the final / or 
# as the description. Then strip the "Of" and upper case the first 
letter and you have a textual description.

Actually the namespace definition could just not bother defining 
properties. It could be a meta description: Define whatever relationship 
you like in camelcase and with "Of" appended. So if someone wanted 
"exWifeOf" they could just go ahead and use it.

All that is just *so* not RDF. But it does handle a useful bit of data.

-- 
Julian Bond Email&MSM: julian.bond at voidstar.com
Webmaster:                 http://www.ecademy.com/
Personal WebLog:          http://www.voidstar.com/
M: +44 (0)77 5907 2173      T: +44 (0)192 0412 433



More information about the foaf-dev mailing list