Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Resource Shape 

Wed March 18, 2020 11:21 AM

Resource Shape Document

The resource shape provides a description of the resource and its attributes.  Some of the information it provides is similar to what you would find in an XML schema. In the description below, the OSLCWODETAIL Resource Shape is used as an example to describe some of the key points

Using the <oslc:resourceShape> URI (from the Service Provider document), the shape document can be retrieved for the resource.

Sample URI:

http://localhost/maximo/oslc/shapes/oslcwodetail (GET)

 

 NOTE:Below is a sample snippet of the shape document (not the entire shape)

 Sample Response (supported in RDF/XML format only):

 

 <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#">

  <oslc:ResourceShape rdf:about="http://localhost/maximo/oslc/shapes/oslcwodetail">

    <oslc:property>

      <oslc:Property>

        <oslc:name>wplabor</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#wplabor"/>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Inline"/>

        <oslc:valueShape rdf:resource="http://localhost/maximo/oslc/shapes/oslcwodetail/wplabor"/>

        <oslc:range rdf:resource="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#PlannedLabor"/>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <spi:scale>2</spi:scale>

        <oslc:usage rdf:resource="http://jazz.net/ns/ism/datatypes/smarter_physical_infrastructure#amount"/>

        <oslc:name>actoutlabcost</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#actoutlabcost"/>

        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#double"/>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Actual Hours of External Labor</dcterms:title>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <oslc:name>parentwonum</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#parentwonum"/>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference"/>

        <oslc:valueShape rdf:resource="http://localhost/maximo/oslc/shapes/oslcwodetail"/>

        <oslc:range rdf:resource="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#WorkOrder"/>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Parent WO</dcterms:title>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <oslc:name>title</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/title"/>

        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>

        <oslc:maxSize>100</oslc:maxSize>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Description</dcterms:title>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <oslc:usage rdf:resource="http://jazz.net/ns/ism/datatypes/smarter_physical_infrastructure#upper"/>

        <oslc:name>status</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#status"/>

        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>

        <oslc:maxSize>16</oslc:maxSize>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Status</dcterms:title>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <oslc:name>location</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#location"/>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference"/>

        <oslc:valueShape rdf:resource="http://localhost/maximo/oslc/shapes/oslcoperloc"/>

        <oslc:range rdf:resource="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#Location"/>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Location</dcterms:title>

      </oslc:Property>

    </oslc:property>

    <oslc:property>

      <oslc:Property>

        <oslc:name>asset</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#asset"/>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference"/>

        <oslc:valueShape rdf:resource="http://localhost/maximo/oslc/shapes/oslcasset"/>

        <oslc:range rdf:resource="http://open-services.net/ns/asset#Asset"/>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Asset</dcterms:title>

      </oslc:Property>

    </oslc:property>

   <oslc:property>

      <oslc:Property>

        <oslc:usage rdf:resource="http://jazz.net/ns/ism/datatypes/smarter_physical_infrastructure#upper"/>

        <oslc:name>shortTitle</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#shortTitle"/>

        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>

        <oslc:maxSize>16</oslc:maxSize>

        <oslc:defaultValue>&amp;AUTOKEY&amp;</oslc:defaultValue>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Work Order</dcterms:title>

      </oslc:Property>

    </oslc:property>

 

The above resource shape sample provides a list of attributes that are contained within the resource.  Below is the shortTitle <oslc:name> property which is the OSLC mapped name for the Work Order Number (WONUM).  The shortTitle property is used for the ‘name’ of the property. Considering other Maximo data, the ASSETNUM would be the shortTitle for the Asset resource and the LOCATION would be the shortTitle for the Location resource.

     <oslc:property>

      <oslc:Property>

        <oslc:usage rdf:resource="http://jazz.net/ns/ism/datatypes/smarter_physical_infrastructure#upper"/>

        <oslc:name>shortTitle</oslc:name>

        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>

        <oslc:propertyDefinition rdf:resource="http://open-services.net/ns/core#shortTitle"/>

        <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>

        <oslc:maxSize>16</oslc:maxSize>

        <oslc:defaultValue>&amp;AUTOKEY&amp;</oslc:defaultValue>

        <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"

        >Work Order</dcterms:title>

      </oslc:Property>

    </oslc:property>

 

The oslc.propertyDefinition defines the qualified name (namespace#name) of the property.

 The oslc:occurs defines the occurrence of the property in the resource, in this case it is 0 or 1.  The property for wplabor (planned labor associated to the WO) is 0 or many, meaning there could be 0 or more than 0 planned labor.

The oslc:valueType defines the datatype, in this case it is a string. This is based on the WONUM attribute’s registration in the Maximo Data Dictionary

The oslc:usage provides an additional detail related to the Maximo datatype, in this case it notes that the field is defined as UPPER

The oslc:maxSize defines the field length, in this case 100.  This is based on the WONUM attribute’s registration in the Maximo Data Dictionary

The oslc:defaultValue defines the Maximo default value configured in the data dictionary.  In this case this field uses the Maximo Autokey as the default.

The dcterms:title defines the literal name of property, in this case it is Work Order. This could be considered equivalent to the label that displays next to the field in an application UI.

 

When other related resources are within a resource they can be represented as follows:

For wplabor, the <oslc:valueType> is defined as Resource and the <oslc:representation> is defined as Inline.  This means that the attributes of the wplabor resource is included in this oslcwodetail resource.

      <oslc:Property>

        <oslc:name>wplabor</oslc:name>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Inline"/>

 

For asset, the <oslc:valueType> is defined as Resource and the <oslc:representation> is defined as Reference.  This means that the asset resource can be retrieved as a resource itself.  When you query (GET) the oslcwodetail resource, the asset property returned will be a URI to that asset resource, rather than the asset number.  This asset URI can be used to retrieve the asset number and other properties of the asset. The shape URI is provided (<oslc:valueShape>) in order to retrieve details about the asset resource.

      <oslc:Property>

        <oslc:name>asset</oslc:name>

        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>

        <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference"/>

        <oslc:valueShape rdf:resource="http://localhost/maximo/oslc/shapes/oslcasset"/>

      </oslc:Property>




#MaximoIntegrationandScripting
#AssetandFacilitiesManagement
#Maximo

Statistics
0 Favorited
8 Views
0 Files
0 Shares
0 Downloads