Graph Create, Query, and Update with SDO

The SDO standard provides for a component, the Data Access Service or DAS. The DAS was developed to support the use of SDO specific forms of external storage. There are DAS components that support most relational database products, and there are DAS components that support many XML databases. Wikipedia is a good place to start if you’re not familiar with SDO,

The OtterServer includes a DAS component to support ontology information. The component is the OntoDAS. This DAS provides the ability to create datagraphs, query them, and update them, where all of the functions follow the standards of SDO.

Creation of a SDO Datagraph is accomplished with straightforward mapping as described in the post, “Mapping Class Expression Graphs and SDO”. This mapping is done by the DAS when the method “createDatagraph”is called. This method has the single parameter of an OWL class expression. If the expression is valid, the datagraph is created.

Query performs a create and then populates the datagraph with the individuals that satisfy the OWL class expression. This is provided by the DAS method, “getDatagraph” with the single parameter of the class expression. Once the datagraph is populated, its content can be accessed using the methods of SDO. Processing generally begins with the DataObjects in the root. From there, the properties provide access to data values and the transition to other DataObjects.

Update is a standard in SDO. A Datagraph, whether created or populated by a query, is processed the same for an update. To start an update, the ChangeSummary object requested from the Datagraph is will begin logging. Any changes to the datagraph are then recorded in the log. This includes adding new root DataObjects or deleting them. It also includes changes to property values as new, deleted, or modified. The log includes the state of the entity both before and after the change. Once all changes are applied to the datagraph, the DAS is requested to apply all changes.

SDO uses optimistic concurrency control for applying transaction updates. The assumption is that multiple transactions can frequently complete without interfering with each other. However, since one or more transactions may attempt to modify the same information at the same time, the SDO change process validates that the information being modified is the same as when it was originally queried. If the update fails to validate, the DAS throws an exception.

In the OtterServer demo of pizza store operation, financial information is updated by different services in separate threads. This does result in collisions. When this occurs, the transaction processing is simply retried.

SDO is an excellent standard for processing graphs. This provides a great way to access and update ontology information.