Old Release

This documentation relates to an old version of VIVO, version 1.10.x. Looking for another version? See all documentation.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Overview

The Data Distribution API is used to create data feeds from your VIVO site by editing a configuration file.

Use data feeds to:

  • provide content to other sites
  • service AJAX requests from your own VIVO pages
  • provide a more responsive user interface on your VIVO site
  • drive visualizations of your VIVO data

Get more use of the data in your VIVO site

  • without opening your site to expensive queries
  • without digging into the internals of VIVO
  • without writing any Java code

You will likely need to know SPARQL, Turtle syntax for RDF, and the structure of your data in VIVO.

For more on the motivation and design philosophy behind the Data Distribution API, see Data Distribution motivation

Hello, World

As a first example, we create an API that can be called to return the text "Hello, World" – not very useful, but shows the basic mechanism for creating and using an API based on a configuration file.  

First, create a Turtle format file in vivo.home/rdf/display/everytime (you may name the file anything you like) containing the following:

@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
  
:data_distributor_hello
    a   <java:edu.cornell.library.scholars.webapp.controller.api.distribute.DataDistributor> ,
        <java:edu.cornell.library.scholars.webapp.controller.api.distribute.examples.HelloDistributor> ;
    :actionName "hello" .

Second, restart Tomcat.  VIVO will reread its everytime content.  The assertions in the Turtle file will be added to VIVO's content triple store.  The API is now ready for use.

Visit the URL:  http://mydomain.edu/api/datarequest/hello

You should see:

Hello, World

in your browser

Managing Configuration Files

Your configuration files will live in vivo.home/rdf/display/everytime

You may wish to use a naming convention to identify Data Distribution API configuration files.

You will want to preserve your configuration files through upgrades and builds of VIVO.  See Preserving Customizations During Build

Reference

  1. VIVO Data Distribution API on GitHub https://cul-it.github.io/vivo-data-distribution-api/
  2. Turtle - Terse RDF Triple Language https://www.w3.org/TeamSubmission/turtle/

  3. SPARQL

  4. VIVO Ontology Reference
  • No labels