doc - NAZOU

advertisement
A
Prescott – Presentation of Ontology-based
Job Offers
A.1
Basic Information
The framework being developed represents a tool that serves for the presentation of
ontology-based information. At present, the purpose of this tool is the presentation of
job offers that are primarily represented by ontology (RDFS, OWL) according the
Fresnel language specification. The proposed architecture, which is based on the
architectural style "pipes and filters", allows to create different presentation outputs e.g.
HTML or XML.
A.1.1 Basic Terms
Fresnel
Fresnel is as a browser-independent vocabulary of core
RDF display concepts applicable across different
representation paradigms and output formats.
Fresnel lens
The first fundamental concept of the Fresnel. Lenses define
which properties of an RDF resource, or group of related
resources, are displayed and how those properties are
ordered.
Fresnel format
The second fundamental concept of the Fresnel. Formats
determine how resources and properties are rendered and
provide hooks to existing styling languages such as CSS.
A.1.2 Method Description
The Fresnel ontology is designed as a pure declarative language for selecting and
formatting data from the ontology based repositories. The main steps that are necessary
for applying the Fresnel on the ontology are described in [Bizer, 2005].
Our realization of the Fresnel specification supports the main portion of the basic
vocabulary for lenses and format definition. In general it is possible to define by lenses
the instances that should presented, their properties and order in which they are
presented and embedded instances. Moreover it is possible to define the set of instances
that should be selected according the values of their properties. It is possible to specify
this set by Fresnel Selector Language (FSL).
To prevent the conflict that occurs in situations where it is possible to apply more than
one lens on a single instance, we proceed with the lenses application from the most
specific to the most general domain, while already processed instances are skipped. The
selection of lenses and their properties is being performed in the following order:
1. Select standard purpose lenses that have defined their instance domain by FSL
selector.
2. Select other lenses that have defined their instance domain by FSL selector.
3. Select standard purpose lenses that have defined their instance domain by simple
selector.
4. Select other lenses that have defined their instance domain by simple selector.
5. Select standard purpose lenses that have defined their class domain while these
lenses are ordered by the depth of the classes.
6. Select other lenses that have defined their class domain while these lenses are
ordered by the depth of the classes.
For the chosen lens the following steps are performed:
1. Select the instances defined by the lens.
2. Cut the set of instances to appropriate subset.
3. Order the subset of instances.
4. Store the instances subset together with the trimmed RDF tree and lens’ defined
properties into the repository
The formats and groups allow us to set formatting classes to the instances, names of the
properties and their values. We can use these formatting classes when we translate the
XML output to other languages that support formatting (e.g. HTML). Similarly as in
case of lenses application, there might be some conflicts with format application,
resulting from the possibility to apply more different formats on the single instance.
This problem was solved again by defining the exact order in which the formats are
being applied.
We use the described realization in the web based framework that presents the content
of ontology according the lenses and formats specification. The framework was
designed in compliance with the architectural pattern “pipes and filters” what allows us
to change the presentation outputs or whole Fresnel realization.
A.1.3 Scenarios of Use
Prescott can be used in the following scenario:
 Present content of the RDF based ontology to the HTML or XML format
Prescott does not support:
 Ontological element Union
A.1.4 External Links and Publications
 M. Bieliková, V. Grlický, J. Kuruc: Framework for Ontology-Based Information
Presentation. In: Proc. of ITAT 2005 – Workshop on Theory and Practice of
Information Technologies, P. Vojtáš (Ed.), September 2005, Račkova dolina,
pp.325-334. (in Slovak)
 M. Štípek, V. Grlický: Ontology-based Information Presentation. In: Proc of Tools
for Acguisition, Organisation and Presenting of Information and Knowledge:
Research Project Workshop, P. Návrat (Ed.), September 2006, Bystrá dolina, pp.
193-200.
 Ch. Bizer, R. Lee, E. Pietriga: Fresnel - Display Vocabulary for RDF.
http://www.w3.org/2005/04/fresnel-info/manual, June 2005.
A.2
Integration Manual
Prescott is developed in Java (Standard Edition 5). It is divided into two projects. The
first one contains own implementation of the Fresnel specification and is being
distributed as a jar archive. The second one is a web application based on the Cocoon
framework which presents the content of the otology. It is being distributed as a war
archive. The second project is dependent on the first one so the first one’s jar file is
being contained in the second’s war file.
A.2.1 Dependencies
Prescott uses Sesame API, Cocoon web framework and Apache Tomcat.
A.2.2 Installation
Deploy the distributed war file in the Apache Tomcat.
A.2.3 Configuration
Find the file prescott-webapp\prescott\sitemap.xmap in the deployed web application.
In this XML based file find element <map:generator …>. It contains element
<map:parameter name="instances-location" value="…">. Fill the attribute value with
the absolute path of the local repository containing the instances of ontology saved in
N3 format.
Find the file prescott-webapp\WEB-INF\xconf\cocoon.xconf in the deployed web
application.
In
this
XML
based
file
find
element
<component
role="nazou.prescott.cocoon.cron.InstanceCacheCronJob"
…
>.
Modify its
subelements to contain correct access information to the remote Sesame repository. The
element <instances-location> should contain the absolute path to file, where the local
repository containing the instances of ontology would be saved. It has to be the path of
the same file as specified in sitemap.xmap file.
A.2.4 Integration Guide
Prescott presents the content of ontology according the lenses specification. The lenses
are being placed in the folder prescott-webapp\prescott\lenses of the deployed web
application. If you would like to create the lens, place it in this folder.
To invoke the presentation use the one of the following addresses according the output
format you desire:
 For HTML output use:
[servername]/prescott-webapp/prescott/[name of the lenses file].lenses
 For XML output use:
[servername]/prescott-webapp/prescott/[name of the lenses file].xml-lenses
In both cases you need to specify the URI of the instance that you wish to present. You
do so by passing the HTTP attribute (GET or POST) named uri containing the URI of
the instance to be presented.
Example:
HTML presentation according the default lens can be performed by accessing the
address:
[servername]
/
prescott-webapp
/
prescott
/
prescott_default.lenses?uri=[SOME URI].
The result of such presentation is displayed in the Fig. 1.
Fig. 1. Instance presentation performed by Prescott’s default lens.
A.3
Development Manual
A.3.1 Tool Structure
Prescott tool consists of two projects:
 prescott-fresnell: contains the implementation of Fresnel specification.
 prescott-webapp: realizes the web interface for the prescott-fresnel.
A.3.2 Method Implementation
Prescott-webapp is a web application presenting the data from ontology. It uses the
prescott-fresnell implementation for its activities.
Prescott-fresnell
The Façade for the whole Fresnel implementation is the prescott-fresnell’s class
nazou.prescott.fresnel.FresnelProvider. It contains methods that load the lenses
(loadFresnelConfiguration()), schema of the ontology (loadOntologyDefinition())
and ontology instances (loadInstances()). After defining these necessary inputs we call
methods for applying lenses and formats (applyLenses(), applyFormats()) to process
the ontology. We get results by calling generateOutputXMLString() method which
returns the results in XML representation according the Fresnel specification.
Prescott-webapp
Prescott-webapp is Cocoon based web application. It is designed according the
Cocoon’s “pipes and filters” architecture: Generator-Transformer-Serializer. It defines
own Generator and uses Cocoon’s build in Transformers and Serializers. The
configuration is being performed in compliance with Cocoon’s architecture in
appropriate sitemap.xmap file.
The Generator is provided by the class nazou.prescott.cocoon.FresnelGenerator. It
uses the prescott-fresnell’s Façade class FresnelProvider to generate the XML
containing the data that should be presented.
We use build in Cocoon Transformer to provide XML to HTML transformation when
the user wants to get the HTML output. This Transformer provides XSL transformation
according
our
default
template
that
can
be
found
in
file
pescott-webapp\prescott\stylesheets\fresnel2html.xslt.
The default Cocoon Serializers for XML or HTML are being used for serialization.
A.3.3 Enhancements and Optimizing
In the future there can be developed an enhancement: modify the prescott-fresnell to be
able to work with remote Sesame repository. In the present it uses Sesame’s Graph API
that can be used only for locally stored repositories.
The optimization is not necessary at the moment. Prescott is based on the Sesame which
is the cause of performance issues. Sesame API is very slow when compared to the rest
of the code. It means that it is almost useless to provide any optimizations while the
actual Sesame API reduces the performance.
A.4
Manual for Adaptation to Other Domains
The Prescott was build to be domain – independent presentation framework. Its purpose
is not tied with any application domain. The only domain specific parts of the Prescott
are the lenses. It means that to adapt it to different domain we just need to create
different lenses and make some minor configuration modifications.
A.4.1 Configuring to Other Domain
To change the domain, we need to perform following steps:
1. Create domain specific lenses and store them in
folder.
pescott-webapp\prescott\lenses
2. Store the schema of the ontology to the
schema.n3 file using the N3 notation.
pescott-webapp\prescott\schemas\
3. Define all needed ontology namespaces in file
config.xml.
pescott-webapp\prescott\fresnel-
4. If the default XSLT is not appropriate, modify it or create new one and save it in
pescott-webapp\prescott\stylesheets. When creating new XSL transformations,
change the Cocoon pipeline to work with appropriate XSLT file
A.4.2 Dependencies
Prescott does not have any domain specific dependencies.
Download