HistoryViewLinks to this page 2012 August 29 | 01:30 pm

The approach below is to replace the ParameterDefinition in the current specification with the =oslc:Property= value type. It seems to provide all of the concepts needed: “required-ness”, default values, etc. Everything except the actual name of the parameter itself - and it seems that dcterms:title could be used for this value. For this proposal, a new attribute oslc_auto:parameterName is used. This will be a point for discussion.

To convert the sample below to XML, copy/paste it here: http://www.rdfabout.com/demo/validator/ and use Input Format of Turtle.

#Example Automation Plan and Automation Request with parameters

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix oslc: <http://open-services.net/ns/core#>.
@prefix oslc_auto: <http://open-services.net/ns/auto#>.

# Example of an automation plan with 2 parameters:  required string and optional enumerated integer

<http://example.org/autoPlans/plan1>
    dcterms:title "Automation Plan 1";
    dcterms:identifier "1"; 
    rdf:type oslc_auto:AutomationPlan;
    oslc_auto:parameterDefinition _:parm1;
    oslc_auto:parameterDefinition _:parm2.

# Example of a required string parameter with a default value
_:parm1
    rdf:type oslc:Property;
    dcterms:title "String Parameter";
    dcterms:description "This is a simple string parameter with a default value";
    oslc:name "StringParm1";
    oslc:occurs "http://open-services.net/ns/core#Exactly-one";
    oslc:propertyDefinition oslc_auto:ParameterInstance;
    oslc:valueType "http://www.w3.org/2001/XMLSchema#string";
    oslc:defaultValue "Hello World".

# Example of an optional integer parameter with enumerated allowed values
_:parm2
    rdf:type oslc:Property;
    dcterms:title "Integer Enumeration Parameter";
    dcterms:description "This is an integer enumeration with allowed values 1-4";
    oslc:name "IntEnum1";
    oslc:occurs "http://open-services.net/ns/core#Zero-or-one";
    oslc:propertyDefinition oslc_auto:ParameterInstance;
    oslc:valueType "http://www.w3.org/2001/XMLSchema#integer";
    oslc:allowedValues :_parm2AllowedValues;
    oslc:defaultValue "3"^^<http://www.w3.org/2001/XMLSchema#integer>.

_:parm2AllowedValues
    oslc:allowedValue "1"^^<http://www.w3.org/2001/XMLSchema#integer>;
    oslc:allowedValue "2"^^<http://www.w3.org/2001/XMLSchema#integer>;
    oslc:allowedValue "3"^^<http://www.w3.org/2001/XMLSchema#integer>;
    oslc:allowedValue "4"^^<http://www.w3.org/2001/XMLSchema#integer>.

#Example automation request using the above automation plan
<http://example.org/autoPlans/request1>
   dcterms:title "Request to execute automation plan plan1
   rdf:type oslc_auto:AutomationRequest;
   oslc_auto:executesAutomationPlan <http://example.org/autoPlans/plan1>;
   oslc_auto:parameter _:reqParm1;
   oslc_auto:parameter _:reqParm2.

_:reqParm1
   rdf:type oslc_auto:ParameterInstance;
   foaf:name "StringParm1";
   rdf:value "My value for the string"^^<http://www.w3.org/2001/XMLSchema#string>.

_:reqParm2
   rdf:type oslc_auto:ParameterInstance;
   oslc:name "IntEnum1";
   rdf:value "1"^^<http://www.w3.org/2001/XMLSchema#integer>.