ORDI v0.5 is an open-source ontology middleware that enables enterprise data integration. The ORDI data model introduces basic notions and RDF-like data-structures optimized for ontology and data representation. The model is no way ontology specific and does not prescribe any sort of semantics and epistemology - therefore it is left to the higher levels to impose further interpretations over it. ORDI contains the following modules:
The table below specify the different version of the modules and their compatibility:
Version of ORDI framework | ORDI specification | WSMO4RDF | TRREE Adapter | OWLIM Adapter | YARS Adapter | RDBMS Adapter |
ORDI 0.5-alpha1 | ORDI 0.5-alpha1 | - | - | 2.9.4-b1 | 20070304-b1 | - |
ORDI 0.5-alpha2 | ORDI 0.5-alpha2 | 0.6.1-b1 | 3.0alpha3-b1 | - | - | - |
ORDI 0.5-beta1 | ORDI 0.5-beta1 | 0.6.1-b2 | 3.0alpha4-b1 | - | - | 0.5-beta1 |
ORDI 0.5-SNAPSHOT (current) | ORDI 0.5-SNAPSHOT | 0.6.1-SNAPSHOT | 3.0alpha4-SNAPSHOT | - | - | 0.5-SNAPSHOT |
ORDI framework uses version format major.minor.service.distribution, where major and minor correspond to ORDI specification, service is incremented with the availability of new modules and lastly distribution is increased only if changes in the distribution occurs and codebase remains the same.
ORDI specification is versioned only with major and minor version.
The different modules reuses the version of the major module they depend (i.e., WSMO4RDF depends on 0.6.1, so its version is 0.6.1) and build number is added to distinguish the different functionality of the module.
The development of OWLIM Adapter is discontinued. The module is replaced by the TRREE Adapter.
ORDI comes bundled with all third party libraries needed to start and does not include JVM. You have to install JVM 1.5 or latter. The used third-party runtime libraries packages are:
TRREE is not an open source software. It is owned by Ontotext Lab. SwiftTRREE v3.0 is licensed for use free of charge as integral part of ORDI Framework. Re-distribution of TRREE in any form, except as part of the original ORDI distribution package, is stricly forbidden. Any form of modification or reverse-engineering of TRREE is forbidden. SwiftTRREE is distributed toghether with ORDI without any warranty.
import com.ontotext.ordi.Factory; import com.ontotext.ordi.tripleset.TSource; ... TSource source = Factory.createDefaultTSource();
The default configuraion is read from ordi.properties. The file uses a format compatible with the serialization of java.util.Properties. For more information please refer to the javadoc of Java Platform.
NB: The default ORDI data model implementation requires to set at least 256MB maximum heap memory with the argument "-Xmx256m".
import com.ontotext.ordi.Factory; import com.ontotext.ordi.exception.ORDIException; import com.ontotext.ordi.iterator.CloseableIterator; import com.ontotext.ordi.tripleset.TConnection; import com.ontotext.ordi.tripleset.TFactory; import com.ontotext.ordi.tripleset.TSource; import com.ontotext.ordi.tripleset.TStatement; import com.ontotext.ordi.tripleset.impl.TFactoryImpl; ... TConnection connection = source.getConnection(); // create RDF type factory TFactory factory = new TFactoryImpl(); Resource subj = factory.createBNode(); URI pred = factory.createURI("urn:quick:start:example"); Value obj = factory.createLiteral("Quick start example!"); URI namedGraph = factory.createURI("urn:example:graph"); try { connection.addStatement(subj, pred, obj, namedGraph); CloseableIterator iterator = connection.search(subj, pred, obj, namedGraph, null); while(iterator.hasNext()) { TStatement statement = iterator.next(); } connection.removeStatement(subj, pred, obj, namedGraph); } catch (ORDIException e) { ... }
Classes that implement the TSource interface are required to have a non-argument constructor (no configuruable) or constructor with a MapObject, Object argument (configurable). The default properties of configurable types are set in ordi.properties and are overridden by the user specified properties, provided in the Factory.createTSource(Map) method. The existence of ordi.properties is not mandatory if Factory.createDefaultTSource() is not used.
import java.util.Map; import java.util.HashMap; import com.ontotext.ordi.Factory; import com.ontotext.ordi.tripleset.TSource; ... Map configurationMap = new HashMap(); // Class to implement TSource interface configurationMap.put(TSource.class.getName(), "my.class.to.implement"); // Configuration used by the implementation configurationMap.put(myConfigKey, myConfigValue); TSource source = Factory.createTSource(configurationMap); ... source.shutdown();
WSMO4RDF implementation realizes a bidirectional mapping between WSML and WSML RDF - a serialization format defined by [D32 WSML/RDF]. The reference implementation of the WsmoRepository interface uses the named graph and tripleset elements to specify the TopEntity and the Entity that produced the triple statement respectively.
import com.ontotext.ordi.Factory; import com.ontotext.ordi.wsmo4rdf.Repository; ... // Instantiate WsmoSource WsmoSource wsmoSource = Factory.createTSource(WsmoSource.class, null); // WsmoConnection implements WsmoRepository interface WsmoConnection wsmoConnection = wsmoSource.getConnection(); ... wsmoSource.shutdown();
The WSMLTripleSerializer serializes wsmo4j TopEntity types (Ontology, WebService, Goal, Mediator, Capability and Interface) to WSML RDF according to the WSML to RDF mapping specification, [D32 WSML/RDF]. The example below demonstrates how to transform an array of TopEntity objects to a stream of RDFXML.
import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.wsmo.common.TopEntity; import org.wsmo.wsml.Serializer; import com.ontotext.ordi.wsmo4rdf.WSMLTripleSerializer; ... TopEntity[] topEntities = ...; // Construct a WSMLRDF serializer Map<String, Object> createParams = new HashMap<String, Object>(); createParams.put(org.wsmo.factory.Factory.PROVIDER_CLASS, WSMLTripleSerializer.class.getName()); Serializer rdfparser = org.wsmo.factory.Factory .createSerializer(createParams); // Generate the output WSMLRDF try { rdfparser.serialize(topEntities, writer); } catch (IOException e) { throw new RuntimeException("Error while generating the WSMLRDF!", e); }
The WSMLTripleParser is responsible for the transformation of WSML RDF to wsmo4j types. The input of the parser is RDFXML document formatted according to the WSML to RDF specification, [D32 WSML/RDF]. The example below demonstrates how to process a WSML RDF file and transform it to WSMO types.
import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.wsmo.common.TopEntity; import org.wsmo.factory.Factory; import org.wsmo.wsml.Parser; import com.ontotext.ordi.wsmo4rdf.WSMLTripleParser; ... // Create WSMLRDF parser Map<String, Object> createParams = new HashMap<String, Object>(); createParams.put(org.wsmo.factory.Factory.PROVIDER_CLASS, WSMLTripleParser.class.getName()); Parser wsmlrdfParser = Factory.createParser(createParams); // Parse the input WSMLRDF file TopEntity[] topEntities = null; try { topEntities = wsmlrdfParser.parse(new FileReader(file)); } catch (Exception e) { throw new RuntimeException(String.format( "Could not processes the input file %s!", file .getAbsolutePath()), e); }
WSMO4RDF implementation realizes a bidirectional mapping between WSML and WSML RDF - a serialization format defined by [WSML to RDF serialization]. The reference implementation of WsmoRepository interface uses the named graph and tripleset elements to specify the TopEntity and the Entity to result the triple statement.
In WSMO4RDF data service distribution two tools wsml2wsmlrdf and wsmlrdf2wsml are provided. To start using them set ORDI_HOME variable to the directory you have unzipped WSMO4RDF distribution, so %ORDI_HOME%\bin should be accessible. Conversion of WSML document to WSMLRDF document is performed by executing:
wsml2wsmlrdf <path_to_file_name>
The command above will result path_to_file_name.rdfxml file to contain the output WSMLRDF content in the directory of the input file.
To perform the reverse conversion from WSMLRDF to WSML use the command:
wsmlrdf2wsml <path_to_file_name>
A new output file will be created with the name path_to_file_name.wsml in the directory where the input file is located.
[D32 WSML/RDF] J. de Bruijn D32v0.1 RDF Representation of WSML; available at http://www.wsmo.org/TR/d32/v0.1/