Changes between Version 6 and Version 7 of AppleAddressBookDatasource


Ignore:
Timestamp:
12/12/05 20:21:02 (19 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppleAddressBookDatasource

    v6 v7  
    3535It should copy/paste from the RDF-File datasource:  source:trunk/gnowsis/src/org/gnowsis/adapters/rdffile/RDFFileDataSource.java 
    3636 
    37 I uploaded a script I made a couple of years ago, but it's appeared as 0 bytes. So here's the script. 
     37---------------------- 
     38 
     39I uploaded a script I made a couple of years ago, but it's appeared as 0 bytes. So here's the script. To use it, you need to create a group called "FOAF" and add anyone you want in your knows list to that group. If you have a URL for their FOAF file, select their card in the Address Book, choose Card>Add Field>URL, change the URL title to FOAF and but the URL in the URL box. 
    3840 
    3941property foaf : "FOAF" 
     
    4345 
    4446set m to properties of my card 
    45         set the_file to (((path to desktop) as string) & first name of m & last name of m & ".rdf") as file specification 
    46         set rdf to "<rdf:RDF" & return 
    47         set rdf to rdf & "xmlns:rdf=" & quote & "http://www.w3.org/1999/02/22-rdf-syntax-ns#" & quote & return 
    48         set rdf to rdf & "xmlns:rdfs=" & quote & "http://www.w3.org/2000/01/rdf-schema#" & quote & return 
    49         set rdf to rdf & "xmlns:foaf=" & quote & "http://xmlns.com/foaf/0.1/" & quote & return 
    50         set rdf to rdf & "xmlns:admin=" & quote & "http://webns.net/mvcb/" & quote & ">" & return 
    51         set rdf to rdf & "<foaf:Person rdf:nodeID=" & quote & "me" & quote & ">" & return 
    52         set rdf to rdf & "<foaf:name>" & first name of m & " " & last name of m & "</foaf:name>" & return 
    53         if nickname of m ≠ "" then 
    54                 set rdf to rdf & "<foaf:nick>" & nickname of m & "</foaf:nick>" & return 
    55         end if 
    56          
    57          
    58         if group foaf exists then 
    59                 repeat with this_person in every person of group foaf 
    60                          
    61                          
    62                         set rdf to rdf & "<foaf:Person>" & return 
    63                         set rdf to rdf & "<foaf:name>" & first name of this_person & " " & last name of this_person & "</foaf:name>" & return 
    64                         repeat with e in emails of this_person 
    65                                 set rdf to rdf & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>" & return 
    66                         end repeat 
    67                         if ((count of urls of this_person) > 0) then 
    68                                 if label of url 1 of this_person is "FOAF" then 
    69                                         set rdf to rdf & "<rdfs:seeAlso rdf:resource=" & quote & value of url 1 of this_person & quote & "/>" & return 
    70                                 end if 
     47set the_file to (((path to desktop) as string) & first name of m & last name of m & ".rdf") as file specification 
     48set rdf to "<rdf:RDF" & return 
     49set rdf to rdf & "xmlns:rdf=" & quote & "http://www.w3.org/1999/02/22-rdf-syntax-ns#" & quote & return 
     50set rdf to rdf & "xmlns:rdfs=" & quote & "http://www.w3.org/2000/01/rdf-schema#" & quote & return 
     51set rdf to rdf & "xmlns:foaf=" & quote & "http://xmlns.com/foaf/0.1/" & quote & return 
     52set rdf to rdf & "xmlns:admin=" & quote & "http://webns.net/mvcb/" & quote & ">" & return 
     53set rdf to rdf & "<foaf:Person rdf:nodeID=" & quote & "me" & quote & ">" & return 
     54set rdf to rdf & "<foaf:name>" & first name of m & " " & last name of m & "</foaf:name>" & return 
     55if nickname of m ≠ "" then 
     56set rdf to rdf & "<foaf:nick>" & nickname of m & "</foaf:nick>" & return 
     57end if 
     58if group foaf exists then 
     59repeat with this_person in every person of group foaf 
     60set rdf to rdf & "<foaf:Person>" & return 
     61set rdf to rdf & "<foaf:name>" & first name of this_person & " " & last name of this_person & "</foaf:name>" & return 
     62repeat with e in emails of this_person 
     63set rdf to rdf & "<foaf:mbox>mailto:" & value of e & "</foaf:mbox>" & return 
     64end repeat 
     65if ((count of urls of this_person) > 0) then 
     66if label of url 1 of this_person is "FOAF" then 
     67set rdf to rdf & "<rdfs:seeAlso rdf:resource=" & quote & value of url 1 of this_person & quote & "/>" & return 
     68end if 
    7169                        end if 
    7270                        set rdf to rdf & "</foaf:Person>" & return