Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Jena model mapping dependencies



It is possible to specify dependencies between objects in the mappings. It will allow to be sure that if you have to declare object properties between Classes in the Ontology, the instances upon which you rely exist.

Overview


For example, suppose that you receive Waypoints through a Service, and a Flightplan referencing these Waypoints through another service. You need to be sure that the Waypoints have been added in the Ontology when you add the Flightplan. In the general case you will need to perform this at your module level:
jenawithoutDependencies
The mappings specification allow you to do this automatically. Here the module apply operations to create the Flightplan before the Waypoints are created, but the Jena module will wait until the Waypoints are created to apply the Flightplan creation in the Ontology:
jenawithDependencies

Declaring dependencies

The dependencies element for an object specifies that the object depends on other objects. This indicates that if your module adds the element to your Ontology, the Jena module will wait until the elements on which it depends have been added to effectively perform the add.

An object can depend on more that one object.


For example the following declaration specifies that the flightplan object depends on the waypoint object:
      <object name="flightplan" className="FlightPlan">        
         <dataProperty name="label" property="Label" isName="true"/>    
         <property name="waypoint" eltRef="waypoint"  property="hasWaypoint" inverseProperty="isWaypointFrom" cardinality="unbound" inverseCardinality="one" />  
         <dependencies>
            <dependency dependsOn="waypoint" />
         </dependencies>       
      </object>

Indirect dependencies

The Jena module handle indirect dependencies. For example, you can declare that:
  • The flightplan object depends on the waypoint object
  • The aircraft object depends on the flightplan and waypoint objects

jenawithDependencies2

Specify the behavior when the operations can not be applied immediately

By default object operations which can not be applied immediately are stored by the Jena module, and applied later when they can be applied. However it is possible to specify the behavior to follow in that case with the behavior attribute on the dependencies element:
  • "store" (the default value): store the operations until they can be applied
  • "discard": discard the operations
For example:
      <object name="track" className="Aircraft">
         <geometry />          
         <dataProperty name="label" property="Label" isName="true"/>  
         <dependencies behavior="discard">
            <dependency dependsOn="flightplan" />
            <dependency dependsOn="waypoint" />
         </dependencies>       
      </object>

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence