210 likes | 339 Views
Building, Querying & Personalising RDF Resources. Gunnar Aastrand Grimnes 21 st January, 2003 DDIM Awayday. Overview. Architecture overview. Information agents. Static RDF. Dynamic RDF. Query by Example. Personalisation. Architecture. Evening Agent. Profile Agent. Query By Example.
E N D
Building, Querying & Personalising RDF Resources Gunnar Aastrand Grimnes 21st January, 2003 DDIM Awayday
Overview • Architecture overview. • Information agents. • Static RDF. • Dynamic RDF. • Query by Example. • Personalisation.
Architecture Evening Agent Profile Agent Query By Example RDF Profiles Pub Agent Restaurant Agent Cinema Agent Static RDF Static RDF Generated RDF Scoot.co.uk WWW Perl Hack
The Information Agents • Identical codebase. • RDF config file. • Static and dynamic content. <conf:RDFAgent> <conf:datapath> /home/ggrimnes/jade/data/ </conf:datapath> <conf:datafile>films.rdf</conf:datafile> <conf:datafile>cinemas.rdf</conf:datafile> </conf:RDFAgent>
Static content • Generated either by hand or using Web interface. • Ontologies: • Restaurant, Cinema & Utility from Agentcities. • Pubs, Beer, Eveningplans from Aberdeen.
Web-based RDF Generator • Slow as a dog. • Supports sub/super -class inference. • Limited XML schema datatype support.
Generated RDF <pub:EnglishPub rdf:ID="mypub"> <pub:liveEntertainment rdf:resource="pubs#Never"/> <pub:location> <add:Address rdf:ID="address"> <add:areaName>Mounthooly</add:areaName> <add:buildingName>John Knox Court</add:buildingName> <add:cityName>Aberdeen</add:cityName> <add:countryName>Scotland</add:countryName> <add:doorNumber>7</add:doorNumber> <add:zipCode>AB24 3LF</add:zipCode> <add:locationId> 7, 7</add:locationId> </add:Address> </pub:location> <pub:onLicense>on</pub:onLicense> <pub:pubName>Gunnar's pub</pub:pubName> <pub:pubWebSite>http://www.csd.abdn.ac.uk/pub.php</pub:pubWebSite> <pub:servesBeer rdf:resource="beertypes#grolsch"/> <pub:servesBeer rdf:resource="beertypes#leffeblonde"/> <pub:servesFood>on</pub:servesFood> <pub:telNumber>01224 630538</pub:telNumber> </pub:EnglishPub>
Dynamic Content • Content screen-scraped from Webpage. • RDF generated by Perl script. • Send REQUEST message to make agent reload. • All done in a cron script.
Scoot Example • Belmont • UGC • Lighthouse
Example Film RDF <s:Shows rdf:ID="belmont_BayOfLoveAndSorrowsThe"> <s:time> <s:ShowScheduleCollection> <!-- THUR -> 6:30PM --> <s:consistsOf> <s:ShowSchedule> <s:startTime> <c:Calendar> <c:calendarDate> <c:Date> <c:dateDayOfWeek rdf:resource="calendar#Thursday" /> <c:year>2003</c:year> <c:month>1</c:month> </c:Date> </c:calendarDate> <c:calendarTime> <c:Time> <c:format rdf:resource="calendar#24h"/> <c:timeHour>18</c:timeHour> <c:timeMinute>30</c:timeMinute> </c:Time> </c:calendarTime> </c:Calendar> </s:startTime> </s:ShowSchedule> </s:consistsOf> </s:ShowScheduleCollection> </s:time>
Example Film RDF cont. <s:location rdf:resource="cinemas#belmont" /> <s:show> <s:CinemaPerformance rdf:ID="BayOfLoveAndSorrowsThe"> <s:title>Bay Of Love And Sorrows, The</s:title> <s:wwwInformation>http://scoot.co.uk/info?a=5</s:wwwInformation> <s:origin>Canada</s:origin> <s:duration> <c:Duration> <c:durationHour>1</c:durationHour> <c:durationMinute>35</c:durationMinute> </c:Duration> </s:duration> <s:artist> <s:ArtistCollection> <s:consistsOf> <s:Artist> <s:artistName>Peter Outerbridge</s:artistName> <s:rolevalue rdf:resource="shows_ontology.daml#Actor" /> </s:Artist> </s:consistsOf>... </s:ArtistCollection> </s:artist> <s:description>Certificate: 18</s:description> </s:CinemaPerformance> </s:show> </s:Shows>
RDF Query by Example • RDF for content, RDF for queries. • RDQL is complication to write by hand. • Allows for “smarter” queries than RDQL. • Internal conversion to RDQL. • Different target “audience”: • RDQL for application developers. • QbEx for users of services.
QbEx Conversion to RDQL <q:Query> <q:template> <akt:Academic> <akt:family-name> Brown </akt:family-name> </akt:Academic> </q:template> </q:Query> SELECT ?x WHERE (?x, ?y, ?z), ( ?x, <rdf # type>, <akt # Academic> ), ( ?x, <akt # family-name>, "Brown" )
QbEx with Constraints <q:Query> <q:template> <r:Restaurant> <r:type rdf:resource=“r#Tandoori" /> <r:open-time> <cif:variable rdf:ID="x"> <cif:varname>x</cif:varname> </cif:variable> </r:open-time> </r:Restaurant> </q:template> <q:constraints> <cif:comparison> <cif:comparison_operator>></cif:comparison_operator> <cif:comparison_op1> <cif:variable rdf:about="#x"/> </cif:comparison_op1> <cif:comparison_op2> <cif:integerconst> <cif:constant_value>1900</cif:constant_value> .. . . • Based on Kit’s RDF encoding of CIF.
QbEx Constraints Converted SELECT ?x WHERE (?x, ?y, ?z), ( ?x, <r # open-time>, ?v_x ), ( ?x, <rdf # type>, <r # restaurant> ), ( ?x, <r # type>, <r # Tandoori> ) AND ( ?v_x > 1900 ) • Supports CIF operators, but no function calls or set operators. • RDQL supports regexp matching, could be useful addition to CIF?
QbEx • What triples should be returned? • What inference could be performed? • Sub classes and properties. • DAML or OWL support? • XML schema datatypes? • More information and downloads at: http://www.csd.abdn.ac.uk/research/AgentCities/QueryByExample
Personalisation • Limited at the moment. • Architecture allows for more sophisticated solutions. • Info from EveningAgent to Profile Agent: • Any supplied user preferences. • F.x: pub that serves “Boddington’s” • Any evening plans turned down. • The final accepted evening plan.
Example RDF Profile <ep:User rdf:about='profileagent#pedwards'> <ep:name>pedwards</ep:name> <ep:pword>****</ep:pword> <ep:preferences> pubs: [ serves="mcewans80" ] pubs: [ serves="mcewans80" ] pubs: [ serves="mcewans80" ] cinemas: [ film="LordOfTheRingsTheTwoTowers" ] </ep:preferences> </ep:User>
PersonalisationThe Future… • Granite Nights was always meant as a personalisation test-bed. • Explore the use of different ML algorithms on semantically marked up data: • Explanation Based Generalisation • Case-Based Learning • Create artificial datasets by creating client agents with specific preferences. • F.x. simulate a geek agent: scifi films & fish’n’chips food.