Exposing Data

Who needs to read this?

This is relevant to you if you have a database containing data, and wish to expose this as a resource that can be integrated by the Fluxion stack.

What you need

  • Fluxion meta-model - If there is no meta-model available, you should refer to Meta-Models for a discussion of how to develop one of these.
  • Fluxion DBM support module - If there is no module supporting your DBM available, you should refer to Adding Support for a new Database Management System for a discussion of how to develop one of these.

What you need to put in your project

  • A dependency on the meta-model
  • A dependency on the relevant support module
  • Any configuration that the support module requires. This is likely to include database connection data (probably a username and password) and schema information.

A sample pom.xml file for a datasource module would look something like this:

<?xml version="1.0"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>my-group</groupId>
  <artifactId>my-datasource</artifactId>
  <name>A sample datasource being exposed</name>
  <version>123</version>
  <url>http://maven.apache.org</url>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.sourceforge.fluxion.datapublisher.plugins</groupId>
        <artifactId>generate-beans-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <configuration>
          <schema>mysql</schema>
          <connection>jdbc:mysql://my.group.org:3306/datasource123</connection>
          <userName>anonymous</userName>
          <password></password>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>net.sourceforge.fluxion.datapublisher</groupId>
            <artifactId>mysql-impl</artifactId>
            <version>1.0-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>net.sourceforge.fluxion.datapublisher.plugins</groupId>
        <artifactId>generate-owl-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>net.sourceforge.fluxion.datapublisher</groupId>
      <artifactId>mysql-impl</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.fluxion.datapublisher</groupId>
      <artifactId>sql-meta-owl</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>
</project>

What you will get when you build the project

  • A jar archive which acts as a datasource model - it contains code that implements a translation from your native datasource into an OWL Publisher. This provides the functionality to move data and queries from the underlying datasource and an equivalent OWL ontology.

What next?

Once you have the datasource model, you will probably wish to expose this as a webservice.

To do this, you need to build a new project which contructs a war archive. It's very simple to create a Publisher webservice - you need to add dependencies to your project on the deployment code and the Fluxion webapp-component module. The webapp-component module is a "skeleton" webservice containing all the required webservice magic to deploy a complete Publisher webservice. When you build this project, the webapp-component will be unwrapped and repackaged along with your deployment code. This war is capable of bootstrapping itself and discovering the available datasource models, which are then used to publish data.

For the datasource described by the project above, you could create a publisher for it with another project, with a pom.xml file that looked something like:

<?xml version="1.0"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>my-group</groupId>
  <artifactId>publisher</artifactId>
  <packaging>war</packaging>
  <name>Publisher for the sample datasource above</name>
  <version>1.0</version>
  <url>http://maven.apache.org</url>
  <build>
    <finalName>SamplePublisher</finalName>
  </build>
  <dependencies>
    <dependency>
      <groupId>my-group</groupId>
      <artifactId>my-datasource</artifactId>
      <version>123</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.fluxion.datapublisher</groupId>
      <artifactId>webapp-component</artifactId>
      <type>war</type>
      <version>1.0-SNAPSHOT</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

We hope to provide a Maven plugin to generate artifacts with this functionality already included very soon. This plugin would allow you to generate both the datasource model and the complete, packaged webservice automatically from a single command, with minimal user input (possibly, only a datasource URL, username and password would be required).

The data published by your new Fluxion Publisher webservice can then be consumed directly by semantic-web applications built upon the Fluxion data integration stack. However, to get the full benefit from it, you will need to think about mapping your data into a domain ontology - a schema that is shared by a group of people. This will require you to develop a set of rules that perform a Datasource Transformation.

 
2010 ©