<%@ page info="Simple Demo: OBSERVER execution" language="java" import="observer.ontServer.*,observer.ontServer.mapTrans.*,observer.ontServer.wrappers.*,observer.observer.*,java.util.*,java.io.*" %> Simple Demo: OBSERVER execution

OBSERVER

Ontology Based System Enhanced with Relationships for Vocabulary hEterogeneity Resolution


Simple Demo: OBSERVER execution



Last update: June 11, 2003
    <% OntServer os = new OntServer(this, ObserverCONST.ONTOLOGY_NODE);%>
  1. Query:

    [Name Location Price] of (AND hotel (FILLS 200 price))

  2. Mapping Query <% Mapping map= os.getMapping( "[Name Location Price] for (AND Hotel (FILLS Price \"200\"))", "hotels", ObserverCONST.LOG_ONTOLOGY_SERVER, this); %>

    <%=map%>
    
  3. Multi-Repository to Mono-Repository Queries

    <% Hashtable ht = os.getMonoRepositoryPlans( "[Name Location Price] for (AND Hotel (FILLS Price \"200\"))", "hotels", ObserverCONST.LOG_ONTOLOGY_SERVER, this); Enumeration enum =ht.keys(); %> <% while (enum.hasMoreElements()){ Object key = enum.nextElement(); Object value =ht.get(key); %> <% } catch (observer.ontServer.mapTrans.ParseError pe){ // pe.printStackTrace(); %>
    ERROR: <%=((MappingTree)value).toMapping()%>
    <% } %> <%}%>
    ALIAS REPOSITORY MAPPING
    <%=key%> <%=((MappingTree)value).getRepository(0)%> <% try{ ByteArrayInputStream input = new ByteArrayInputStream( ((MappingTree)value).toMapping().getBytes() ); ViewMapping g = new ViewMapping(input); g.setLevel(0); String s = g.relation(); %>
    <%=s%>

  4. Local Query Languaje for each repository involved in the query

  5. Solving the Multi-Repository plan using a database
  6. Result of the above query: <% try{ Table t= os.getExtension( "[Name Location Price] for (AND Hotel (FILLS Price \"200\"))", "hotels", ObserverCONST.LOG_ONTOLOGY_SERVER, this); %>

    <% for (int i=0; i <% tuple.viewServlet(new PrintWriter(out)); } %>
    <%=h.colName%> <% } Vector tuples = t.getAllTuples(); for (int i=0; i

<% } catch (Exception e){ %> <%=e.getMessage()%> <% e.printStackTrace(new PrintWriter(out)); } %>
joalroyo@unizar.es
June 11, 2003