JenaOntologyAPIInthissectionIwillgiveageneralintroductiontothetheJena2ontologyAPI.I'llalsodescribearangeofcommonusertasks.Iwon'tgointoallofthemanydetailsoftheAPIhere:youshouldexpecttorefertotheJena2JavadoctogetfulldetailsofthecapabilitiesoftheAPI.Feedback,(viathejena-devsupportlist)iswelcomed.PrerequisitesIwillassumethatyouhaveabasicfamiliaritywithRDFandwithJena.TherearemanyotherJenahelpdocumentsyoucanreadforbackgroundonthesetopics.ThereisalsoaJenaprogrammingtutorialyoucanfollowthrough.Jenaisaprogrammingtoolkit,usingtheJavaprogramminglanguage.Whilethereareafewcommand-linetoolstohelpyouperformsomekeytasksusingJena,mostlyyouuseJenabywritingJavaprograms.Theexamplesinthisdocumentwillbeprimarilycodesamples.Ialsowon'tbeexplainingtheOWLorRDFSontologylanguagesinmuchdetailinthisdocument.Youshouldexpecttorefertosupportingdocumentationfordetailsonthoselanguages,forexampletheW3COWLdocumentindex.Note:Atthetimeofwriting,workonOWLversion1.1isstillunderway.NodecisionhasyetbeenmadeaboutwhenJenawillsupportthenewOWL1.1features.IwillonlyuseOWL1.0featuresinthisdocument.OverviewThesectionofthemanualisbrokenintoanumberofsections.Youdonotneedtoreadtheminsequence,thoughlatersectionsmayrefertoconceptsandtechniquesintroducedinearliersections.Thesectionsare:1.Overview2.Generalconcepts3.Runningexample:theESWContology4.Creatingontologymodels5.Compoundontologydocumentsandimportsprocessing6.Thegenericontologytype:OntResource7.Ontologyclassesandbasicclassexpressions8.Ontologyproperties9.Morecomplexclassexpressions10.Instancesorindividuals11.Ontologymeta-data12.Ontologyinference:overview13.WorkingwithDAML+OILontologies14.Workingwithpersistentontologies15.Experimentalontologytools16.CommonontologyapplicationproblemsandsampleprogramsFurtherassistanceIhopethatthisdocumentwillbesufficienttohelpmostreaderstogetstartedusingtheJenaontologyAPI.Forfurthersupport,pleasepostquestionstotheJenasupportlist:jena-dev@yahoogroups.YoucanalsoreportbugsdirectlyintotheJenabugtrackeronSourceForge.Pleasenotethatweaskthatyouusethesupportlistorthebug-trackertocommunicatewiththeJenateam,ratherthansendemailtotheteammembersdirectly.ThishelpsusmanageJenasupportmoreeffectively,andfacilitatescontributionsfromotherJenacommunitymembers.GeneralconceptsInawidely-quoteddefinition,anontologyis…aspecificationofaconceptualization[Gruber,T.1993]Let'sunpackthatbriefcharacterisationabit.Itmeansthatanontologyallowsaprogrammertospecify,inanopen,meaningful,waytheconceptsandrelationshipsthatcollectivelycharacterisesomedomain.Examplesmightbetheconceptsofredandwhitewine,grapevarieties,vintageyears,wineriesandsoforththatcharacterisethedomainof'wine',andrelationshipssuchas'wineriesproducewines','wineshaveayearofproduction'.Thiswineontologymightbedevelopedinitiallyforaparticularapplication,suchasastock-controlsystematawinewarehouse.Assuch,itmaybeconsideredsimilartoawell-defineddatabaseschema.Theadvantagetoanontologyisthatitisanexplicit,first-classdescription.Sohavingbeendevelopedforonepurpose,itcanbepublishedandreusedforotherpurposes.Forexample,agivenwinerymayusethewineontologytolinkitsproductionscheduletothestocksystematthewinewarehouse.Alternatively,awinerecommendationprogrammayusethewineontology,andadescription(ontology)ofdifferentdishestorecommendwinesforagivenmenu.Therearemanywaysofwritingdownanontology,andavarietyofopinionsastowhatkindsofdefinitionshouldgoinone.Inpractice,thecontentsofanontologyarelargelydrivenbythekindsofapplicationitwillbeusedtosupport.InJena,wedonottakeaparticularviewontheminimalornecessarycomponentsofanontology.Rather,wetrytosupportavarietyofcommontechniques.InthismanualItrytoexplainwhatis–andtosomeextentwhatisn't–possibleusingJena'sontologysupport.SinceJenaisfundamentallyanRDFplatform,Jena'sontologysupportislimitedtoontologyformalismsbuiltontopofRDF.SpecificallythismeansRDFS,thevarietiesofOWL,andthenow-obsoleteDAML+OIL.Iwillprovideaverybriefintroductiontotheselanguageshere.Pleaserefertotheextensiveon-linedocumentationfortheseformalismsforcompleteandauthoritativedetail.RDFSRDFSistheweakestontologylanguagesupportedbyJena.RDFSallowstheontologisttobuildasimplehierarchyofconcepts,andahierarchyofproperties.Considerthefollowingtrivialcharacterisation(withapologiestobiology-trainedreaders!):Table1:AsimpleconcepthierarchyUsingRDFS,Icansaythatmyontologyhasfiveclasses,andthatPlantisasub-classofOrganismandsoon.Soeveryanimalisalsoanorganism.Agoodwaytothinkoftheseclassesisasdescribingsetsofindividuals:organismisintendedtodescribeasetoflivingthings,someofwhichareanimals(i.e.asub-setofthesetoforganismsisthesetofanimals),andsomeanimalsarefish(asubsetofthesetofallanimalsisthesetofallfish).Todescribetheattributesoftheseclasses,Icanassociatepropertieswiththeclasses.Forexample,animalshavesensoryorgans(noses,eyes,etc.).AgeneralpropertyofananimalmightbesenseOrgan,todenoteanygivensensoryorgansaparticularanimalhas.Ingeneral,fishhaveeyes,soafishmighthaveaeyespropertytorefertoadescriptionoftheparticulareyestructureofsomespecies.Sinceeyesareatypeofsensoryorgan,wecancapturethisrelationshipbe