UsingOntoBuilderforOntologyCreation.docx
《UsingOntoBuilderforOntologyCreation.docx》由会员分享,可在线阅读,更多相关《UsingOntoBuilderforOntologyCreation.docx(12页珍藏版)》请在冰豆网上搜索。
UsingOntoBuilderforOntologyCreation
UsingOntoBuilderforOntologyCreation
Author:
GiovanniModica
Date:
10/25/2018
1.BrowsingFeaturesofOntoBuilder
OntoBuilderwasdesignedtoworklikeawebbrowser.Figure1showstheOntoBuilderbrowserinterface.TonavigatetoapagesimplyentertheURLintotheaddressbar(e.g.)andpressenterorclickthe“Go”button.BydefaultOntoBuilderwillusetheHTTPprotocolwhennoprotocolisspecified,soaURLsuchaswillbeautomaticallychangedto.URLscanalsobeenteredbymeansofcommoncopy/pastecommandseitherbyrightclickingontheaddressbarorusingthehot-keysshortcuts;theseshortcutsarecompatiblewiththeMSWindowsstandards(e.g.crtl-Cforcopy,crtl-Vforpaste,etc.).
Figure1.TheOntoBuilderbrowserinterface.
Oncethe“Go”buttonisclicked,theHTMLpageassociatedwiththeURLwillbedisplayedinthe“HTMLView”panel.OntoBuildermaintainsahistoryofvisitedURLs,whichcanbeaccessedusingacomboboxlistintheaddressbar.Theusercanusethebackwardsandforwardsbuttonsinthetoolboxtonavigatethehistory.Thenumberofentriesinthehistoryislimitedbyanoptioninthetooloptionsdialogasshowninfigure2.Thehistorycanbecleared(allentriesinthehistorywillbedeleted)byclickinginthe“ClearHistory”button.
Figure2.OntoBuilderbrowseroptions.
Othernavigationalaspectscanalsobesetinthe“Browser”optionstab.The“AutomaticMETAnavigation”optionisforpagescontainingredirectionMETAtagssuchasthefollowing:
BycheckingthisoptionOntoBuilderwillautomaticallyloadtheURLspecifiedintheURLattributefortheMETAtag.
TheconnectiontimeoutindicatestheamountoftimetowaitbeforeabandoningaURLconnection.Byspecifying-1sec.,OntoBuilderwillusethesystemdefaultconnectiontimeout.Thisoptionisveryusefulforslowconnectionlinks.
OntoBuildercanalsobedirectedtouseaProxyserverforInternetconnection.Byspecifyingaproxyhostandport,OntoBuilderwillretrieveHTMLpagesthroughtheproxyinsteadofadirectconnection(thedefault).ThisoptionisveryusefulifrunningOntoBuilderbehindfirewalls.
OntoBuilderhassupportforHTMLcookies,howevercookiesdonotpersistoutsideOntoBuilderwizardsessions.Thismeansthatcookiesarepersistentwhileretrievinganontologyusingtheontologycreationwizard,butoncethewizardfinishestheontologygeneration,anycookieinformationwillbelost.
2.GeneratingOntologies
OncethewebpageforwhichwewanttoextracttheontologyfromisloadedinOntoBuilder,wecanlaunchthe“OntologyCreationWizard”byselectingtheappropriatesubmenucommandunderthe“Ontology”menu,orbyclickingtheappropriateiconintheapplicationtoolbox,orbyusingthehot-keycrtl-W.Inordertoshowhowthewizardworkswewillbuildamulti-page(bymulti-pageontologywemeananontologythatisspreadacrossmultiplepages)ontologyfortheAwebsite.Thefirststepofthewizardisshowninfigure3.
Figure3.Thefirststepoftheontologywizard.
TheontologytitledefaultstothetitleoftheHTMLpageandtheontologynamedefaultstothehostfromwheretheHTMLpageisretrieved.Byclickinginthe“Next:
buttonweopenthe“FormSelection”dialogasshowninfigure4.InthisdialogOntoBuilderwillshowalltheHTMLformsoftheHTMLalongwiththeirinputelements.Sinceonlyoneformcanbesubmittedatatimewhilebrowsingawebpage,theuserisrequiredtoselecttheformhe/shewantstosubmitfromtheformslistedunderthe“
Byclickingonanodeinthe“HTMLElements”panel,alltheattributes(defaultvalue,label,etc.)fortheelementrepresentedareshowninthe“Properties”panelinthelowerleft.IsworthnotingthatforHTMLframepages,theFORMelementswillbelocatedunderthe“”nodeinthe“HTMLElements”panel.
Figure4.The“FormSelection”wizarddialog
The“FormPreview”paneliswheretheuserwillentertherequiredvaluesforformsubmission.InordertodeterminewhattherequiredfieldsarewesuggestsimulatingtheprocessononeoftheInternetbrowserssuchasMSInternetExplorerorNetscapeNavigator.Figure5showstheminimumrequiredvaluesforourAexample.
Figure5.ThereservationprocessinA
ThesameprocessmustbesimulatedinOntoBuilder.Figure6showstheequivalentreservationinOntoBuilder.TheonlydifferenceisthatOntoBuilderdoesn’tsubmittheformbyclickingontheformsubmissionbutton,butinsteadbyclickingthe“Next”buttoninthewizard.
Figure6.ThereservationprocessinOntoBuilder
FailingtodothecorrectsimulationinOntoBuilderwillproduceunexpectedresults(mostofthetimesthewebsitewillreturnapageindicatingthatsomeinformationismissingorreturnanerrorpagewithabriefdescription).Generallyspeaking,whenusingOntoBuildertoretrieveanontologyfromawebapplication,theusermustsimulatetheuserinteractionasifworkinginacommonbrowser.
Returningtoourexample,therestofthewizardformsarethesame,excepttheywillcontainnewformelementstobeaddedtothefinalontology.Therestoftheprocessisverystraightforwardsowewilljustmentionhowtogettotheend.Therearefourmorepages(i.e.threemorewizarddialogs)toretrievethewholeontology,andinallfourpagesthereisnorequiredfields,defaultvalueswillbeenough.Alltheuserisrequiredtodoistoselecttheappropriateformonthe“HTMLElements”panelandsimulatetheformsubmissionbyclickingonthe“Continue”buttonineachofthenextthreepages.ThelastpagewillallowtoactuallymakethecarreservationinAvis,asshowninfigure7.
Figure7.Laststepintheontologycreationwizard
Duringthewizardoperationtheusercanusethe“Back”buttontogothepreviouslysubmittedform,incaseamistakewasdetected.Oncefinished,thewizardwilldisplaythegeneratedontologyonthe“MainPanel”,asdepictedinfigure8.Thegeneratedontologycanbesavedindifferentformatsbytheappropriatecommandsinthe“File”menu.
Figure8.Thegeneratedontology
3.EnteringtheRightURLsinOntoBuilder
Sometimes,enteringthesameURLusinginacommonbrowserintoOntoBuilderisnotthemostappropriatethingtodo.DuetoOntoBuilderlimitedHTMLrenderingcapabilities,someURLsmaynotbecorrectlydisplayed(andthus,difficulttonavigate).
Asanexample,considertheAwebsite.ByenteringinOntoBuilderwewillseethatitdoesabadjobinrenderingtheHTMLpage(seefigure9).NoontologywillbegeneratedfromsuchURL.ItisworthnothingthatnotalwaysabadrenderingoftheHTMLpagemeansthatnousefulontologycouldbegenerated,sometimesOntoBuilderhastroublerenderingtheHTMLpagebutthesourcecodeofitisretrievedcorrectly.Isrecommendedtoruntheontologycreationwizardevenifabadrenderingoccurs,inmostcasesthewizardwillidentifytheformelementseveniftheHTMLrenderingdidn’twork.
Figure9.AnexampleofbadHTMLrenderinginOntoBuilder
Inthesecases,itisadvisedtouseanInternetbrowsertoactuallynavigatetothepagewhereontologicalstructuresmaybeidentified.InthecaseofA,byclickinginthe“Rates&Reservations”buttoninthemenuthebrowserwilldisplaythereservationformundertheURL.Figure10showshowthistimeOntoBuildercorrectlyidentifiestheformelementsinthepage.
Figure10.AnexampleofcorrectHTMLrenderinginOntoBuilder
ForHTMLpagescontainingframes,itmaybeusefulto“break”theframesusingtheURLintheframeset.Asanexample,theURLisaHTMLpagecontainingframes(seetheemptyspaceintheuppersectionofthepageinfigure10)anditssourceisthefollowing:
InthiscaseitmaybebettertoentertheURLforthemainFrameframe(i.e.inOntoBuilder,thus“breaking”theframe.AlthoughOntoBuilderisdesignedtosupportframes(foranexampleloadtheNationalCwebsitetoseethreelevelsofframescorrectlyhandledbyOntoBuilder),wesuggesttofollowthepreviouspointswhendealingwithframes.
MostcommonInternetbrowserswillallowtoseethesourceofanHTMLpage.ByusingOntoBuilderyoucanenablethe“SourcePanel”tabtoseetheHTMLsourceoftheloadedpage.Forthis,checkthe“SourcePanel”checkboxinthe“View”taboftheOntoBuilderoptionsdialog.
Figure11.ViewoptionsforOntoBuilder
4.TroubleshootingOntologyGeneration
NotallthewebsitesrunassmoothlyastheAsite.Changesareyouwillnotgetacleanontologyatthefirstrun.ThisisduetothecomplexityofmostwebsitesdesignedusingtechnologiesnotsupportedbyOntoBuilder.AtthistimeOntoBuilderdoesn’tsupportanyscriptingatall.Currentwebsitesrelyonscriptingforvalidation,automaticfieldfilling,etc.AsanexampleconsiderapagethathastwofieldsPickupLocationandDropoffLocation,eachwithanassignedhiddenfield.ByusingscriptingthewebpageautomaticallyassignsthekeywordsameinthehiddenfieldfortheDropoffLocation,indicatingthatthedropofflocationwillbethesameofthepickuplocation.AllthisistransparenttotheuserandalsotoOntoBuilder.Ifth