Overview

 The next step of a typical harvest is the translation. The fetched data will be in its own format, and this needs to be converted into VIVO-compatible triples. If the input is an XML format, this can be done using the XSLTranslator tool and a .xsl file containing XSLT code specific to the data format being converted to RDF/XML triples.  Included with Harvester in the config/datamaps/ directory are several pre-written XSLT files for frequently-needed formats (including for example Pubmed). Another standard method in harvesting data is to prepare a SPARQL Construct using the VIVO UI that will take in RDF data and transform it into the VIVO ontology. You can use the SPARQL Translator to process SPARQL Construct files against target models.This is the abstract method for the Translate Framework of the VIVO Harvester. This contains the main requirements of each VIVO Harvester, inStream and outStream, and stubs for the main methods that the other translators should overwrite.

Extended by:

States

Main Default Flow for most Translators

Properties

Name

Type

Visibility

Description

inStream

InputStream

protected

the stream where data will be feed to the translator

outStream

OutputStream

protected

the stream where data will be sent back to the caller

Execution

Most Translators have two modes of execution, straight file translation and using record handlers. Parameters for execution follow the format InFile/InRecordHandler, translationFile, OutFile/OutRecordHandler. Current supported switches are -xsl for XSLTranslator, -gloze for GlozeTranslator, and -rdf for RDFTranslator. Each of those classes require you to add to the - extension the sub type of execution (file or record handler)

Ex.

java translator -xslf 1234567.xml PubMedToXML.xsl

java translator -xslrh pubmedRH.xml PubMedToXML.xsl pubmedRDFRH.xml

Methods

setInStream

inputs

OutputStream

outputs

None

flow

set global variable inStream equal to the InputStream

Allows you to reset the inputstream in case you are using this method for several different inputs

setOutStream

inputs

InputStream

outputs

None

flow

set global variable outStream equal to the OutputStream

Allows you to reset the outputstream in case you are using this method for several different outputs

execute

inputs

None

outputs

None

flow

check for properties

true:

log start

log end

false:

throw IllegalArgumentException |

The execute method actually doesn't do anything more than check for the required inputs and let the user know that the Translator class is an abstract class.

main

\ style="border-spacing:0;"

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

Arguments

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

switch statement

additoinal arguments are variable based on sub class

-

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

Returned

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

Variable based on sub class

-

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

flow

style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

  1. check for switch
    1. starts with -xsl
      1. remove the xsl
      2. create xsl translator
      3. pass args to xsl translator for execution
    2. starts with -gloze
    3. starts with -rdf

-

colspan="2" style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;"

The main method, allows for a switch to the appropriate library of execution.