• Topic
  • Discussion
  • ODS.OdsAddressbookCRUDEndpoint(Last) -- DAVWikiAdmin? , 2017-06-29 07:30:37 Edit WebDAV System Administrator 2017-06-29 02:30:37

    Manipulate my Addressbook data via CRUD RESTful using Addressbook CardDAV? Endpoint

    What?

    AddressBook? CRUD (Create, Read, Update, Delete) Endpoint Service.

    Why?

    Using CRUD RESTful Endpoint service provides an easy way to manage contacts.

    How?

    Knowing an Addressbook CRUD Endpoint Service endpoint URL, one can perform the following activities:
    • Copy-paste vCard files containing contacts. So once pasted, the system creates the contacts;
    • Edit contact(s);
    • Update contact(s);
    • Delete contact(s);
    • Update RDF Data for the Addressbook instance. Depending on the instance's model:
      • When model is "Closed", will be updated the RDF Data for the instance's private graph:

        http://cname/dataspace/protected/[name-of-the-instance]

      • When model is "Opened", will be updated the RDF Data for the ODS Dataspace public graph:

        http://cname/dataspace/[name-of-the-instance]

    Example with Addressbook instance that has Member model from type "Closed" and is not set "Visible to public"

    1. Suppose a user, for ex. "demo", has created Addressbook instance with name "demoAddressBook" and Member model is "Closed":



    2. Mount the Addressbook CardDAV? Endpoint URL http://localhost:8890/DAV/home/demo/addressbooks/demoAddressBook/>











    3. Drop a .vcf file, for ex. kidehen.vcf into the mapped CardDAV? Addressbook folder:

      -- kidehen.vcf BEGIN:VCARD VERSION:3.0 REV:2012-01-23T15:30:04-05:00 UID:B12074BC-DB7B-47F5-856E-2DBD08923381-ABSPlugin NICKNAME:Idehen FN:Kingsley Idehen N:Idehen;Kingsley;; ORG:OpenLink Software TITLE:CEO END:VCARD





    4. The user demo's Addressbook Dataspace instance UI now should show under "My Contacts" the new imported contact(s):



    5. Generate an X.509 Certificate hosted WebID for user "demo" WebID?.
    6. Secure your SPARQL Endpoint via user "demo" WebID, for ex.:

      -- user "demo" WebID: http://localhost:8890/dataspace/person/demo#this -- SPARQL-WebID Endpoint: -- https://localhost:4433/sparql-webid

    7. Access the SPARQL-WebID? Endpoint.
    8. When challenged for authentication select the generated from above certificate for user "demo":



    9. The SPARQL-WebID? Endpoint UI should be presented:



    10. Enter the following query:

      SELECT * FROM <http://localhost:8890/dataspace/protected/demoAddressBook> WHERE {?s ?p ?o}





    11. As result no rows are found.

    Example with Addressbook instance that has Member model from type "Opened" and is set "Visible to Public"

    1. Suppose a user, for ex. "demo", has created Addressbook instance with name "demoAddressBook" and Member model is "Opened" and is set "Visible to Public".



    2. Mount the Addressbook CardDAV? Endpoint URL http://localhost:8890/DAV/home/demo/addressbooks/demoAddressBook/>











    3. Drop a .vcf file, for ex. kidehen.vcf into the mapped CardDAV? Addressbook folder:

      -- kidehen.vcf BEGIN:VCARD VERSION:3.0 REV:2012-01-23T15:30:04-05:00 UID:B12074BC-DB7B-47F5-856E-2DBD08923381-ABSPlugin NICKNAME:Idehen FN:Kingsley Idehen N:Idehen;Kingsley;; ORG:OpenLink Software TITLE:CEO END:VCARD





    4. The user demo's Addressbook Dataspace instance UI now should show under "My Contacts" the new imported contact(s):



    5. Access the SPARQL Public Endpoint.



    6. Suppose the inserted from above contact has id=1004.
    7. Enter the following query:

      SELECT * FROM <http://localhost:8890/dataspace> WHERE {<http://localhost:8890/dataspace/demo/addressbook/demoAddressBook/1004> ?p ?o}





    8. Click "Run Query".
    9. As result the freshly inserted RDF Data for the contact in question will be displayed:



    Related