• Topic
  • Discussion
  • ODS.OdsBriefcaseGoogleDrive(Last) -- DAVWikiAdmin? , 2019-06-25 07:57:45 Edit WebDAV System Administrator 2019-06-25 07:57:45

    Using ODS-Briefcase to mediate access to data stored in Google Drive


    Google Drive is a way to store your files on Google's servers, or in the Cloud. If you run the free Google Drive application, then you get a folder on your computer (Windows or Mac OS X) that looks just like a directory on your hard disk that you can drag your files in to. Anything stored in that folder is kept on your hard disk and is also copied to your account in the cloud. You can access those files through drive.google.com or from other computers, including mobile devices.

    Google Drive file storage offers users a number of features:

    • flexibility: the synchronization can be performed from different devices or using the web version.
    • free 5 MB storage by default: can be extended with pay option
    • usable as backup service
    • your resources are encrypted

    ODS Briefcase offers a new "GDrive" folder type which provides several additional features, once the ODS system is configured with a registered Google API key and secret pair:

    • Specify credentials for authentication against Google Drive, enabling retrieval of any or all of your folders and files, including any associated metadata
    • Specify which Sponger Extractor Cartridges and Sponger Meta Cartridges should be run against your GDrive data
    • Save fetched data, metadata, and Sponger output, into a newly created GDrive-specific RDF Graph in the Virtuoso RDF Quad Store
    • Specify other ODS Users or WebID-based ACLs which should be granted access to your GDrive data through ODS Briefcase


    Here is a sample scenario showing the whole process, from setting the Google Drive API key and secret pair in ODS, to retrieving all Google Drive content to ODS Briefcase.



    1 - Get a Google Drive API key and secret pair for use with ODS-Briefcase

    Note that at present, each Virtuoso + ODS instance can only be configured with a single Google Drive API key, which will then be used by all ODS-Briefcase users when targeting Google Drive from that instance. Google imposes limitations on the API key's use (currently set to 500,000 requests/day). This limitation is outside the scope of OpenLink or Virtuoso control.
    1. If this is your first Google API Project, click the Create Project button:

    2. If you already have some Google API Projects, select Create Project from the Project menu.
    3. Make sure you have your project picked, then click Create Credentials and choose OAuth client ID:

    4. A form will appear on the next page. For the Application Type, choose Web application.

      Edit the Authorized Redirect URI to contain ODS Callback URL: https://[Host][Port]/val/api/thirdparty_callback

    5. Click Create and you?ll receive a Client ID and Client Secret. Save these values to use later. You?ll need them for all of your application?s interactions with Google.

    6. Select Library to choose the needed APIs

    7. Select and enable Google Drive API

    2 - Configure ODS to use your Google API key and secret

    1. Browse to your Virtuoso + ODS instance, http://<cname>[:<port>]/ods, e.g., <http://example.com/ods/>, and click Sign In.

    2. Log in as a Virtuoso+ODS user with Administrator privileges, e.g., dba.

    3. Click on Site Settings:

    4. Click on Login Authentication Keys:

    5. Select Google API in the API Name menu, provide the Email address and Client secret from the new Client ID for web applications you created above, and click Add.

    6. ODS-Briefcase is now configured to use the Google API.

    3 - Access files stored on Google Drive through ODS-Briefcase

    1. Browse to your Virtuoso + ODS instance, http://<cname>[:<port>]/ods, e.g., <http://example.com/ods/>.

    2. Log in as a Virtuoso+ODS user with normal privileges, e.g., demo.

    3. Click to the ODS-Briefcase application:

    4. Click New Folder from the main Briefcase control strip:

    5. In the New Folder form, specify a Folder Name, e.g., MyGoogleDriveFolder, and set the Folder type to Google Drive:

    6. Click to the newly visible Google Drive tab:

    7. All RDF data extracted from and otherwise collected about your Google Drive files will be saved to a named graph, where the default name is constructed from the host ODS instance, the ODS username, and the Briefcase folder name -- http://<host>[:<port>]/DAV/home/<user-name>/<folder-name>#this -- so, in this example, the default graph would be named <http://example.com/ods/demo/MyGoogleDriveFolder#this>. Expert users may wish to change this graph name, but the default is suitable for most users.

    8. You can also turn on the Virtuoso Sponger, to process your Google Drive files more comprehensively. When the Sponger is enabled for your folder, you can specify which "Sponger Extractor Cartridges" and "Sponger Meta Cartridges" will be run over the files in your Google Drive. You can enable all cartridges, but this will introduce some processing overhead. It's generally best to enable only those cartridges which will be applicable to your files and their content. For instance, you may know that you'll only be storing Microsoft and Open Office documents here. Then, click "Authenticate", to connect your new folder to your Google Drive:

    9. You'll be prompted to enter your Google Drive user's credentials. Note that this Google Drive user need not be the application owner/"developer" who got the API key earlier.

    10. Google will prompt for confirmation that you intend to let your application ("MyODSGoogleDrive?") have access to your Google Drive content. Click Allow access.

    11. Your Google user name and associated email address will now be displayed. Click Create to finish the folder creation process.

    12. Your new Google Drive-linked folder should now be displayed in your Briefcase resources list:

    13. Click the folder name to see the resources ODS-Briefcase has found in your Google Drive Dataspace: