Skip to content

How to describe a RESTfull API for a service interaction?

drleidig edited this page Nov 23, 2012 · 4 revisions

Tags: snippets

In USDL-Core

usdl:receives a rdf:Property 
  rdfs:domain usdl:InteractionPoint;
  rdfs:range rdfs:Class.

Domain Specific Ontology

:PersonDetails a rdfs:Class.

 :hasAge a rdf:Property;
    rdfs:range gr:QuantitativeValue;
    rdfs:domain :PersonDetails.

:hasWeight a rdf:Property;
  rdfs:range gr:QuantitativeValue;
  rdfs:domain :PersonDetails.

Service Specific

<#CaloriesInteractionPoint> a usdl:InteractionPoint;
   dcterms:title "Calculate calories";
   usdl:receives :PersonDetails.

 <#msmCalcCalories> a msm:Operation ;
     rdfs:label "CalcCalories";
     msm:hasInput :calcCaloriesInput;
     msm:hasOutput :calcCaloriesOutput;
     hrests:hasMethod "GET";
     hrests:hasAddress "weight={p1}&age={p2}" .

 <#msmCalcService> a msm:Service;
    hrest:hasAddress: "http://foo.bar/services/calories/";
    msm:hasOperation <#msmCalcCalories> .

 :calcCaloriesInput a msm:MessageContent;
        msm:hasPart :part1, :part2;
        sawsdl:modelReference :PersonDetails.

:part1 a msm:MessagePart;
        sawsdl:modelReference :hasAge;
         hrests:isGroundedIn "p1"^^rdf:PlainLiteral. 
 
:part2 a msm:MessagePart;
        sawsdl:modelReference :hasWeight;
        hrests:isGroundedIn "p2"^^rdf:PlainLiteral .
Clone this wiki locally