Jena 本体资源操作接口Interface OntResource

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Jena本体资源操作接口InterfaceOntResourceProvidesacommonsuper-typeforalloftheabstractionsinthisontologyrepresentationpackage.getOntModelOntModelgetOntModel()Answerthemodelthatthisresourceisattachedto,assumingthatitisanOntModel.Ifthisresourceisnotattachedtoanymodel,oris(unusually)attachedtoamodelthatisnotanOntModel,answernull.Returns:Theontmodelthatthisresourceisattachedto,ornull.getProfileProfilegetProfile()Answertheontologylanguageprofilethatgovernstheontologymodeltowhichthisontologyresourceisattached.Returns:ThelanguageprofileforthisontologyresourceThrows:JenaException-iftheresourceisnotboundtoanOntModel,sincethat'stheonlywaytogettheprofilefortheresourceisOntLanguageTermbooleanisOntLanguageTerm()AnswertrueifthisresourceisasymbolinoneofthestandardontologylanguagessupportedbyJena:RDF,RDFS,OWLorDAML+OIL.Sincetheselanguageshaverestrictednamespaces,thischeckissimplyaconvenientwayoftestingwhetherthisresourceisinoneofthosepre-declarednamespaces.Returns:TrueifthisisaterminthelanguagenamespaceforOWL,RDF,RDFSorDAML+OIL.setSameAsvoidsetSameAs(Resourceres)Assertequivalencebetweenthegivenresourceandthisresource.AnyexistingstatementsforsameAswillberemoved.Parameters:res-TheresourcethatisdeclaredtobethesameasthisresourceThrows:OntProfileException-IftheProfile.SAME_AS()propertyisnotsupportedinthecurrentlanguageprofile.addSameAsvoidaddSameAs(Resourceres)Addaresourcethatisdeclaredtobeequivalenttothisresource.Parameters:res-AresourcethatdeclaredtobethesameasthisresourceThrows:OntProfileException-IftheProfile.SAME_AS()propertyisnotsupportedinthecurrentlanguageprofile.getSameAsOntResourcegetSameAs()Answeraresourcethatisdeclaredtobethesameasthisresource.Ifthereismorethanonesuchresource,anarbitraryselectionismade.Returns:AnontresourcethatdeclaredtobethesameasthisresourceThrows:OntProfileException-IftheProfile.SAME_AS()propertyisnotsupportedinthecurrentlanguageprofile.listSameAsExtendedIteratorlistSameAs()Answeraniteratoroveralloftheresourcesthataredeclaredtobethesameasthisresource.EachelementoftheiteratorwillbeanOntResource.Returns:Aniteratorovertheresourcesequivalenttothisresource.Throws:OntProfileException-IftheProfile.SAME_AS()propertyisnotsupportedinthecurrentlanguageprofile.isSameAsbooleanisSameAs(Resourceres)Answertrueifthisresourceisthesameasthegivenresource.Parameters:res-AresourcetotestagainstReturns:TrueiftheresourcesaredeclaredthesameviaasameAsstatement.Throws:OntProfileException-IftheProfile.SAME_AS()propertyisnotsupportedinthecurrentlanguageprofile.removeSameAsvoidremoveSameAs(Resourceres)Removethestatementthatthisresourceisthesameasthegivenresource.Ifthisstatementisnottrueofthecurrentmodel,nothinghappens.Parameters:res-AresourcethatmaybedeclaredtobethesameAsthisresourcesetDifferentFromvoidsetDifferentFrom(Resourceres)Assertthatthegivenresourceandthisresourcearedistinct.AnyexistingstatementsfordifferentFromwillberemoved.Parameters:res-TheresourcethatisdeclaredtobedistinctfromthisresourceThrows:OntProfileException-IftheProfile.DIFFERENT_FROM()propertyisnotsupportedinthecurrentlanguageprofile.addDifferentFromvoidaddDifferentFrom(Resourceres)Addaresourcethatisdeclaredtobeequivalenttothisresource.Parameters:res-AresourcethatdeclaredtobethesameasthisresourceThrows:OntProfileException-IftheProfile.DIFFERENT_FROM()propertyisnotsupportedinthecurrentlanguageprofile.getDifferentFromOntResourcegetDifferentFrom()Answeraresourcethatisdeclaredtobedistinctfromthisresource.Ifthereismorethanonesuchresource,anarbitraryselectionismade.Returns:resAnontresourcethatdeclaredtobedifferentfromthisresourceThrows:OntProfileException-IftheProfile.DIFFERENT_FROM()propertyisnotsupportedinthecurrentlanguageprofile.listDifferentFromExtendedIteratorlistDifferentFrom()Answeraniteratoroveralloftheresourcesthataredeclaredtobedifferentfromthisresource.EachelementoftheiteratorwillbeanOntResource.Returns:Aniteratorovertheresourcesdifferentfromthisresource.Throws:OntProfileException-IftheProfile.DIFFERENT_FROM()propertyisnotsupportedinthecurrentlanguageprofile.isDifferentFrombooleanisDifferentFrom(Resourceres)Answertrueifthisresourceisdifferentfromthegivenresource.Parameters:res-AresourcetotestagainstReturns:TrueiftheresourcesaredeclaredtobedistinctviaadifferentFromstatement.removeDifferentFromvoidremoveDifferentFrom(Resourceres)Removethestatementthatthisresourceisdifferentthegivenresource.Ifthisstatementisnottrueofthecurrentmodel,nothinghappens.Parameters:res-AresourcethatmaybedeclaredtobedifferentFromthisresourcesetSeeAlsovoidsetSeeAlso(Resourceres)AssertthatthegivenresourceprovidesadditionalinformationaboutthedefinitionofthisresourceParameters:res-AresourcethatcanprovideadditionalinformationaboutthisresourceThrows:OntProfileException-IftheProfile.SEE_ALSO()propertyisnotsupportedinthecurrentlanguageprofile.addSeeAlsovoidaddSeeAlso(Resourceres)AddaresourcethatisdeclaredtoprovidedadditionalinformationaboutthedefinitionofthisresourceParameters:res-AresourcethatprovidesextrainformationonthisresourceThrows:OntProfileException-IftheProfile.SEE_ALSO()propertyisnotsupp

1 / 28
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功