[rdfweb-dev] lightweight php rdf/xml parser

Danny Ayers danny666 at virgilio.it
Sun Jul 25 22:04:36 UTC 2004


Julian Bond wrote:

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


Thanks, I see where you're coming from now.

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


Well, it handles a single case, and might be brittle. Then again I think 
you'd have to go beyond RDF(S) to express the equivalences, I can't see 
an easy good-practice route. But all the same, if you did look at things 
after parsing (or at least late in parsing) it may be possible to 
hardwire in full equivalence handling (on the URIs of terms), but with 
arbitrary equivalence maps. Dunno, it just seems like asking for more 
work going back down to regexps.

Cheers,
Danny.




-- 

Raw
http://dannyayers.com




More information about the foaf-dev mailing list