wiki:AppleAddressBookDatasource

Version 4 (modified by sauermann, 18 years ago) (diff)

--

How to convert the apple address book to RDF

These tools exist to do it:

Sources: Libby Miller, This blog entry.

Documentation by Apple

An applescript file that does a starting thing

tell application "Address Book"
	set out to "<rdf:RDF xmlns:foaf='http://xmlns.com/foaf/0.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
	repeat with p in people
		set out to out & "<foaf:Person>"
		set out to out & "<foaf:name>" & (name of p) & "</foaf:name>"
		repeat with e in emails of p
			set out to out & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>"
		end repeat
		set out to out & "</foaf:Person>"
	end repeat
	set out to out & "</rdf:RDF>"
	out
end tell

The DataSource itself

It should copy/paste from the RDF-File datasource: source:trunk/gnowsis/src/org/gnowsis/adapters/rdffile/RDFFileDataSource.java

Attachments (1)

Download all attachments as: .zip