;;; From kensanata's http://www.emacswiki.org/cgi-bin/wiki/BbdbFoaf (load "/home/sacha/notebook/emacs/xml.el") (defun bbdb-foaf (&optional all) "Print a list of people you know for inclusion in a FOAF file. The optional argument ALL indicates that you want to export everybody in your BBDB file. The default is to export only the people that have the 'foaf' field defined. The 'foaf' field should contain the URL of a FOAF file describing them. Fields used: 'www' foaf:homepage 'mbox' foaf:mbox_sha1sum 'net' foaf:mbox if no 'mbox' field exists 'name' foaf:name 'foaf' rdfs:seeAlso" (interactive "P") (pop-to-buffer (get-buffer-create "*FOAF*")) (erase-buffer) (insert " \n") (dolist (record (bbdb-records)) (when (or all (bbdb-record-getprop record 'foaf)) (xml-debug-print-internal (list 'foaf:knows nil (let ((p (list 'foaf:Person nil (list 'foaf:name nil (bbdb-record-name record))))) (when (bbdb-record-getprop record 'www) (nconc p `((foaf:homape nil ,(bbdb-record-getprop record 'www))))) (if (bbdb-record-getprop record 'mbox) (nconc p `((foaf:mbox_sha1sum nil ,(bbdb-record-getprop record 'mbox)))) (when (bbdb-record-net record) (nconc p `((foaf:mbox nil ,(car (bbdb-record-net record))))))) (when (bbdb-record-getprop record 'foaf) (nconc p `((rdfs:seeAlso ((rdf:resource . ,(bbdb-record-getprop record 'foaf))))))) p)) " ") (newline))) (insert " \n"))