[[TracNav(OntocatGuide)]] = Installation = Javadoc for OntoCAT can be found [http://ontocat.sourceforge.net/doc/index.html 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. 1. Download and install [http://www.eclipse.org/downloads/ Eclipse IDE for Java Developers].[[BR]]Although any other IDE supporting Java will do, the following steps are based on Eclipse.[[BR]][[BR]][[Image(docs_step1.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] 1. Create a new Java project: [[BR]][[BR]][[Image(docs_step2.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] 1. In your new project, lets call it '''Using OntoCAT''', add a '''Lib''' folder to store external libraries: [[BR]][[BR]][[Image(docs_step3.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] 1. Add all the required libraries to your newly created lib folder.[[BR]]An up-to-date list of required external libraries is available from [http://www.ontocat.org/browser/trunk/ontoCAT/lib here].[[BR]]Alternatively you can use the ontocat_with_deps.jar included in the release that has all the dependencies re-packed.[[BR]][[BR]]Don't forget to add the [http://sourceforge.net/projects/ontocat/files/ latest version] of OntoCAT in there as well.[[BR]][[BR]][[Image(docs_step4.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] 1. Right click on the project folder and select properties. a. Go to '''Java Build Path''' section. a. Select '''Libraries''' tab. a. Click '''Add JARs....''' a. Navigate to your project's lib folder and select all the newly copied libraries and click '''OK'''.[[BR]][[BR]][[Image(docs_step5.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] a. If all went well, you should see all the added jars under a new section '''Referenced Libraries''' on the left side in Package Explorer. 1. Add a new class to your project and call it Example: [[BR]][[BR]][[Image(docs_step6.png, link=, 400px, align=center, border=1)]][[BR]][[BR]] 1. Copy the following example code or use any other example provided on the [OntocatGuide Examples] page to test-drive your installation:[[BR]] {{{ #!java 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()); } } } }}} 1. Right click on the Example class in Package Explorer and select '''Run as Java Application'''. 1. All done! You're ready to use OntoCAT.