100 likes | 241 Views
Using DCGs for Large Tasks. Web Site Synthesis. Conventional Site Management. CISA Web site. Editor. Synthesis-based Site Management. Web site generator. Research institute ontology. CISA Web site. CISA knowledge base. Editor. Economics of Content Management.
E N D
Using DCGs for Large Tasks Web Site Synthesis
Conventional Site Management CISA Web site Editor
Synthesis-based Site Management Web site generator Research institute ontology CISA Web site CISA knowledge base Editor
Economics of Content Management Time to benefit (3 months for CISA site) Conventional editing Effort Automated synthesis Time
CISA Knowledge Base Contains facts and DCG rules like this: person('David Robertson', 'http://www.dai.ed.ac.uk/groups/ssp/members/dave.htm', [staff]). research_group('Software Systems and Processes', 'http://www.dai.ed.ac.uk/groups/ssp'). postal_address --> [ref('http://www.informatics.ed.ac.uk','Division of Informatics'), \\, ref('http://www.ed.ac.uk','University of Edinburgh'),\\, ‘Appleton Tower', \\, 'Edinburgh', \\, 'UK', \\].
Site Generator gen_site :- phrase(group_site, Pages), gen_pages(Pages). gen_pages([Page|T]) :- gen_page(Page), gen_pages(T). gen_pages([]). gen_page(page(File, Terms)) :- html2terms(Chars, Terms), tell(File), put_string(Chars), told. Connects to DCG Generates HTML string Opens file Writes string to output Closes file
Top-level DCG for site group_site --> {…Goals defining main page IDs and a navigator structure…}, main_pages(Main, NavTerm), {…Goals generating lists of events...}. event_pages(EventLists, NavTerm), {…Goals generating list of seminar talks…}, abstract_pages(TalksList).
Generating Main Site Pages main_pages([(Type,File)|T], Navigator) --> {Page =.. [Type,Navigator,Contents,[]], call(Page)}, [page(File, Contents)], main_pages(T, Navigator). main_pages([], _) --> [].
Home Page index(Navigator) --> {start_page(Start, []), phrase(home_body(Navigator), Body), style_sheet(Style, []), page_background(BGr)}, [Start, head([title('CISA Home Page'), Style]), body(BGr, Body), end]. home_body(Navigator) --> standard_heading(Navigator), group_focus, standard_foot('<hr>').
…Down to Definitions Close to HTML standard_heading(Navigator) --> [ '<table width = 100%> <tr> <td> <center> <h1>Centre for Intelligent Systems and their Applications</h1> </center> </td> <td valign=top><a href="http://www.ed.ac.uk"><img src="img/logo/uoe-mono-100x100.gif" border=0 alt="UoE" name="UoE" align=right hspace=10 width=100 height=100></a> </td> </tr> </table> <p>', Navigator, \\, \\, \\].