[rdfweb-dev] Re: PHP RDF Parser
julian_bond at v...
Tue Jan 7 18:10:17 UTC 2003
"The Emperor <the_emperor at m...>"
<the_emperor at m...> wrote:
I foolishly thought it would be a neat way of understanding FOAF to
write a simple PHP program to grab a single file and drop the data into
a MySQL database.
I tried Luis Argerich's class_rdf_parser.php first. It barfed on all 3
files I passed to it. A syntax error, a run time illegal pass by
reference and spurious warnings. When it worked it did seem to extract
triples OK, but in the process lost any hierarchical data. And it didn't
flow rdf:resource links back into the hierarchy.
So I went off looking for alternatives and found a bunch of experimental
PHP RDF parsers that really didn't do much.
So then I thought, it's only XML data I'll use the built in expat XML
parsers in PHP. At which point I discovered that real world FOAF files
seem to be a little arbitary about when to put the data into attributes
and when to put it in cdata. And those rdf:resource links were still
really screwing me up as well.
I've now spent a few hours on this and I'm no closer to being able to
get the data into an intelligible form in PHP where I can store it in a
relational database. I'm also feeling very small and stupid! Am I really
the first person to do this, or do I just not *get* some key process in
Can anyone offer a pointer or three on how to approach this?
Julian Bond Email&MSM: julian.bond at v...
Personal WebLog: http://www.voidstar.com/
M: +44 (0)77 5907 2173 T: +44 (0)192 0412 433
More information about the foaf-dev