|
| 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 1.5 | Minor Change Release (Updated defaults) | July 30, 2009 |
| Version | Notes | Sizes | |
|---|---|---|---|
|
1.5 | Library, Examples, Documentation, and all Source Code | 297KB |
|
1.5 | Library, Examples, and Documentation No Source Code Version |
261KB |
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.
NOTE: Currently, the SKR Batch and Interactive programs have been removed
from the download until changes can be made to the underlying programs to
conform to the current MetaMap. You can use the example in the
Generic_II_Batch.java to run MetaMap by changing the options. If you need
to see what options are available, please look on the MetaMap Interactive
or Batch pages to see what options are available. Currently, you can
run "metamap" which is the default MetaMap 2009 program using 2009AA
data, "metamap08" which is the MetaMap 2008 program using 2008AA data,
or "metamap0809" which uses the MetaMap 2008 program and 2008AB data.
| 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. |
| Generic_II_Batch.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 MetaMap program using the "-% format -E" options. This will cause MetaMap to generate XML output. You can also setup any environment variables that will be needed by the program by setting the Batch_Env field. NOTE: The "-E" option/argument is very important and should be included with whatever program you decided to run! The reason is that this version of the Generic Batch does validation and the -E option tells the various programs to include a marker denoting when a successful result has been found. |
| 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. |
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 30, 2009 | 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 | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||