=Paper= {{Paper |id=Vol-209/paper-4 |storemode=property |title=Using WEESA to Semantically Annotate Cocoon |pdfUrl=https://ceur-ws.org/Vol-209/saaw06-full07-reif.pdf |volume=Vol-209 |dblpUrl=https://dblp.org/rec/conf/semweb/ReifG06 }} ==Using WEESA to Semantically Annotate Cocoon== https://ceur-ws.org/Vol-209/saaw06-full07-reif.pdf
       Using WEESA to Semantically Annotate Cocoon Web
                        Applications

                                                       Gerald Reif, Harald Gall
                                           Department of Informatics, University of Zurich
                                                      Binzmuehlstrasse 14
                                                 CH-8050 Zurich, Schwitzerland
                                                        {reif,gall}@ifi.unizh.ch


ABSTRACT                                                                 not accessible by machines. To enable machines to support
The Semantic Web is based on the idea that Web applica-                  the user in solving information problems, the Semantic Web
tions provide semantically annotated Web pages. This meta-               proposes an extension to the existing Web that makes the
data is typically added in the semantic annotation process               semantics of the Web pages machine-processable [3]. The se-
which is currently not part of the Web engineering process.              mantics of the information of a Web page is formalized using
Web engineering, however, proposes methodologies to de-                  RDF meta-data describing the meaning of the content. The
sign, implement and maintain Web applications but lack                   existence of semantically annotated Web pages is therefore
semantic annotation. In this paper we show how WEESA, a                  crucial in bringing the Semantic Web into existence.
mapping from XML documents to ontologies, can be used in
Apache Cocoon Web applications to semantically annotate                  In [20, 21] we introduced WEESA, a technique to extend
Web pages. We introduce Cocoon transformer components                    existing XML-based Web engineering methodologies to de-
that use the WEESA mapping definition to automatically                   velop semantically annotated Web applications. The nov-
generate RDF meta-data from XML documents. We fur-                       elty of this approach is the definition of a mapping from
ther show how existing Cocoon Web applications can be                    XML elements/attributes to concepts defined in an ontology.
extended to Semantic Web applications and discuss the ex-                This mapping can then be taken to automatically generate
periences gained in an industry case study.                              RDF meta-data from XML content documents. WEESA can
                                                                         therefore be used to extend XML based Web applications to
                                                                         provide RDF meta-data in addition to HTML Web pages.
Categories and Subject Descriptors
H.3.5 [Information Systems]: Information Storage and
                                                                         The contribution of this paper is the integration of the WEESA
Retrieval; D.2 [Software]: Software Engineering
                                                                         meta-data generation into the Apache Cocoon Web develop-
                                                                         ment framework. For this purpose we developed two WEESA
General Terms                                                            enabled transformer components. We show how these trans-
Design                                                                   formers can be used to develop semantically annotated Web
                                                                         applications and discuss the experiences gained while imple-
Keywords                                                                 menting an industry case study.
Web Engineering, Semantic Web, Semantic Annotation, On-
                                                                         The remainder of the paper is structured as follows. Section
tology
                                                                         2 introduces WEESA. Section 3 presents the Apache Co-
                                                                         coon pipeline model. Section 4 discusses the association of
1.    INTRODUCTION                                                       HTML Web pages and RDF meta-data and Section 5 and 6
The increasing popularity of the WWW has lead to an expo-                shows the integration of WEESA into Cocoon transformers
nential growth in the number of Web pages available, which               and how this transformer can be used in XML based Web
makes it increasingly difficult for users to find required infor-        applications. Section 7 presents the case study, 8 discusses
mation. In searching the Web for information, one gets lost              the related work, and Section 9 concludes the paper.
in the vast number of irrelevant search results and may miss
relevant material. Current Web applications provide Web
pages in HTML format representing the content in natural                 2.   WEESA META-DATA GENERATION
language only and the semantics of the content is therefore              In this section we briefly introduce Web engineering and
                                                                         show how WEESA [21] can be used to engineer Semantic
                                                                         Web applications, that provide HTML content and machine-
                                                                         processable RDF meta-data.

                                                                         Web Engineering focuses on the systematic design, devel-
                                                                         opment, and maintenance of Web applications [6]. Most
                                                                         Web engineering methodologies are based on separation-of-
SAAW2006 1st Semantic Authoring and Annotation Workshop 2006 at the      concerns to define strict roles in the development process
5th International Semantic Web Conference, November 5-9, 2006, Athens,
Geogria, USA                                                             and to enable parallel development. A popular way to sepa-
                                                                         rate the content from the graphical design is the use of XML
and XSLT, where XML focuses on the content of the Web                       from the XML Schema to define the mapping to the ontolo-
page and XSLT defines the design.                                           gies. In this way, the same XML document that follows the
                                                                            XML Schema is used for the XSLT transformation to gen-
In order to develop Semantic Web applications, the tradi-                   erate HTML and for WEESA to generate RDF meta-data.
tional Web engineering techniques have to be extended by                    Therefore, the XML Schema can be seen as the contract the
the semantic annotation process. In this process, the Web                   content editor, responsible for writing the XML documents,
pages have to be semantically annotated with RDF meta-                      the layout designer, responsible for the graphical appear-
data. This enables machines to have access to the content                   ance, and the engineer defining the WEESA mapping have to
of the pages. Several tools such as the SHOE Knowledge                      agree on. Figure 1 shows the definition of the WEESA map-
Annotator [9], the CREAM OntoMat [7], and SMORE [12]                        ping at the design level of the Web application and how this
have been proposed to support the user when annotating                      mapping is used at instance level to automatically generate
existing Web pages. However, to manually annotate Web                       RDF meta-data and the HTML page from XML documents.
pages is only feasible if the number of Web pages is small
and the content does not change frequently.
                                                                            3.     COCOON PIPELINE CONCEPT
                                                                            In this section we introduce the concept of Apache Cocoon
To annotate dynamic Web pages, that obtain their content
                                                                            Web applications. Apache Cocoon [4] is a Web develop-
from a background logic such as a database, the annota-
                                                                            ment framework built around the concepts of separation-of-
tion process should be integrated in the engineering process
                                                                            concerns and component-based Web development. Cocoon
of the Web application. During the engineering of a Web
                                                                            uses component pipelines to build Web applications where
application, information items can be identified more easily
                                                                            each component on the pipeline is specialized on a particular
than in the generated HTML Web pages. Once the infor-
                                                                            operation.
mation item is identified, it is mapped to a concept defined
in the ontology. For example, the result of a database query
                                                                                                       Cocoon Pipeline
is mapped to a property in the ontology, to indicate that
a new RDF statement has to be generated with the query                                                         Generator                             XML Source

result as value for the property.                                                                      SAX Events


The aim of WEESA (WEb Engineering for Semantic web                                 Busines Logic:
                                                                                   XSP, JSP, Filter,          Transformer
Applications) is on the one hand, to integrate the annotation                      SQL, etc.
                                                                                                       SAX Events
process into the engineering process of the Web application.
On the other hand, to reuse the existing design artifacts of
                                                                                                              Transformer
XML based Web applications to develop Web applications
that provide semantic meta-data in addition.                                                           SAX Events        Schema valid XML document



In WEESA the structure of the XML document is used to                                                       XSLT Transformer                  XSL Stylesheet

identify XML elements/attributes which are mapped to con-                                              SAX Events            HTML
cepts in an ontology. This mapping definition can then
be taken to automatically generate RDF meta-data from                                                           Serializer                           HTML page
XML content documents. WEESA not only allows one-to-
one mappings but uses a more flexible approach to overcome
the gap between the information available in the XML doc-
ument and the information needed by the ontology. The                       Figure 2: Pipeline of a typical Cocoon Web applica-
content of several XML elements/attributes can be selected                  tion.
and further processed in Java methods to meet the seman-
tics of the concept in the ontology.
                                                                            Figure 2 shows the pipeline of a typical Cocoon Web appli-
                                                                            cation. A Cocoon pipeline consists of a generator, an arbi-
                      WEESA                                 Design Level    trary number of transformer, and a serializer. An HTTP
        XML Schema    mapping
                                      Ontology
                      definition
                                                                            request triggers the pipeline and causes the generator to
                                           uses concepts
              valid                                                         read XML from a data source and produces a stream of
                      generate                             Instance Level
                        via
                                   RDF description                          SAX1 events as output representing the XML document.
                      WEESA
                                                                            This output is the input of a transformer or a serializer. A
       XML document                         associate
                                                                            transformer takes the SAX events, does some transformation
                      generate
                      via XSLT     HTML Web page                            (e.g. XSLT transformation), and the results are again SAX
                                       Semantic Web page
                                                                            events. These events can then be taken by another trans-
                                                                            former or a serializer. In a typical Cocoon Web application,
                                                                            the business logic (e.g. SQL queries, Java code) is processed
                                                                            by the transformers at the beginning of the pipeline. The
     Figure 1: WEESA design and instance level.
                                                                            output of the business logic is a schema valid XML docu-
                                                                            ment that fulfills the Web engineering contract and has the
                                                                            structure the XSLT stylesheet was designed for. This doc-
At the design level of the Web application only the struc-                  ument is then taken by the XSLT transformer which uses
ture of the XML document is known and no XML instances
                                                                            1
are available. Therefore we use the structure information                       SAX: Simple API for XML
the XSLT stylesheet to produce the HTML page. The seri-         One of the strength of Cocoon is, that every component
alizer finally takes the SAX events and processes them into     is specialized on a specific task. This gives the developer
a character stream for client consumption.                      the flexibility to configure the components in the pipeline
                                                                according to his requirements. Therefore we decided, to split
4.   ASSOCIATING HTML AND RDF                                   up the pipeline to generate HTML pages with embedded
As shown in Figure 1, we have to perform two steps on the       RDF/XML.
schema valid XML document to generate the semantically
                                                                                                     Cocoon Pipeline
annotated Web pages: (1) The XSLT transformation has to
be performed to generate the HTML page. (2) The WEESA                                                        Generator                             XML Source

mapping has to be processed to generate the RDF meta-data                                            SAX Events

description of the Web page.                                                     Busines Logic:
                                                                                 XSP, JSP, Filter,          Transformer
                                                                                 SQL, etc.
Once we have generated the HTML page and its RDF meta-                                               SAX Events

data description we have to put them into relation. Unfortu-
                                                                                                            Transformer
nately, no standardized approach exists for associating RDF
descriptions with HTML. In [17] Palmer discusses several               Session
                                                                                                     SAX Events        Schema valid XML document

possible approaches. These techniques can be classified in                                                WriteDOMSession
                                                                                 DOM
the following categories:                                                                                    Transformer

                                                                                                     SAX Events        Schema valid XML document



Embedding RDF in HTML: With this association style                                                        XSLT Transformer                  XSL Stylesheet

   the RDF description is directly embedded in the HTML                                              SAX Events        HTML

   page. Several ways have been proposed such as adding
                                                                                                          WEESAReadDOM                     WEESA Mapping
   RDF/XML in the