A reference to a WebSocket stream

Hi,

I'm working on an API for IoT middleware, the API is going to be based
on Hydra. In this API I want to provide a link to a websocket stream
which publishes latest observations of a device. How such a link
should be represented? Are there relevant approaches outside of Hydra
vocabulary?

Currently, I just extend hydra:Link, i.e.:

{
    "@context": {
        "vocab": "http://example.com/#",
        "hydra": "http://www.w3.org/ns/hydra/core#",
    },
    "@id": "vocab:observations",
    "@type": "hydra:Link",
    "rdfs:range": "hydra:Resource"
}

Probably "rdfs:range": "hydra:Resource" isn't appropriate statement,
since a websocket stream is not a resource, but a kind of "continuous
collection". Then continuous collection could be just a subclass of
hydra:Collection with subscribe/publish operations and subscribe
operation could return ssn:Observation (from [0]), i.e.:

{
    "@context": {
       "vocab": "http://example.com/#",
       "hydra": "http://www.w3.org/ns/hydra/core#",
       {
           "@id": "vocab:ContinuousCollection",
           "@type": "hydra:Class",
           "rdfs:subClassOf": "hydra:Collection",
           "hydra:supportedOperation": [
               "@type": "hydra:Operation",
               "hydra:method": "WEBSOCKET_SUBSCRIBE",
               "hydra:returns": "ssn:Observation"
           ]
       }
    },
    "@id": "vocab:observations",
    "@type": "hydra:Link",
    "rdfs:range": "vocab:ContinuousCollection"
}

What do you think about that, Hydranians?

[0]: http://purl.oclc.org/NET/ssnx/ssn#

Thank you in advance!
Maxim

Received on Friday, 27 November 2015 20:19:10 UTC