Installation
Javadoc for OntoCAT can be found here (Note that javadoc is also included with the release).
In order to use OntoCAT in your own applications, you should download the latest binary release and ensure that all of the jar files are in the application class path. Please see the next section for detailed instructions.
Getting started
Below are step-by-step instructions on how to get started with OntoCAT.
If you're a proficient Java programmer you may consider skipping to step 4.
- Download and install Eclipse IDE for Java Developers.
Although any other IDE supporting Java will do, the following steps are based on Eclipse.
- Create a new Java project:
- In your new project, lets call it Using OntoCAT, add a Lib folder to store external libraries:
- Add all the required libraries to your newly created lib folder.
An up-to-date list of required external libraries is available from here.
Alternatively you can use the ontocat_with_deps.jar included in the release that has all the dependencies re-packed.
Don't forget to add the latest version of OntoCAT in there as well.
- Right click on the project folder and select properties.
- Go to Java Build Path section.
- Select Libraries tab.
- Click Add JARs....
- Navigate to your project's lib folder and select all the newly copied libraries and click OK.
- If all went well, you should see all the added jars under a new section Referenced Libraries on the left side in Package Explorer.
- Add a new class to your project and call it Example:
- Copy the following example code or use any other example provided on the Examples page to test-drive your installation:
import uk.ac.ebi.ontocat.Ontology; import uk.ac.ebi.ontocat.OntologyService; import uk.ac.ebi.ontocat.OntologyServiceException; import uk.ac.ebi.ontocat.ols.OlsOntologyService; /** * Example 1 * * Shows how to list all the available ontologies in OLS * */ public class Example { public static void main(String[] args) throws OntologyServiceException { // Instantiate OLS service OntologyService os = new OlsOntologyService(); // For all ontologies in OLS print their // full label and abbreviation for (Ontology o : os.getOntologies()) { StringBuilder sb = new StringBuilder(); sb.append(o.getAbbreviation()); sb.append("\t"); sb.append(o.getLabel()); System.out.println(sb.toString()); } } }
- Right click on the Example class in Package Explorer and select Run as Java Application.
- All done! You're ready to use OntoCAT.
Last modified 9 years ago
Last modified on 2015-07-21T20:04:08+02:00
Attachments (6)
- docs_step1.png (26.2 KB) - added by 9 years ago.
- docs_step2.png (24.2 KB) - added by 9 years ago.
- docs_step3.png (22.8 KB) - added by 9 years ago.
- docs_step4.png (10.1 KB) - added by 9 years ago.
- docs_step5.png (35.5 KB) - added by 9 years ago.
- docs_step6.png (25.6 KB) - added by 9 years ago.
Download all attachments as: .zip