Synchronous SADI services

Synchronous SADI services are simpler to interact with than asynchronous SADI services, but they must finish processing input before the client’s connection times out, typically in five minutes, but possibly less depending on local network conditions. Communication with a synchronous SADI service looks like this:

  1. The client sends a POST request to the service URI. The body of the request is an RDF document containing one or more instances of the service’s input OWL class and, optionally, one instance of the service’s parameter OWL class. The exact format of the RDF document may be specified in the Content-type header of the POST request (one of application/rdf+xml or text/rdf+n3). If no Content-type header is sent with the request, the input is assumed to be in RDF/XML format.
  2. POST /examples/hello HTTP/1.1
    Host: sadiframework.org
    Content-type: text/rdf+n3
    
    @prefix hello: <http://sadiframework.org/examples/hello.owl#> .
    @prefix foaf: <http://xmlns.com/foaf/0.1/> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    
    <http://sadiframework.org/examples/hello-input.rdf#1>
       a hello:NamedIndividual ;
       foaf:name "Guy Incognito" .
    


    POST /examples/hello HTTP/1.1
    Host: sadiframework.org
    
    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:hello="http://sadiframework.org/examples/hello.owl#"> 
    
    <hello:NamedIndividual rdf:about="http://sadiframework.org/examples/hello-input.rdf#1">
           <foaf:name>Guy Incognito</foaf:name>
    </hello:NamedIndividual> 
    
    </rdf:RDF>
    

  3. The service sends a response with the output. The body of the response is an RDF document containing statements about the input instances that have been generated by the algorithm of the Service. The final result of this ‘annotative’ process is an RDF document fulfilling the Class definition of the Service output OWL Class. The exact format of the RDF document will be specified in the Content-type header of the response (one of application/rdf+xml or text/rdf+n3).
  4. HTTP/1.1 200 OK
    Content-type: text/rdf+n3
    
    @prefix hello: <http://sadiframework.org/examples/hello.owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    
    <http://sadiframework.org/examples/hello-input.rdf#1>
       a hello:GreetedIndividual ;
       hello:greeting "Hello, Guy Incognito!" .
    


    HTTP/1.1 200 OK
    Content-type: application/rdf+xml
    
    <rdf:RDF
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:hello="http://sadiframework.org/examples/hello.owl#"> 
    
    <hello:GreetedIndividual rdf:about="http://sadiframework.org/examples/hello-input.rdf#1">
             <hello:greeting>Hello, Guy Incognito!</hello:greeting>
    </hello:GreetedIndividual> 
    
    </rdf:RDF>

Compare with asynchronous SADI services.