This section will provide information on the service type. This is not one of the main OIH types. However, we will provide guidance here on describing services using

It should be noted that this might be a simple link to an OpenAPI or some other descriptor document. Also, is not rich enough for complex descriptions and itself borrows from the Hydra vocabulary. It may be required to leverage Hydra if complex descriptions are needed.

The graph describes a service than can be invoked with:

curl --data-binary "@yourfile.jpg" -X POST

This with POST a jpeg to the service and get back a simple text response with some information about the image.

 2    "@context": {
 3        "@vocab": ""
 4      },
 5    "@type": "Action",
 6    "@id": "",
 7    "result": {
 8      "@type": "DataDownload",
 9      "encodingFormat": "text/plain",
10      "description": "a simple text result for the RGB counts"
11    },
12    "target": {
13      "@type": "EntryPoint",
14      "urlTemplate": "",
15      "httpMethod": "POST",
16      "contentType": ["image/jpeg", "image/png"]
17    },
18    "object": {
19      "@type": "ImageObject",
20      "description": "A JPEG or PNG to analyze the RGB counts"
21    }
22  }
Hide code cell source
import json
from pyld import jsonld
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils

with open("./graphs/action.json") as dgraph:
    doc = json.load(dgraph)

context = {
    "@vocab": "",

compacted = jsonld.compact(doc, context)