使用php创建rdf / xml的简单方法?

what's the best/simplest/easiest way to create rdf/xml with php?

ideally i would like to use simpleXML - but i believe it doesn't support namespaces?

failing that maybe simpleDOM? id rather not use DOM since it tends to confuse me a lot!

perhaps there is some other way?

thanks for your help!

:)

nb: i tried to post an example but couldn't get it to format properly (no line breaks with backticks, only one line at a time usng the GUI) so any help with that would be good to!

You may want to try using ARC. It provides with a collection of parsers and serializers that allow the conversion of triples from/to multiple formats.

Last time I looked at RDF, Redland was the tool of choice. It has a PHP interface, I suggest looking at that.

I would recommend you to use RDF API for PHP. RAP is a software package for parsing, querying, manipulating, serializing and serving RDF models.

I think all answers above are outdated. Meanwhile EasyRdf seems to be the hippest child in town. It has properties which fully match the zeitgeist such as:

  • Intuitive interface
  • Hosted on Github, many "likes"
  • Good documentation
  • Test backed