Hi 
I am looking into implementing the OSLC Actions specification for the Maximo/Tririga product suite - primarily for consumption by our Mobile clients which currently use the OSLC API to interface with the Maximo/Tririga systems. One of the major requirements for our Mobile architecture is to be able to introspect the metadata for resource actions to design the mobile apps corresponding to the actions. In our user case a resource type (say WorkOrder) will have a global list of possible actions - each action associated with some condition/authorization metadata which determines the resource states this action is valid. At design time the client (say Mobile App Designer) would need to introspect the resource type metadata (say OSLC shape for the resource type) to discover the possible list of actions ( for the resource type) - this will be used by the designer to generate application artifacts that will consume the said actions. At run time the device would introspect the resource representation to determine if the action is valid for this resource state - which will be used to hide/show the said action app artifacts (say a button).

Now as I look into the current specification for OSLC Actions - 2 things stand out
1. The oslc:action property is associated with the resource instance - and not the type. For our use case - we would need the action metadata available at the type level - say ResourceShape.
2. the metadata part for the actions are attached to the oslc:bindings predicate -->http:HttpRequest resource type. We would need to use some predicate like spi:instanceAction (or oslc-automation:futureAction) in the shape document like below

  <oslc:ResourceShape rdf:about="http://localhost:7006/maximo/oslc/shapes/oslcwodetail">
    <spi:instanceAction>
      <oslc:Action>
        <oslc:binding rdf:resource="http://localhost:7006/maximo/oslc/actionmeta/oslcwodetail/changeStatus"/>
<oslc:usage rdf:resource="http://jazz.net/ns/ism/smarter_physical_infrastructure#WorkOrder-changeStatus"/>
        <rdf:type rdf:resource="http://open-services.net/ns/core#Action"/>
        <dcterms:description rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
        >Action to change status of the Work Order resource</description:title>
        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
        >changeStatus</dcterms:title>
      </oslc:Action>
    </spi:instanceAction>
    <oslc:property>
      <oslc:Property>
....


<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:spi="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#"
xmlns:spi="http://www.w3.org/2011/http#">
  <http:HttpRequest rdf:about="http://localhost:7006/maximo/oslc/actionmeta/oslcwodetail/changeStatus">
    <!--http:requestURI rdf:resource="http://localhost:7006/maximo/oslc/os/oslcwodetail/{id}/changeStatus"/-->
    <http:mthd rdf:resource="http://www.w3.org/2011/http-methods#POST"/>
<http:httpVersion>1.1</http:httpVersion>
<http:body rdf:resource="http://localhost:7006/maximo/oslc/actionshapes/oslcwodetail/changeStatus">
<oslc:finalStatusLocation rdf:resource="http://www.w3.org/2011/http#StatusCode">
  </http:HttpRequest>
</rdf:RDF>


As you can notice - http:requestURI - which is marked in the spec as Exactly-One - would be something that we would have no need of at this "blue-print" stage. 
Also I would like to hear any comments on the choice of predicates that we have for replacing spi:instanceActions. I am not sure if oslc-automation:futureActions is the right one for this - but will like to hear back from the group. I would rather not come up with our own - if there is something already defined for the same purpose.

Our runtime resource representation would have the oslc:action array property which would look like below

<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:spi="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#"
xmlns:spi="http://www.w3.org/2011/http#">
    ......
    ......
    <oslc:action>
      <oslc:Action>
        <oslc:binding rdf:resource="http://localhost:7006/maximo/oslc/action/oslcwodetail/changeStatus"/>
<oslc:usage rdf:resource="http://jazz.net/ns/ism/smarter_physical_infrastructure#WorkOrder-changeStatus"/>
        <rdf:type rdf:resource="http://open-services.net/ns/core#Action"/>
      </oslc:Action>
    </oslc:action>
   .......
</rdf:RDF>

And the corresponding HttpRequest resource as below (note that we only need the requestURI - as rest of it has already been provided in the shape document)

<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:spi="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#"
xmlns:spi="http://www.w3.org/2011/http#">
  <http:HttpRequest rdf:about="http://localhost:7006/maximo/oslc/action/oslcwodetail/changeStatus">
    <http:requestURI rdf:resource="http://localhost:7006/maximo/oslc/os/oslcwodetail/12345/changeStatus"/>
  </http:HttpRequest>
</rdf:RDF>

Let me know if this use case makes sense - its driven by the 2 step model that we follow - 1>design time (introspection, artifact generation stage) and 2>runtime (actual usage).

thanks
Anamitra

Reply via email to