Skip to content

Commit

Permalink
Combine properties into a single things property
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrancis committed Apr 22, 2021
1 parent 581dacc commit b075a81
Showing 1 changed file with 72 additions and 64 deletions.
136 changes: 72 additions & 64 deletions directory.td.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,53 +199,45 @@
}
},
"properties": {
"retrieveTD": {
"description": "Retrieve a Thing Description",
"things": {
"@type": "ThingListProperty",
"description": "Collection of Thing Descriptions in the directory",
"uriVariables": {
"id": {
"@type": "ThingID",
"title": "Thing Description ID",
"type": "string",
"format": "iri-reference"
}
},
"forms": [
{
"href": "/td/{id}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
"htv:statusCodeValue": 200,
"contentType": "application/td+json"
},
"additionalResponses": [
{
"description": "TD with the given id not found",
"contentType": "application/problem+json",
"htv:statusCodeValue": 404
}
],
"scopes": "read"
}
]
},
"retrieveTDs": {
"description": "Retrieve all Thing Descriptions",
"uriVariables": {
},
"jsonpath": {
"@type": "JSONPathExpression",
"title": "A valid JSONPath expression",
"type": "string"
},
"xpath": {
"@type": "XPathExpression",
"title": "A valid XPath expression",
"type": "string"
},
"offset": {
"@type": "PageOffset",
"title": "Number of TDs to skip before the page",
"type": "number",
"default": 0
},
"limit": {
"@type": "PageLimit",
"title": "Number of TDs in a page",
"type": "number"
},
"sort_by": {
"@type": "SortAttribute",
"title": "Comparator TD attribute for collection sorting",
"type": "string",
"default": "id"
},
"sort_order": {
"@type": "SortOrder",
"title": "Sorting order",
"type": "string",
"enum": ["asc", "desc"],
Expand All @@ -254,17 +246,17 @@
},
"forms": [
{
"href": "/td",
"href": "/things",
"htv:methodName": "GET",
"response": {
"description": "Success response",
"htv:statusCodeValue": 200,
"contentType": "application/ld+json"
"contentType": "application/td+json"
},
"scopes": "readAll"
},
{
"href": "/td{?offset,limit,sort_by,sort_order}",
"href": "/things{?offset,limit,sort_by,sort_order}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
Expand All @@ -284,20 +276,26 @@
}
],
"scopes": "readAll"
}
]
},
"searchJSONPath": {
"description": "JSONPath syntactic search",
"uriVariables": {
"query": {
"title": "A valid JSONPath expression",
"type": "string"
}
},
"forms": [
},
{
"href": "/things/{id}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
"htv:statusCodeValue": 200,
"contentType": "application/td+json"
},
"additionalResponses": [
{
"description": "TD with the given id not found",
"contentType": "application/problem+json",
"htv:statusCodeValue": 404
}
],
"scopes": "read"
},
{
"href": "/search/jsonpath?query={query}",
"href": "/things?jsonpath={jsonpath}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
Expand All @@ -312,20 +310,9 @@
}
],
"scopes": "search"
}
]
},
"searchXPath": {
"description": "XPath syntactic search",
"uriVariables": {
"query": {
"title": "A valid XPath expression",
"type": "string"
}
},
"forms": [
},
{
"href": "/search/xpath?query={query}",
"href": "/things?xpath={xpath}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
Expand All @@ -334,7 +321,7 @@
},
"additionalResponses": [
{
"description": "JSONPath expression not provided or contains syntax errors",
"description": "XPath expression not provided or contains syntax errors",
"contentType": "application/problem+json",
"htv:statusCodeValue": 400
}
Expand All @@ -343,42 +330,63 @@
}
]
},
"searchSPARQL": {
"description": "SPARQL semantic search",
"sparql": {
"@type": "SPARQLProperty",
"description": "Endpoint for querying the directory with SPARQL",
"uriVariables": {
"query": {
"@type": "SPARQLQuery",
"title": "A valid SPARQL 1.1. query",
"type": "string"
}
},
"forms": [
{
"href": "/search/sparql?query={query}",
"href": "/sparql?query={query}",
"htv:methodName": "GET",
"response": {
"description": "Success response",
"htv:statusCodeValue": 200
},
"additionalResponses": [
{
"description": "JSONPath expression not provided or contains syntax errors",
"description": "SPARQL query not provided or contains syntax errors",
"contentType": "application/problem+json",
"htv:statusCodeValue": 400
}
],
"scopes": "search"
},
{
"href": "/search/sparql",
"href": "/sparql",
"htv:methodName": "POST",
"contentType:": "application/x-www-form-urlencoded",
"response": {
"description": "Success response",
"contentType": "application/json",
"htv:statusCodeValue": 200
},
"additionalResponses": [
{
"description": "JSONPath expression not provided or contains syntax errors",
"description": "SPARQL query not provided or contains syntax errors",
"contentType": "application/problem+json",
"htv:statusCodeValue": 400
}
],
"scopes": "search"
},
{
"href": "/sparql",
"htv:methodName": "POST",
"contentType:": "application/sparql-query",
"response": {
"description": "Success response",
"contentType": "application/json",
"htv:statusCodeValue": 200
},
"additionalResponses": [
{
"description": "SPARQL query not provided or contains syntax errors",
"contentType": "application/problem+json",
"htv:statusCodeValue": 400
}
Expand Down Expand Up @@ -428,4 +436,4 @@
]
}
}
}
}

0 comments on commit b075a81

Please sign in to comment.