<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An Active Web-based Distributed Database System for E-Commerce</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Hiroshi Ishikawa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Tokyo Metropolitan University, Dept. of Electronics &amp; Information Eng</institution>
        </aff>
      </contrib-group>
      <fpage>27</fpage>
      <lpage>36</lpage>
      <abstract>
        <p>ECbusiness models like e-brokers on the Web use WWW-based distributed XML databases. To flexibly model such applications, we need a modeling language for EC businesses, specifically, its dynamic aspects or business processes. To this end, we have adopted a query language approach to modeling, extended by integrating active database functionality with it, and have designed an active query language for WWW-based XML databases, called XBML. In this paper, we explain and validate the functionality of XBML by specifying e-broker and auction business models and describe the implementation of the XBML server, focusing on the distributed query processing in the WWW context.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>SQL to XML is inadequate because RDB and XML
data have different data models. So we take a
nonprocedural query language approach to modeling
XML-based businesses. Further, we extend the query
language approach by integrating ECA rules [8] with
it for modeling control flow of the business processes.
Thus, we call XBML an active query language
approach to modeling EC businesses. At the same
time, we make XBML efficiently executable on the
server-side to agilely implement the business models.</p>
      <p>This paper will not propose a new query language
for XML submitted to W3C, although XBML
contains the query functionality as a basic part for
specifying business processes. XBML integrates the
query facility with ECA rules for controlling business
processes. We will describe the functionality of
XBML and validate the usability of XBML by
specifying the example business model with XBML
in Section 2. We will describe the current
implementation of an XBML server, focusing on the
distributed query processing in Section 3.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Approach 2.1 Database Schemas and Business Model</title>
      <p>We use the following database schemas or DTD
fragments for illustrating the functionality of XBML:
&lt;!ELEMENT dlib (book*, article*)&gt;
&lt;!ELEMENT book (author+, title, publisher, price, keyword*)&gt;
&lt;!ATTLIST book year CDATA&gt;
&lt;!ELEMENT article (author+, title, publisher, keyword*)&gt;
&lt;!ATTLIST article year CDATA &gt;
&lt;!ELEMENT publisher (name, address)&gt;
&lt;!ELEMENT author (firstname?, lastname, office+)&gt;
&lt;!ELEMENT office (#PCDATA | (building, room))&gt;
&lt;!ELEMENT registration (register*)&gt;
&lt;!ELEMENT register (customer)&gt;
&lt;!ELEMENT customer (id, lastname, keyword*, purchased*)&gt;
&lt;!ELEMENT ordering (order*)&gt;
&lt;!ELEMENT order (id, item)&gt;
&lt;!ELEMENT shipping (ship*)&gt;
&lt;!ELEMENT ship (id, status)&gt;
The following is a part of XML data with conformity
to the above DTD:
&lt;dlib&gt;
&lt;book year=”1993”&gt;
&lt;author&gt;
&lt;firstname&gt;Hiroshi&lt;/firstname&gt;
&lt;lastname&gt;Ishikawa &lt;/lastname&gt;
&lt;office&gt;
&lt;building&gt; L2 &lt;/building&gt;
&lt;room&gt; S210 &lt;/room&gt;
&lt;/office&gt;
&lt;/author&gt;
&lt;title&gt;Object-Oriented Database System
&lt;/title&gt;
&lt;publisher&gt; Springer Verlag &lt;/publisher&gt;
&lt;price&gt; 69.00&lt;/price&gt;
&lt;/book&gt;
&lt;/dlib&gt;</p>
      <p>We take an ordered directed graph as a logical
model for an active query language XBML as a
modeling language of EC businesses. That is, the data
model of the XBML can be represented as data
structures consisting of nodes (i.e., elements) and
directed edges (i.e., contain, or parent-child
relationships), which are ordered.</p>
      <p>
        We also use e-broker business models based on
XML data for describing the XBML functionality.
Here we will provide the working definition to EC
business models in general. The EC business models
consist of business processes and revenue sources
based on IT such as Web and XML. We assume that
e-broker business models on behalf of customers
consist of at least the following business processes:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) The customer searches products by issuing
either precisely- or
approximately-conditioned queries against
one or more suppliers and /or navigating
through the related links.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) The customer takes recommendations from
suppliers into account if any.
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) The customer compares and selects products
and puts them into the shopping cart.
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) The customer checks out by placing a
purchase order with registration.
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        ) The customer tracks the order to check the
status for shipping.
      </p>
      <p>The revenue source in e-broker models is sales.</p>
    </sec>
    <sec id="sec-3">
      <title>2.2 Business Model Specification</title>
      <p>
        We have adapted the design of XBML to the
requirements for supporting EC business models
discussed in the previous section.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )Searching Products
XBML provides the following functions for
describing product search processes:
- XBML allows product search by selecting
products based on their attributes, such as titles
and authors, and constructing search results based
on them.
- XBML allows ambiguous search by allowing
partially-specified strings and path expressions.
- XBML supports data join used in related search
to promote cross-sell and up-sell.
- XBML configures search results by sorting and
grouping them based on product attributes.
- XBML supports “comparison model” of similar
products by allowing search multiply bound
across shopping sites.
- XBML provides localized views (e.g., prices) of
global products by introducing namespaces (i.e.,
contexts).
      </p>
      <p>Note that we cannot describe sorting, grouping, and
namespaces due to the limit of space.</p>
      <sec id="sec-3-1">
        <title>Data selection and construction</title>
        <p>The basic function of XBML is to select arbitrary
elements from XML data by specifying search
conditions for accommodating flexible product
searches in e-broker business models. XBML allows
any combination of retrieved elements to produce
new element constructs for further services. The
following query produces new elements consisting of
titles and authors of books published by Prentice-Hall
and firstly authored by Ullman:
(Query1)
select result {$book.title, $book.author }
from dlib URI “www.a.b.c/dlib.xml”, book $dlib.book
where $book.publisher.name = “Prentice-Hall” and
$book.author[0].lastname =“Ullman”
and $book.@year gt “1995”</p>
        <p>The basic unit of XBML is a path expression, that
is, an element variable followed by a series of tag
names such as “$dlib.book”. The user must declare at
least one element variable in a from-clause. In
particular, the user can bind XML data as input
specified by URI to element variables such as dlib.
Note that URI in our context must have the form
“www.x.y.z/d.xml” but not “www.x.y.z”. This
declares a context where an XBML query is
evaluated. References of element variables are done
by prefixing “$” to them. The user checks a condition
for selection in a where-clause. Two values of
elements are compared in an alphabetical order.
Compare operators include “=”, “!=”, “lt” for “&lt;”,
“le” for “&lt;=”, “gt” for “&gt;”, and “ge” for “&gt;=”. XBML
allows indexed access to ordered elements by
specifying an index [i]. Attributes are referenced by
prefixing “@” to them.</p>
        <p>“{}” in a select-clause enclosing elements
delimited by “,” creates new XML elements of a
specified construct such as author and title tags. The
result of an XBML query is XML data, which can be
retrieved as well as existing data. In our current
design, the resultant XML data have no DTD, that is,
they are well-formed XML data. For example, the
result of the above query has the following structure,
automatically wrapped by a tag “XBML:result”:
&lt;XBML:result&gt;
&lt;result&gt;
&lt;title&gt;A First Course in Database Systems
&lt;/title&gt;
&lt;author&gt;
&lt;firstname&gt;Jeff &lt;/firstname&gt;
&lt;lastname&gt;Ullman &lt;/lastname&gt;
&lt;office&gt; Gates Building&lt;/office&gt;
&lt;/author&gt;
&lt;author&gt; … &lt;/author&gt;
&lt;/result&gt;
&lt;result&gt; … &lt;/result&gt;
…
&lt;/XBML:result&gt;
Here, we define the basic syntax of XBML as
follows:
query = select target from context-list [where-clause]
[orderby-clause] [groupby-clause]
target=expression | tag ‘{’expression-list ‘}’
expression-list = expression ‘,’expression-list | expression
expression = [tag] ‘$’ variable | [tag] ‘$’ variable ‘.’ path
path = ‘%’ | tag | ‘@’attribute| path ‘.’ path | ‘(’ path ‘|’
path ‘)’ | text
context-list = context ‘,’ context-list | context
context = variable URI uri-list | variable expression
uri-list = uri uri-list | uri
where-clause = where condition
condition = term | condition or term
term = factor | term and factor
factor = predicate | not predicate
predicate = expression compare expression
orderby-clause = orderby expression-list
groupby-clause = groupby expression-list</p>
      </sec>
      <sec id="sec-3-2">
        <title>Partially-specified path expression</title>
        <p>
          XBML allows regular path expressions for flexibly
retrieving products represented as slightly
heterogeneous elements (i.e., semi-structured XML
data), which depend on data and suppliers in e-broker
business models. Here we define semi-structured
XML data as follows:
(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) Elements with the same tag are repeated at more
than or equal to zero times, depending on parent
elements, such as authors of books.
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) Elements with the same tag have variant
sub-structures, depending on parent elements,
such as offices of authors.
        </p>
        <p>As these characteristics cannot be determined in
advance, we allow partially-specified path
expressions.The following query retrieves authors of
any material such as book and article named
Ishikawa.</p>
        <p>(Query2)
select result {$anyauthor}
from dlib URI “www.a.b.c/dlib.xml”,</p>
        <p>anyauthor $dlib.%.author
where $anyauthor.lastname =“Ishikawa”
Here “%” denotes “wild card” in path expressions,
which also allows approximate searches in e-broker
business models. “$dlib.%.author” matches both of
“book.author” and “article.author”.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Data join</title>
        <p>XBML joins different elements by comparing their
values in a where-clause. The following query joins
books and articles by authors as a join key within the
same XML data:
(Query3)
select result {$article, $book}
from dlib URI “www.a.b.c/dlib.xml”, article $dlib.article,
book $dlib.book
where $book.author.firstname = $article.author.firstname
and $book.author.lastname = $article.author.lastname
and $book.title = “%Electronic Commerce%”</p>
        <p>In e-broker business models, this helps increase
cross-sell and up-sell. Here the customers can do
approximate searches over XML data by using wild
card “%” in strings, that is, partially-specified strings,
as is often the case with search in e-broker business
models. The query result has the following
structure:
&lt;XBML:result&gt;
&lt;result&gt;
&lt;article year=”…”&gt;
&lt;author&gt; …&lt;/author&gt;
&lt;title&gt; … &lt;/title&gt;
&lt;publisher&gt; …&lt;/publisher &gt;
&lt;/article&gt;
&lt;book year=”…”&gt;
&lt;author&gt; …&lt;/author&gt;
&lt;title&gt; … &lt;/title&gt;
&lt;publisher&gt; …&lt;/publisher&gt;
&lt;price&gt; … &lt;/price&gt;
&lt;/book&gt;
&lt;/result&gt;
&lt;result&gt; … &lt;/result&gt;
…
&lt;/XBML:result&gt;</p>
      </sec>
      <sec id="sec-3-4">
        <title>Multiple binding</title>
        <p>The user can have universal access to multiple data
sources by binding a single element variable to
multiple URIs (i.e., URI list) in a where-clause. The
following example retrieves books authored by the
same author from two online bookstores (bound to
dlib) by only a single query at the same time:
(Query4)
select result {$book.title, $book.author}
from dlib URI “www.a.b.c/dlib.xml” “www.x.y.z/dlib.xml”,
book $dlib.book
where $book.author.lastname =“Ishikawa”</p>
        <p>
          The users need to declare the partially-specified
path expression to accommodate the heterogeneity of
datasources. This function is necessary for,comparing
similar products or searching the lowest price in
multiple stores.
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          )Recommendation
Related search as a recommendation process is
crucial in promoting cross-sell and up-sell, indeed. It
is classified into three categories to the extent to
which the customer in session is involved.
        </p>
        <p>
          (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) Non-personalized recommendation
The customer is not involved. The e-broker
recommends some products as general trends,
independently of the customer. Or, the e-broker
shows the customer products highly rated by the
other customers.
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) Personalized recommendation
The customer only is involved. The e-broker
recommends some products based on the
customer’s psycho-graphic data, such as interests,
or historical data, such as purchase records.
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          ) Collaboratively filtered recommendation [17]
Both the customer and the others are involved.
The e-broker recommends products purchased by
those customers who purchased the products
selected by the customer.
        </p>
        <p>The facility for function definition and the query
transformation technique have an important role in
recommendation as follows.</p>
      </sec>
      <sec id="sec-3-5">
        <title>Function definition</title>
        <p>Functions correspond to “parameterized views”.
Functions modularize recurring queries in EC
business models to increase their reuse. The user
defines a function by specifying an XBML query in
its body. The syntax has the following form:
function-definition = function name ‘(’ parameter-list ‘)’ as
‘(’ query ‘)’
parameter-list = parameter ‘,’ parameter-list | parameter
As personalized recommendation, the following
function recommends products based on the
keywords which the customer (specified by its
identifier, customerid) have registered in advance as
his psycho-graphic data:
function personalized-Recommendation (customerid) as
(select result {$book.title, $book.price}
from dlib URI “www.a.b.c/dlib.xml” , book $dlib.book, r URI
“www.a.b.c/registration.xml”, customer $r.register.customer
where $book.keyword = $customer.keyword and $customer.id
= customerid)</p>
        <p>The next example in the collaboratively-filtered
recommendation category recommends products
based on similarity that there are other customers who
purchased the product selected by the customer (i.e.,
indicated by selected).</p>
        <p>function collaboratively-filtered-Recommendation (selected) as
(select result {$book.title, $book.price}
from dlib URI “www.a.b.c/dlib.xml” , book $dlib.book, r URI
“www.a.b.c/registration.xml”, customer $r.register.customer
where $book = $customer.purchased and
$customer.purchased = selected)</p>
      </sec>
      <sec id="sec-3-6">
        <title>Query transformation</title>
        <p>
          Until now, we have treated recommendation and
search as separate processes. However, when the
customer specifies search keywords, the search result
can be expanded to include recommended products
by transforming the original search query. Query
transformation is classified into two rules as follows:
(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) Keyword addition rule
This rule has the general form:
        </p>
        <p>keyword1 ==&gt; keyword1 | keyword2
For example, the originally specified keyword
“Electronic Commerce” adds a new keyword
“Internet Business” and the disjunctive condition is
added to the end of the query as follows:
(Query5)
select result {$book}
from dlib URI “www.a.b.c/dlib.xml, book $dlib.book
where $book.keyword = “Electronic Commerce” or</p>
        <p>
          $book.keyword = “Internet Business”
This technique is similar to query expansion [3]
used in information retrieval. Note that this type of
transformation keeps data sources unchanged.
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) Data source addition rule
This rule uses set operations on queries to modify
the original one. The rule has the following general
form:
        </p>
        <p>query1 ==&gt; query1 set-operator query2
Here set-operator includes union, intersection, and
difference. For example, when the customer
searches books on EC, he will search articles on
EC at the same time by modifying the original
query with a disjunctive query as follows:
(Query6)
select result {$book}
from dlib URI “www.a.b.c/dlib.xml, book $dlib.book
where $book.keyword = “Electronic Commerce”
union
select result {$article}
from dlib URI “www.a.b.c/dlib.xml, article $dlib.article
where $article.keyword = “Electronic Commerce”</p>
        <p>
          We analyze the application-based Web access
patterns [5] to create the transformation rules, not
discussed here due to space limitation.
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          )Moving to Carts
In general, EC business models involve temporary
data, such as search results and shopping carts, valid
only within sessions as well as permanent data such
as books and customers. XBML handles such
temporary data as first-class citizens.
        </p>
      </sec>
      <sec id="sec-3-7">
        <title>Use of query results</title>
        <p>XBML allows a query against the intermediate query
results as well. The customer checks the result of
searching products or recommendation to place an
order. The following XBML query moves only the
customer-checked items in the search result to the
shopping cart:
(Query7)
select cart {item $result.book}
from XBML:result URI “www.a.b.c/XBML:result.xml” ,</p>
        <p>
          result $XBML:result.result
where $result.checked =“yes”
(
          <xref ref-type="bibr" rid="ref4">4</xref>
          )Placing Orders
Selected items in the shopping cart remain to be
added to ordering databases. Thus, addition of new
elements is a mandatory function for constructing
practical e-broker models. Addition of new elements
often needs making them unique by invoking a
dedicated function, defined in programming
languages such as Java. To this end, XBML also
allows function invocation in a query.
        </p>
      </sec>
      <sec id="sec-3-8">
        <title>Insertion and function invocation</title>
        <p>We provide the syntax for insertion by using an
XBML query as follows:</p>
        <p>insertion = insert into target query</p>
        <p>The following query places a purchase order in
e-broker business models by consulting the current
shopping cart and customer data and invoking a
function:
(Query8)
insert into $order
select order {@id = OrderID($customer.id, date()),</p>
        <p>
          item $cart.item}
from r URI “www.a.b.c/registration.xml”,
customer $r.register.customer,
XBML:result URI “www.a.b.c/XBML:result.xml” ,
cart $XBML:result.cart, o URI “www.a.b.c/ordering.xml”,
order $o.order
where $customer.lastname =“Kanemasa”
Here, in a select-clause, function calls
“OrderID($customer.id, date())” generate unique
order numbers. Ordering initiates internal processes,
such as payment and shipment, hidden from the
customers. Please note that “$order” in the
into-clause is permanent in
“www.a.b.c/ordering.xml” while “order” in the
select-clause is temporarily constructed in this query.
(
          <xref ref-type="bibr" rid="ref5">5</xref>
          )Tracking Orders
Ordering and shipping constitute a supply chain in the
EC business models. Further, shipping is often
outsourced. Thus, the involved data are managed at
separate sites whether on intranet or on the extranet.
To this end, XBML allows data join across different
sites in addition to that within one site.
        </p>
      </sec>
      <sec id="sec-3-9">
        <title>Join of data from multiple data sources</title>
        <p>The user can join heterogeneous XML data from
different data sources indicated by different URIs. In
e-broker business models, the following query
produces a set of ordered items and shipping status by
joining order identifiers of order entry data and order
shipping data at different sites indicated by separate
variables bound to multiple URIs, such as o and s:
(Query9)
select result {$order.item, $ship.status}
from o URI “www.a.b.c/ordering.xml”, s URI</p>
        <p>“www.d.e.f/shipping.xml”, order $o.order, ship $s.ship
where $order.id=$ship.id and $order.id=“cidymd”</p>
        <p>In general, there are two approaches to resolving
heterogeneity in schemas of different databases:
schema translation based on ontologies and schema
relaxation based on query facilities. XBML takes the
latter approach, that is, XBML uses regular path
expressions and element variables to enable the user
to retrieve multiple databases with heterogeneous
schemas by a single query at one time because the
regular path expressions can match with more than
one path and the element variables can be bound to
more than one path. Further, we allow well-formed
XML data containing a set of heterogeneous element
as a query result. Of course, we admit that a simple
solution to schema translation between heterogeneous
DTD is based on XSL (i.e., XSL Transformations).
2.3 Applicability to Other Models and Extension
In the previous subsection, we have discussed the
applicability of XBML to the e-broker models. Now
we ascertain its applicability to business models other
than the e-broker model. Indeed, there are rather
novel EC business models, such as the reverse
auction model. However, new business models are
often created by mutation of business processes of
existing models. We take the auction model [12] as
an example. The auction model consists of the
following processes:</p>
        <p>
          The selling customer registers auction items.
(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) The buying customer searches auction items.
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) The buying customer takes recommendations
into account if any.
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          ) The buying customer bids.
(
          <xref ref-type="bibr" rid="ref4">4</xref>
          ) The winner customer checks out by placing a
purchase order with registration.
(
          <xref ref-type="bibr" rid="ref5">5</xref>
          ) The winner customer tracks the order to
check the status for shipping.
        </p>
        <p>We can observe similarity between the auction
model and e-broker model. Registry of auction items
by sellers corresponds to registry of products by
suppliers, just implicit in the e-broker model.
Searching and recommendation of auction items are
very close to those of products in the e-broker model.
Indeed, bidding is a new process, but it can be viewed
as a series of tentative ordering until the buying
customer wins the auction. In other words, the event
that the customer wins the auction moves auction
items to the shopping cart. The winner’s placing a
purchase order is very close to that in the e-broker
model. Order tracking in the auction model is
analogous to that in the e-broker model although it
may require a new business model, such as e-escrow,
to guarantee the bargain contract. The revenue source
is a part of the contract price as fees in the auction
model. Thus, we would say that our XBML can apply
to the auction model as well.</p>
        <p>However, it is also true that controlling business
processes, or modeling events by some ways is
necessary. Thus, the auction model requires
triggering business processes at a specified time or on
some database events such as insert. Active databases
or ECA (Event-Condition-Action) rules [8] will be
able to specify such business processes on events
more elegantly than procedural programming
languages plus the current version of XBML.
Therefore, we extend current XBML by introducing
the following construct for ECA rules:</p>
        <p>on event if condition then action</p>
        <p>Events include operations of XBML (e.g., select
and insert) and a specified time. Conditions are
specified as conditions of XBML. Actions are also
specified by XBML.</p>
        <p>For example, we think of the situation that when
the highest bidding price of the auction specified by
id1 is updated, if the current time is before the closing
time of the auction, then the auctioneer specified by
id2 increases his bidding by a specified value value3.
The corresponding ECA rules can be specified as
follows:
on insert into $auction.price
if now() lt $auction.closing-time
then insert into $auction.auctioneer.price
select increase ($autioneer.price, “value3”)
from actn uri “www.a.b.c/actn”,</p>
        <p>auction $actn.auction
where $auction.id = “id1”</p>
        <p>and $auction.auctioneer.id = “id2”
Here, now() returns the current time and increase(var,
val) increments the variable var by a value val. The
ECA rules are defined in advance and invoked on
events. The ECA rules can elegantly implement the
recommendation (e.g., Query5):
on select result {$book}
if $book.keyword = “Electronic Commerce”
then select result {$book}
from dlib URI “www.a.b.c/dlib.xml,</p>
        <p>book $dlib.book
where $book.keyword =</p>
        <p>“ElectronicCommerce” or
$book.keyword = “Internet Business”
Note that the result of the “event query” (i.e., first
“select”) is replaced by that of the “action query” (i.e.,
second “select”) in this case.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3 Implementation</title>
      <p>
        XBML is intended for use in not only modeling EC
business models, but also realizing them agilely.
XBML must be efficiently implemented, too. XBML
containing URIs intrinsically requires distributed
query processing. So we construct the XBML server
as follows:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) We construct local XBML servers as a basis.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) We construct global XBML servers by
extending the local servers with server-side
scripting techniques.
      </p>
    </sec>
    <sec id="sec-5">
      <title>3.1 Local Server</title>
      <p>We describe the basic architecture and
implementation of a local XBML server. First, we
describe storage schema for XML data. We have
explored approaches to mapping DTD to databases
(RDBMS, i.e., Oracle and ODBMS, i.e., Jasmine [9])
and to implement an XBML processing system [11].
If any DTD or schema information is available, we
basically map elements to tables and tags to fields,
respectively. We call this approach DTD-dependent
mapping, where the user must specify mapping rules
individually. Otherwise, we take a DTD-independent
mapping or universal mapping approach, which
divides XML data into nodes and edges of an ordered
directed graph and stores them into separate tables for
nodes and edges with neighboring data physically
clustered. We provide separate tables for nonleaf and
leaf nodes. The order fields of Leaf_Node and Edge
tables are necessary for providing access to ordered
elements by index numbers. Identifiers, such as ID
and IDREF, realizing internal links between elements
are declared as attributes and are stored as Value of
the separate Attribute_Node table. So references
through identifiers are efficiently resolved by
searching node identifiers in Attribute_Node.</p>
      <p>
        We cluster data in node and edge tables on a
breadth-first tree search basis. We have found this
way of clustering contributing very much to reducing
I/O cost. Further, we have known from our
preliminary experiments that the DTD-dependent
mapping approach is mostly two times more efficient
than the universal one. However, we have focused on
more of our implementation efforts on the universal
mapping approach for the following reasons:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) The approach can free the burden of defining
idiosyncratic mappings from the users.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) The approach can store XML data whose DTD
are unknown in advance.
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) The approach can store heterogeneous XML
data, in particular, semi-structured XML data
in the same database.
      </p>
      <p>Next, we describe the system architecture for a
local XBML server or an XBML processing system.
We make appropriate indices on tag values,
element-subelement relationships, and tag paths in
advance.</p>
      <p>We describe how the XBML processing system
works. The XBML language processor parses an
XBML query and the XBML query processor
generates and optimizes a sequence of access
methods for efficient execution. The primitive access
methods are basic operations on node sets,
implemented by using RDBMS or ODBMS. They
include get_NodeId_by_Path&amp;Val,
get_ParentId_by_Child, get_ChildId_by_Parent,
get_Value_by_Id, get_NodeId_by_Path, and
get_LabelId_by_LabelText in addition to node set
operators, such as union, intersection, and difference.
We illustrate the translation by using the query:
select $book.title
from dlib URI “www.a.b.c/dlib.xml”, book $dlib.book
where $book.publisher.name = “Prentice-Hall”</p>
      <p>This is parsed into an internal form, which denotes
a logical query plan represented as an ordered-graph:
(Proj (Sel $book (Op_EQ $book.publisher.name
“Prentice-Hall”)) $book.title)</p>
      <p>
        Here, Sel, Proj, and Join (not in the above
example) denote selection, projection, and join of
XML data, respectively. Op_EQ denotes “=”. This
internal form is reorganized in a pattern-directed
manner, such as placing Sel before Join, and is
transformed into the following primitive operations:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) get_NodeId_by_Path&amp;Val (Op_EQ
“$book.publisher.name” “Prentice-Hall” )
returns a node set set1 (i.e., $book.publisher).
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) get_ParentId_by_Child (set1 “$book”) returns
a node set set2.
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) get_ChildId_by_Parent (set2 “$book.title”)
returns a node set set3.
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) get_Value_by_Id (set3) returns a value set as a
result.
      </p>
      <p>Both RDBMS and ODBMS can be used as the
database system of the XBML processing system
with the upper layers unchanged by virtue of the
above primitive operators.</p>
      <p>
        We describe the implementation of ECA rules.
First, we define an event query by using the event and
the condition in the rules and define an action query
by using the action in the rules. Further, we store a
dedicated ECA rule database whose entry consists of
a pair of such an event and an action query. Now we
consider the following approaches to ECA rule:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) Monitor-based approach
The monitor checks each usual query against the
event query patterns in the ECA rule database and
issues the corresponding action query of the
matched event query if the condition is satisfied.
The monitor usually keeps a queue of events
generated by the matched event query and invokes
the action query by looking up in the queue.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) Query rewriting approach
We modify the query processing. The parser
checks each query against the event query patterns
in the ECA rule database and recursively processes
the corresponding action query of the matched
event query by adding a check on the condition.
That is, the “event query” and “action query” in the
rules are translated into a sequence of queries (i.e.,
primitive access methods) with a condition check.
      </p>
      <p>
        Next we consider the merits and demerits of the
above approaches as follows:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) Monitor-based approach
The monitor can control the whole processes in a
centralized manner. However, we need a monitor
itself as an extra mechanism. It is not trivial to
provide the facility for executing the event and
action queries as a single transaction.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) Query rewriting approach
We need no extra mechanism for controlling
processes.. It is rather straightforward to execute
the event and action queries as a single transaction.
However, the generated queries tend to be long, in
particular, for cascading events.
      </p>
      <p>For the moment, we adopt the query rewriting
approach in favor of the ease of the implementation.</p>
    </sec>
    <sec id="sec-6">
      <title>3.2 Global Server</title>
      <p>Now we construct the global XBML server by
extending the above local XBML servers with
server-side scripting techniques. We provide
preliminary definitions to queries. First, we
categorize queries as follows:
(A) Single-URI query
This type of query contains only one XML data
source specified by a single URL in the query,
such as Query1 (selection) and Query3 (join).
(B) Multiple-URI query
This type of query contains multiple XML data
sources specified by multiple URIs in the query.
This type is further categorized into two as
follows:
(B1) Decomposable query
This type of query can be decomposed into
a combination of single-URI queries with
set operators, such as Query4 (multiple
binding) and Query6 (set operators).
(B2) Non-decomposable query
This type of query cannot be decomposed
into a combination of single queries alone.
This type of query contains join queries
over multiple URIs, such as Query9 (join of
multiple data sources).</p>
      <p>Second, we categorize queries in another way:
(a) Local query
XML data sources specified by URI are inside
the relevant XBML server.
(b)Global query
XML data sources specified by URI are outside
the relevant XBML server.</p>
      <p>
        Now we show that non-decomposable (i.e.,
intrinsically global) query can be transformed into
a series of single URL local or global queries and
local queries (join). We assume that the original
query contains n URIs. We translate a
non-decomposable query by two steps:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) create a single-URI (local or global) query
for each of n URIs with the insertion of the
query result into the local server.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) create single-URI queries performing join of
the results stored in the local server, which
are local queries, by reducing all URIs to a
single-URI.
      </p>
      <p>
        Queries generated by the step (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) localize
single-URI global queries. Of course, single-URI
local queries remain local. We call them localized
single-URI queries. After that, queries generated by
the step (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) simulate join of multiple data sources by
join of local data sources. We call them localized join
queries. For example, when we assume that the global
server is resident at the “shipping site”, consider
again the following query (Query9):
select result {$order.item, $ship.status}
from o URI “www.a.b.c/ordering.xml”, s URI
      </p>
      <p>“www.d.e.f/shipping.xml”, order $o.order, ship $s.ship
where $order.id=$ship.id and $order.id=“cidymd”</p>
      <p>The query is translated into the following
localized single-URI query, whose result is fetched
into the global server:
select $order
from o URI “www.a.b.c/ordering.xml”, order $o.order
where $order.id=“cidymd”
and into the following localized join query, which
produces a result of the original query:
select result {$order.item, $ship.status}
from XBML:result URI “www.d.e.f/XBML:result.xml” ,
order $XBML:result.order, s URI “www.d.e.f/shipping.xml”,
ship $s.ship
where $order.id=$ship.id</p>
      <p>Now we describe the global query processing,
assuming that a query Q with a uri URI is specified as
the input:
if Q is a single-URI query then</p>
      <p>process-or-dispatch (Q);
else {/*i.e., Q is a multiple-URI query; */
if Q is a decomposable query then
{ for each sub-query Qsub in Q</p>
      <p>process-or-dispatch (Qsub);
merge the result by the local server;}
else {/*i.e., Q is not a decomposable query;*/
decompose Q into localized single-URI queries</p>
      <p>Qloc-s and localized join queries Qloc-j;
for each sub-query Qsub in Qloc-s</p>
      <p>process-or-dispatch (Qsub);
process Qloc-j by the local server;}
}
process-or-dispatch (Q) /* for single-URI query*/
{ if URI is local to the server then</p>
      <p>process Q by the local server;
else {/*i.e., Q is not local to the server; */
dispatch Q to the relevant remote server;
store the result into the local server;}</p>
      <p>The above query processing has some room for
improvement in performance. Thus, if the
non-decomposable query has no selection conditions,
the whole remote data sources specified by the
generated single-URI queries must be copied to the
local server. For example, consider Query9 when the
global server is resident at “ordering site” or at a third
site. Of course, if there is any selection condition on
the join key, the condition is propagated to all the
single-URI queries. We call this technique simple
selection condition propagation. It is a kind of static
query rewriting. However, we want more
improvement. So we refine the process-or-dispatch
scheme to sort the result of the query and return the
value range with respect to the join key (i.e., MIN and
MAX values) by adding “order-by” to the query.</p>
      <p>Then, the conditions “join-key ge min-value and
join-key le max-value” are dynamically added to the
subsequent generated single-URI query. In turn, the
query is evaluated to produce a new value range of
the join-key (i.e., min-value’ and max-value’). The
following characteristic holds: min-value’ &gt;=
min-value &amp; max-value’ &lt;= max-value. From this,
we can conclude that the expected selectivity is better
than that of the original algorithm. If a single-URI
query Q has any selection condition “keyQ ge
min-valueQ” and “keyQ le max-valueQ”, then we take
MAXQ(min-valueQ ) and MINQ(max-valueQ ) as an
initial min-value and max-value, respectively. A
single-URL query being firstly processed is chosen
from ones with any selection condition on the
non-key because now all the single-URL queries
virtually have the same condition on the key (i.e., the
initial value range). If there is no selection condition,
any local query being firstly processed will produce
the initial value range. It has the merits: It can avoid
extra data transfer by just issuing modified queries
and avoid extra protocol by just accommodating the
min/max values in results.</p>
      <p>XBML works as server-side scripting with
database access such as CFML[2], and ASP [15] and
provides universal access to distributed XML data. If
XBML queries are embedded in XML-based scripts,
the global XBML server can provide more direct and
universal interfaces to representing and accessing
distributed XML data than the other approaches. That
is, XML pages containing the element &lt;XBML&gt;
XBML-query &lt;/XBML&gt; are interpreted as scripts.</p>
    </sec>
    <sec id="sec-7">
      <title>4 Conclusion</title>
      <p>We have proposed and validated XBML as an XML
active query language approach to specifying EC
business models. We compare our work with related
work. There are no high-level language approaches to
modeling EC business processes, in particular, no
other work on validating the modeling language by
applying it to EC business models. XBML can
provide a more direct and universal tool for modeling
distributed XML data applications than server-side
scripting tools such as CFML [2], ASP [15].</p>
      <p>Now we will compare our XBML with other query
language proposals from the viewpoint of process
specification since XBML contains the query
language functionality as a basic part. XML-QL [6]
has comprehensive functionality and has much in
common with our XBML. However, condition
specification in XML-QL is rather verbose. If applied
to business modeling, XML-QL would make query
formation rather complex.</p>
      <p>XQL [16] has compactly-specified functionality
and has common functionality with our XBML. XQL
focuses more on filtering a single XML document by
flexible pattern match conditions similar to XSL. If
applied to specifying EC business models involving
multiple sites, XQL would require the user to write
extra application logic in addition to query formation.</p>
      <p>Lore [7] provides a powerful query language for
retrieving and updating semi-structured data based on
its specific data model OEM, but it lacks some
functionality such as multiple binding.</p>
      <p>So far we have compared XBML with the other
works only from the viewpoint of query languages.
However, the above languages are largely different
from XBML for the following reasons. First, we
focus our efforts on the distributed query processing
in the Web context. However, the above works don’t
cover such a topic. Second, we think that the
functionality of ECA rules is mandatory in order to
model control flow of E-businesses. However, all of
the above query languages lack ECA rules.</p>
      <p>Web query languages, such as W3QL [13], view
the Web as a single huge database and enable to
address the structures and contents. XBML views a
single Web source as a database and allows queries
over Web-based distributed databases.</p>
      <p>The active views [1] focuse on the comprehensive
functionality of ECA rules. On the other hand, we
have concluded the necessity of ECA rules from the
experiences of applying XBML to concrete
businesses. We extend the query optimization in
relational databases[14] to the distributed context.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1 Abiteboul,
          <string-name>
            <surname>S.</surname>
          </string-name>
          et al.:
          <article-title>Active Views for Electronic Commerce</article-title>
          ,
          <source>Proc. Intl. Conf. VLDB 1999</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2 Allaire Corporation: CFML, http://www.allaire.com/documents/cf4/CFML_Langua ge_Reference/contents.htm,
          <year>2000</year>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3 Chang,
          <string-name>
            <surname>C.H.</surname>
          </string-name>
          , et al.:
          <article-title>Enabling Concept-Based Relevance Feedback for Information Retrieval on the WWW, IEEE Trans</article-title>
          .
          <article-title>Knowledge and Data Eng</article-title>
          ., vol.
          <volume>11</volume>
          , no.
          <issue>4</issue>
          , pp.
          <fpage>595</fpage>
          -
          <lpage>609</lpage>
          ,
          <year>1999</year>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4 Conallen, J.:
          <article-title>Modeling Web Application Architectures with UML</article-title>
          ,
          <source>Comm. ACM</source>
          , vol.
          <volume>42</volume>
          , no.
          <issue>10</issue>
          , pp.
          <fpage>63</fpage>
          -
          <lpage>70</lpage>
          ,
          <year>1999</year>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5 Cooley, R., et al.:
          <source>Web Mining: Information and Pattern Discovery on the World Wide Web, Proc. the 9th IEEE International Conference on Tools with Artificial Intelligence (ICTAI'97)</source>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6 Deutsch,
          <string-name>
            <surname>A.</surname>
          </string-name>
          , et al.:
          <article-title>XML-QL: A Query Language for XML, http</article-title>
          ://www.w3.org/TR/1998/NOTE-xml-ql-
          <volume>19980819</volume>
          ,
          <year>1998</year>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7 Goldman,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>McHugh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            , and
            <surname>Widom</surname>
          </string-name>
          , J.:
          <article-title>From Semistructured Data to XML: Migrating the Lore Data Model and Query Language</article-title>
          ,
          <source>Proc. the 2nd Intl. Workshop on the Web and Databases (WebDB '99)</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8 Ishikawa, H., et al.:
          <article-title>An Active Object-Oriented Database: A Multi-Paradigm Approach to Constraint Management</article-title>
          ,
          <source>Proc. Intl. Conf. VLDB</source>
          ,
          <year>1993</year>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9 Ishikawa, H., et al.:
          <article-title>An Object-Oriented Database System Jasmine: Implementation, Application, and Extension</article-title>
          ,
          <source>IEEE Trans. Knowledge and Data Engineering</source>
          , vol.
          <volume>8</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>285</fpage>
          -
          <lpage>304</lpage>
          ,
          <year>1996</year>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10 Ishikawa,
          <string-name>
            <surname>H.</surname>
          </string-name>
          , et al.: http://www.w3.org/TandS/QL/QL98/pp/flab.doc,
          <year>1998</year>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11 Ishikawa,
          <string-name>
            <surname>H.</surname>
          </string-name>
          , et al.:
          <article-title>Document Warehousing Based on a Multimedia Database System</article-title>
          ,
          <source>Proc. IEEE 15th Intl. Conference on Data Engineering</source>
          , pp.
          <fpage>168</fpage>
          -
          <lpage>173</lpage>
          ,
          <year>1999</year>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12 Jutla,
          <string-name>
            <surname>D.</surname>
          </string-name>
          , et al.:
          <article-title>Making Business Sense of Electronic Commerce</article-title>
          , IEEE Computer, pp.
          <fpage>67</fpage>
          -
          <lpage>75</lpage>
          , Mar. 1999
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13 Konopnicki,
          <string-name>
            <surname>D.</surname>
          </string-name>
          et al.:
          <article-title>W3QS: A Query System for the World-Wide Web</article-title>
          .
          <source>Proc. Intl. Conf. VLDB</source>
          ,
          <year>1995</year>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14 Makinouchi,
          <string-name>
            <surname>A.</surname>
          </string-name>
          et al.:
          <article-title>The Optimization Strategy for Query Evaluation in RDB/V1</article-title>
          , Proc.
          <source>Intl. Conf. VLDB</source>
          ,
          <year>1981</year>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15 Microsoft: ASP, http://www.activeserverpages.com,
          <year>2000</year>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16 Robie,
          <string-name>
            <surname>J.</surname>
          </string-name>
          , et al.:
          <article-title>XML Query Language (XQL)</article-title>
          , http://www.w3.org/TandS/QL/QL98/pp/xql.html,
          <year>1998</year>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17 Special Section:
          <source>Recommender Systems, Comm. ACM</source>
          , vol.
          <volume>40</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>56</fpage>
          -
          <lpage>89</lpage>
          ,
          <year>1997</year>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>