Home | NLM » LHNCBC » SKR » API |
Please Note
This software is produced by an agency of the U.S. Government, and
by statute is not subject to copyright in the United States. Recipients
of this software assume all responsibilities associated with its
operation, modification, and maintenance.
|
Please Note:
Users are responsible for compliance with the
UMLS copyright restrictions.
To use this application, you must have signed the UMLS agreement. The UMLS agreement requires those who use the UMLS to file a brief report once a year to summarize their use of the UMLS. It also requires the acknowledgment that the UMLS contains copyrighted material and that those copyright restrictions be respected. The UMLS agreement requires users to agree to obtain agreements for EACH copyrighted source prior to it's use within a commercial or production application. |
Change History | ||
---|---|---|
Version 1.3 | Initial Public Release | September 6, 2007 |
Version 1.4 | Minor Change Release (Updated defaults) | July 2, 2008 |
Version | Notes | Sizes | |
---|---|---|---|
1.4 | Library, Examples, Documentation, and all Source Code | (302KB) [1059KB] |
|
1.4 | Library, Examples, and Documentation No Source Code Version |
(241KB) [863KB] |
The SKR API has been designed to allow you to interact with our web-based Scheduler using either our Batch or Interactive facilities.
There are several example files included to show the various ways to access the
SKR Scheduler routines. These are all located in the Examples directory.
SKRBatch.java: Example program for submitting a new SKR Batch job
request to the Scheduler to run. You will be prompted for your username
and password and if they are alright, the job is submitted to the
Scheduler and the results are returned in the String "results" below.
This example shows how to setup a basic SKR Batch job with a small file (medlin25.txt) with ASCII MEDLINE formatted citations as input data. You must set the Email_Address variable and use the UpLoad_File to specify the data to be processed. This example also shows the user setting the silentEmail option which tells the Scheduler to NOT send email upon completing the job. This example also shows one way to setup which arguments you want to use for the SKR program ("mySKRObj.setArgs("-ApcsmtDalbIr 980 -n");". This tells SKR to use our normal options (-ApcsmtDalb) and additionally, use the -I (show CUIs), -r 980 (threshold), and -n (number Candidates). The result that comes back from SKR is then just printed to the standard output. |
SKRInteractive.java: Example program for submitting a new SKR
Interactive job request to the Scheduler to run. You will be prompted
for your username and password and if they are alright, the job is run
and the results are returned in the String "results" below.
This example shows how to setup a basic SKR Interactive job with a short sentence of free text as input data. You must set the Email_Address variable and use the APIText variable to specify the data to be processed. This example also shows one way to setup which arguments you want to use for the SKR program ("mySKRObj.setArgs("-ApcsmtDalbIr 980 -n");". This tells SKR to use our normal options (-ApcsmtDalb) and additionally, use the -I (show CUIs), -r 980 (threshold), and -n (number Candidates). The result that comes back from SKR is then just printed to the standard output. |
SKR_II_Interactive.java: This example displays an alternate method of setting up which arguments you want to use for the SKR program by using the setField method instead of the setArgs method. This version sets the exact same arguments as the SKRInteractive program and receives the same results back. |
MTIBatch.java:
Example program for submitting a new MTI Batch job request to the
Scheduler to run. You will be prompted for your username and password
and if they are alright, the job is submitted to the Scheduler and the
results are returned in the String "results" below.
This example shows how to setup a basic MTI Batch job with a small file (medlin25.txt) with ASCII MEDLINE formatted citations as input data. You must set the Email_Address variable and use the UpLoad_File to specify the data to be processed. This example also shows the user setting the silentEmail option which tells the Scheduler to NOT send email upon completing the job. This example also shows one way to setup which arguments you want to use for the MTI program ("myMTIObj.setArgs("-opt1_DCMS");". This tells MTI to use the opt1 variant of our DCMS processing options to process our data. The results that come back from MTI are then just printed to the standard output. |
MTIInteractive.java:
Example program for submitting a new MTI Interactive job request to the
Scheduler to run. You will be prompted for your username and password
and if they are alright, the job is submitted to the Scheduler and the
results are returned in the String "results" below.
This example shows how to setup a basic MTI Interactive job with a short sentence of free text as input data. You must set the Email_Address variable and use the APIText variable to specify the data to be processed. This example also shows one way to setup which arguments you want to use for the MTI program ("myMTIObj.setArgs("-opt1_DCMS -display_full");". This tells MTI to use the opt1 variant of our DCMS processing options to process our data and then to display all of the possible terms (-display_full) inorder instead of the default max of 25. The result that comes back from MTI is then just printed to the standard output. |
SemRepBatch.java:
Example program for submitting a new SemRep Batch job request to the
Scheduler to run. You will be prompted for your username and password
and if they are alright, the job is submitted to the Scheduler and the
results are returned in the String "results" below.
This example shows how to setup a basic SemRep Batch job with a small file (medlin25.txt) with ASCII MEDLINE formatted citations as input data. You must set the Email_Address variable and use the UpLoad_File to specify the data to be processed. This example also shows the user setting the silentEmail option which tells the Scheduler to NOT send email upon completing the job. This example also shows one way to setup which arguments you want to use for the SemRep program ("mySemRepObj.setArgs("-D");". This tells SemRep to use the "Full Fielded Output" when processing the data. The results that come back from SemRep are then just printed to the standard output. |
SemGenBatch.java
Example program for submitting a new SemGen Batch job request to the
Scheduler to run. You will be prompted for your username and password
and if they are alright, the job is submitted to the Scheduler and the
results are returned in the String "results" below.
This example shows an alternate method to specifying which file to upload. This example reads in the small file (medlin25.txt) with ASCII MEDLINE formatted citations as input data and builds a String with the data which is then sent to the Scheduler instead of the file reference. You must set the Email_Address variable and use the APIText variable to specify the data to be processed. This example also shows that the user did not specify the silentEmail option, so they will have a notification email sent to the address in the Email_Address specification. This example also has SemGen using just the default setup when processing the data. The results that come back from SemGen are then just printed to the standard output. |
GenericBatch.java
Example program for submitting a new Generic Batch with Validation job
("GenericObject(true)" turns on validation) request to the Scheduler to
run. You will be prompted for your username and password and if they
are alright, the job is submitted to the Scheduler and the results are
returned in the String "results" below.
NOTE: There is no Interactive facility for Generic jobs at this point. This example shows how to setup a basic Generic Batch with Validation job with a small file (medlin25.txt) with ASCII MEDLINE formatted citations as input data. You must set the Email_Address variable and use the UpLoad_File to specify the data to be processed. This example also shows the user setting the silentEmail option which tells the Scheduler to NOT send email upon completing the job. This example is set to run the MTI (Medical Text Indexer) program using the -opt1_DCMS and -E options. You can also setup any environment variables that will be needed by the program by setting the Batch_Env field. |
SKRObject mySKRObj = new SKRObject();
mySKRObj.setField("Email_Address", "yourEmailAddress");
mySKRObj.setField("silentEmail", true);
mySKRObj.setField("UpLoad_File", "./medlin25.txt");
mySKRObj.setArgs("-Ir 980 -n");
mySKRObj.setField("show_cuis", true);
mySKRObj.setField("threshold", "980");
mySKRObj.setField("number_the_candidates", true);
try
{
String results = mySKRObj.handleSubmission();
System.out.print(results);
} catch (RuntimeException ex) {
System.err.println("");
System.err.print("An ERROR has occurred while processing your");
System.err.println(" request, please review any");
System.err.print("lines beginning with \"Error:\" above and the");
System.err.println(" trace below for indications of");
System.err.println("what may have gone wrong.");
System.err.println("");
System.err.println("Trace:");
ex.printStackTrace();
} // catch
Last Modified: July 03, 2008 | ii-public | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Lister Hill National Center for Biomedical Communications | U.S. National Library of Medicine | National Institutes of Health | ||||||||||||||||||||||||||
Department of Health and Human Services | ||||||||||||||||||||||||||||
|