Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First, create a Turtle format file in vivo.home<vivo-home>/rdf/display/everytime . You may name the file anything you like.  All example files are in Turtle format.  Turtle files typically have a .ttl file type.  Your file should contain the following:

...

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.

Third, visit the URL:  http://mydomain.edu/api/datarequest/hello

You should see:

Code Block
Hello, World

in your browser.

Parameters

The HelloDistributor supports a name parameter which can be specified in the call:

Visit http://mydomain.edu/api/datarequest/hello?name=Bob

You should see:

Code Block
Hello, Bob

in your browser.

...

.

The Data Distribution API supports parameterized requests, making it ideal for getting data about a particular person, a particular publication, all the people in a particular department, and so on.

How to Read the Configuration File

The configuration file begins with a prefix, this is required. Prefixes provide shortcuts for URIs used in RDF.  See the Turtle reference for additional background and examples.

Following are two assertions of type for a new entity with the URI :data_distributor_hello.  You can use any URI for your data distributor entity.  You will need to use unique URI for each data distributor entity you create, so a naming convention (see below) may be helpful.

...

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

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

...

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

  3. Learning SPARQL http://learningsparql.com 

  4. VIVO Ontology Reference