SeWeSe : Semantic Web Server

Priscille Durville, Fabien Gandon

All semantic web applications using a semantic engine rely on common functionalities that can be factorized into a semantic web application development platform; ours is called SeWeSe. The goal of such a platform is to provide reusable, configurable and extensible primitives and components in order to reduce the amount of time spent to develop new semantic web applications and to allow these applications to focus on their domain specificities.

SeWeSe is built upon CORESE engine and provides a set of primitives to build interfaces for queries, edition and navigation, and for the management of the transverse functions of a portal (presentation, internationalization, security, etc.). An ontology editor, a generic annotation editor and a basic rule editor are parts of the SeWeSe platform. The main purpose of SeWeSe is to integrate recurrent semantic web operations (e.g. perform a SPARQL Query, transform a result binding in a given view) in classic web technologies (e.g. JSP pages, servlet calls).

Architecture

Concerning its architecture, SeWeSe is embedded in webapps deployed on a servlet container (here Tomcat) and provides a set of filters, servlets, JSP tags and libraries as well as some templates to build new applications. SeWeSe is a Java 5 application using XML technologies for non-java files (e.g JSPX see JSP XML Syntax, XSLT, XML). It uses the following opensource libraries:

It can be deployed under Tomcat 5.5.x and uses Servlet API 2.4, JSP 2.0 and the standard JSP Tag library JSLT 1.1.2. Our permanent emphasis is on implementing services relying as much as possible on RDF/S to represent our data (user profile, logs, etc.), on SPARQL to select them (session parameters, history, access rules, etc.) so that interactions with the server are always done the same way and data can be integrated wherever they come from (domain models, imported annotations, logs, user profiles, etc.)

Figure 1 : Sewese architecture

Available components

The architecture of SeWeSe is organized around four main types of components:

Toolkits

A number of toolkits are available to develop new applications, among which:

JSP Tags

A number of JSP tags are predefined:

SeWeSe also includes a number of administration tags (e.g. to reset the server).

Using these tags and an additional complete set of tools and models, SeWeSe also provides primitives to design ontology-based forms e.g. to generate a list of options from a sub tree of an RDFS type hierarchy. These forms can be used to create, modify or query the annotations.

Submit a SPARQL query and display results from within a JSPX page:

 <c:set var="my_query">
   SELECT ?xName ?xTypeName WHERE {
     ?x rdf:type ?xType .
     ?x geo:nom ?xName .
     ?xType rdfs:label ?xTypeName .
     FILTER ( lang(?xTypeName) = '${sessionScope.language}') 
   }
 </c:set>
 <ul>
    <sew:for-each-result query="${my_query}">
        <li>${xTypeName}: ${xName}</li>
    </sew:for-each-result>
 </ul>
        

Browsing ontologies:

 <ul>
  <sew:for-each-child root="${uri}">
  <li>
    <a href="simple_query.jsp?uri=${sew:encode(currentType)}">
      <c:choose>
        <c:when test="${empty currentLabel}">
            ${currentType}
        </c:when>
        <c:otherwise>${currentLabel}</c:otherwise>
      </c:choose>
    </a>
  </li>
  </sew:for-each-child>
 </ul>
        

Filters

Several filters are shipped with SeWeSe:

Declaration of a session filter (in web.xml configuration file):

<filter>
 <filter-name>sessionfilter</filter-name>
 <filter-class>fr.inria.acacia.sew.SessionFilter</filter-class>
 <init-param>
    <param-name>lastname</param-name>
    <param-value>SELECT ?x WHERE { 
                 get:uid sew:lastname ?lastname }</param-value>
 </init-param>
 <init-param>
    <param-name>team</param-name>
    <param-value>SELECT ?x WHERE { 
                 get:uid sew:belongTo ?teamURI . 
                 ?teamURI sew:name ?team }</param-value>
 </init-param>
 <init-param>
    <param-name>group</param-name>
    <param-value>SELECT ?x WHERE { 
                 get:uid sew:role ?groupURI . 
                 ?groupURI sew:name ?group }</param-value>
 </init-param>
</filter>

<filter-mapping>
    <filter-name>sessionfilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
        

Declaration of a security filter (in web.xml configuration file):

<filter>
    <filter-name>securityfilter</filter-name>
    <filter-class>fr.inria.acacia.sew.AccessFilter</filter-class>
    <init-param>
        <!-- "team" is a session attribute -->
        <param-name>team</param-name>
        <!-- accepted value -->
        <param-value>Acacia</param-value>
    </init-param>
    <init-param>
        <!-- "group" is a session attribute -->
        <param-name>group</param-name>
        <!-- accepted values -->
        <param-value>developer,engineer</param-value>
    </init-param>
</filter>    

<filter-mapping>
    <filter-name>securityfilter</filter-name>
    <url-pattern>/protected/*</url-pattern>
</filter-mapping>
        

Other resources

A number of browser-independent javascript libraries are available, among which:

Some examples of web applications

Depending on the context the visualization of a piece of knowledge will require different types of interfaces providing different views, different interaction means and different customization capabilities.

Here is an example of a SPARQL Binding rendered as a pie chart: Figure 2 : Example of a customized annotations view (pie chart view)

Here is a table of results and their degree of confidence (using similarity measures from approximated answers) ; semantic distances defined over the ontology are used for instance for query relaxation: Figure 3 : Example of a query results view (shown as table)

Here is an example of a SPARQL Binding rendered as a bar chart: Figure 4 : Another example of a customized annotations view (bar chart view)

Here is a clustered view (SVG) of RDF annotations: Figure 5 : Another example of a customized annotations view (interactive radar view)

Example of a customized query graphical interface: Figure 6 : Example of a customized query graphical interface

Example of a customized query results view (built with ajax technology): Figure 7 : Example of a customized query results view (built with ajax technology)

Example of a customized interface for annotations modification: Figure 8 : Example of a customized interface for annotations modification.