Tags

First impressions of the API of structWSF (looking for an alternative to Siderean Seamark)

structWSF is a platform-independent Web services framework for accessing and exposing structured RDF data.
It is the main middle layer component of conStruct, a Drupal CMS distro aimed at structured content and data integration.

According to the documentation

The structWSF middleware framework is fully RESTful in design and is based on HTTP and Web protocols and open standards.

The initial structWSF framework comes packaged with a baseline set of about a dozen Web services in CRUD, browse, search and export and import.


To inspect the RESTfulness of an API the first place to look at is how a delete action is implemented.

In the structWSF case this is as follows:

HTTP Method:
* GET
Possible "Accept:" HTTP header field value:
* */*
URI:
* http://[...]/ws/crud/delete/ ?uri=param1&dataset=param2&registered_ip=param3
URI dynamic parameters description: Note: All parameters have to be URL-encoded
* param1. URI of the instance record to delete
* param2. URI of the dataset where the instance record is indexed
* param3.Target IP address registered in the WSF
This is a well-known REST anti-pattern:
  • the URI's do not encode resources, but rather operations (in this case "delete") and their respective parameters.
    While 'identification of resources' is the main interface constraint of the whole REST architectural style.
    In this case the URI for the record resource could have been http://[...]/datasets/{dataset}/{recordid} using HTTP GET to retrieve a representation of the record, a DELETE to delete the record, ...
  • the HTTP method being GET does not match the "delete" semantics of the request.
    The semantics of a HTTP GET = requesting a representation of the specified resource. This is inherently a safe operation, meaning not changing the server state, while a delete does. To expose unsafe operations through GET is a common and dangerous (ask Google) misuse of the uniform HTTP interface.
I had high expectations related to structWSF, but this first evaluation attempt leaves me rather disappointed.
Moving on to the other potential Seamark replacements now.

For those who want to learn about REST, one reference:

REST book

Comments