facilitate the replacement of OpenRDF with another,
possibly non-RDF DBMS if that is desired at some
point. Of course, there is then a trade-off between
the flexibility provided by RDF and the possibly
more rigid commitments of an alternative DBMS.
3 CONFIGURING SOURCES AND
DESTINATIONS
The Broker converts data received from sources into
its own data structures, and converts its own data
structures into those expected by the destinations. In
this sense, the Broker plays a role analogous to the
well-known software mediator pattern (Gamma et
al., 1994). Unlike the mediator pattern, however, the
Broker is an application in its own right, mediating
between applications rather than objects within a
single software system.
There are three categories of data structures
managed by the Broker: 1) The Broker’s own
structures; 2) Data source structures; 3) Data
destination structures. Each source and destination is
defined to the Broker in terms of the data structures
the source or destination uses.
The Broker’s own structures are required in
order to provide a persistent store independent of the
sources and destinations. Since there is potentially a
lot of overlap between source and destination
information, simply aggregating them into a
persistent store would be highly redundant.
The Broker repository code does not, however,
reference the Broker structures explicitly. Instead, it
makes extensive use of Java reflection to reference
classes, methods, and fields anonymously, so that
the repository code need not change even if the
structures change (Oracle, 2015a). This combination
of Java reflection and schema-less RDF provides the
core flexibility of the tool. It is complemented by the
use of the Java-XML Binding (JAXB) to generate
Java classes automatically from XML Schema
documents specifying the source and destination
data structures (Oracle, 2015b). JAXB, reflection,
and RDF allow the Broker to evolve without
additional coding.
The Broker requires some basic information
about each source or destination:
How information will be moved between the
Broker and the source or destination;
How the source or destination data are
structured;
How to map between the source and destination
data and the Broker’s own structures.
One provides this information through a set of
start-up parameters.
The question of how information will be moved
breaks down, in turn, to the following questions:
What vehicle is used to communicate with the
source or destination? For example: web-based
communication using HTTP, or some form of
remote program call, or direct file or database
access;
Which party is the active party in the exchange?
For a data source, the Broker can poll the source
periodically to check for updates, or it can let the
source contact the Broker with updates as they
occur. For a destination, the Broker can contact
the destination when there are updates, or it can
wait for the destination to request them.
These questions are answered by choosing a
software pattern for implementing the source or
destination. The patterns are implementations of the
Broker’s abstract interfaces IDataSource and
IDataDest, respectively. These interfaces are
analogous in purpose to those of the same name
found in other frameworks, such as .Net, but they
are otherwise unrelated. Here, for example, is
IDataSource:
public interface IDatasource<T_Struct,
T_IO> {
public String getSourceName();
public void setSourceName(String s);
public XMLGregorianCalendar
getLastUpdatedDate();
public void
setLastUpdatedDate(
XMLGregorianCalendar date);
public String dateForQuery();
public Lists acceptData();
public Lists acceptData(String d);
public T_IO readData();
public T_IO readData(String d);
public T_Struct unmarshall(
T_IO marshalledData);
public Lists transform(
T_Struct data);
public Lists transform(
T_Struct data,
String researcherId);
}
The Broker provides several default
implementations of these interfaces, sufficient for
most purposes.
Besides the source or destination’s data
structures, each source or destination requires that a
transformation be defined between its structures and
the Broker’s. The transformation enables the Broker
to transform a source’s structures into its own core