{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/api/api-overview/","result":{"data":{"asciidoc":{"id":"ad680d4f-1ab3-5575-9e9c-59a3329f108d","html":"<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">Table of Contents</div>\n<ul class=\"sectlevel1\">\n<li><a href=\"#_overview\">Overview</a></li>\n<li><a href=\"#_rest_api\">REST API</a>\n<ul class=\"sectlevel2\">\n<li><a href=\"#_api_browser\">API Browser</a></li>\n<li><a href=\"#_error_codes\">Error Codes</a></li>\n</ul>\n</li>\n<li><a href=\"#_concepts\">Concepts</a>\n<ul class=\"sectlevel2\">\n<li><a href=\"#_semantic\">Semantic</a></li>\n<li><a href=\"#_requirements_of_namespace_ids_and_attributes\">Requirements of Namespace, IDs and Attributes</a></li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_overview\">Overview</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>This document will give you an overview about the HIRO Graph, the\ngoverning concepts and the developer API.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_rest_api\">REST API</h2>\n<div class=\"sectionbody\">\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li>\n<p>All requests(except authenticate) must contain a valid access token. Request a valid access token using <code>/auth/</code> api.</p>\n</li>\n<li>\n<p>All requests will be made against a base $url (e.g. <a href=\"https://core.engine.datagroup.de/api/\" class=\"bare\">https://core.engine.datagroup.de/api/</a>).</p>\n</li>\n<li>\n<p>Most of responses are in JSON (to see exception see specific api specs)</p>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>JSON response format: set header <code>Accept</code> to <code>application/json</code></p>\n</li>\n<li>\n<p>JSON request format (for requests with body): set header <code>Content-Type</code> to <code>application/json</code></p>\n</li>\n</ul>\n</div>\n</li>\n<li>\n<p>All requests payload unless defined differently in api specification must be utf-8 encoded string.</p>\n</li>\n</ol>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_api_browser\">API Browser</h3>\n<div class=\"paragraph\">\n<p>You can access the HIRO REST API browser on your HIRO instance: <code><a href=\"https://core.engine.datagroup.de/help/specs/?url=definitions/graph.yaml\" class=\"bare\">https://core.engine.datagroup.de/help/specs/?url=definitions/graph.yaml</a></code>.</p>\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_error_codes\">Error Codes</h3>\n<div class=\"paragraph\">\n<p>HIRO Graph uses standard HTTP error codes. Please refer to <a href=\"https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\" class=\"bare\">https://en.wikipedia.org/wiki/List_of_HTTP_status_codes</a></p>\n</div>\n<div class=\"paragraph\">\n<p>There might be different error codes, depending on which reverse proxy is configured to be in front of HIRO Graph, please refer to the reverse proxy product documentation you are using.</p>\n</div>\n<div class=\"paragraph\">\n<p>Error codes with special meaning for HIRO Graph:</p>\n</div>\n<table class=\"tableblock frame-all grid-all stretch\">\n<caption class=\"title\">Table 1. Table Error Codes</caption>\n<colgroup>\n<col style=\"width: 33.3333%;\">\n<col style=\"width: 33.3333%;\">\n<col style=\"width: 33.3334%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Error Code</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n<th class=\"tableblock halign-left valign-top\">Explanation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">400</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Bad Request</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">please review request against api documentation</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">401</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Token invalid, expired or missing</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">make sure you use a valid token; get a new token</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">403</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Access denied</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">access to resource is not granted by current set of policies</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">404</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Not Found</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">something does not exist</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">408</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Internal request timeout</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">request took too long; limit request or response size</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">409</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Conflict</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">e.g. if you try to create an already existing vertex</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">500</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Internal Error</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">generic error, please contact us at <a href=\"mailto:support@hiro.almato.ai\">support@hiro.almato.ai</a></p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">503</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Service temporary unavailable</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">try again later</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">888</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Transaction failure / Upstream error</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">if two transactions collide, HIRO Graph cannot decide what to do with the failed transaction. Check the condition of the items in the request and retry if still possible</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p>Because everything may fail (software, middleware, network, &#8230;&#8203;) clients working against the HIRO Graph API are expected to retry failed requests. The expectation, that all requests succeed in the age of the internet is wrong and unrealistic.</p>\n</div>\n<div class=\"paragraph\">\n<p>A good measure for when to retry is:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-javascript\" data-lang=\"javascript\">if (response.getStatusCode() &gt; 499) {\n  retryTheSameRequest();\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>All status code in the 4xx range require, that the client fixes something. Be that request format (400), new access token (401) etc pp. The request can e.g. be retried when a new token has been obtained.</p>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_concepts\">Concepts</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>HIRO Graph is a semantic graph processing platform.</p>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_semantic\">Semantic</h3>\n<div class=\"paragraph\">\n<p>HIRO Graph contains Entities (things) with Attributes (properties), Verbs (connections) as well as\nother data like Timeseries or BLOBs.\nThe semantic part is described here <a href=\"https://github.com/arago/OGIT\" class=\"bare\">https://github.com/arago/OGIT</a>.</p>\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_requirements_of_namespace_ids_and_attributes\">Requirements of Namespace, IDs and Attributes</h3>\n<div class=\"admonitionblock note\">\n<table>\n<tr>\n<td class=\"icon\">\n<i class=\"fa icon-note\" title=\"Note\"></i>\n</td>\n<td class=\"content\">\nOne must never depend on the format of the ID that HIRO Graph generates.\n</td>\n</tr>\n</table>\n</div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li>\n<p>All type ids (attribute ids, entity ids, verb ids) in HIRO Graph are namespaced.</p>\n</li>\n<li>\n<p>To ensure consistency and avoid ambiguity, these have a mandatory prefix <a href=\"http://www.purl.org/\" class=\"bare\">http://www.purl.org/</a>.\nEverything after this prefix is the shortened id, that will be by the graph, e.g. <code>ogit/_id</code> derives from <code><a href=\"http://www.purl.org/ogit/_id\" class=\"bare\">http://www.purl.org/ogit/_id</a></code>. (see <a href=\"http://www.purl.org/docs/index.html\" class=\"bare\">http://www.purl.org/docs/index.html</a> for further info). Replace \"/\" in \"_id\" with \"%2F\".</p>\n</li>\n<li>\n<p>Attributes, that are not defined in OGIT have an empty namespace, e.g.: <code>/IssueXML</code>.</p>\n</li>\n<li>\n<p>Free attributes have to begin with \"/\", e.g. \"/environmentType\": \"PROD\",.</p>\n</li>\n<li>\n<p>Free attributes containing dot \".\" are not allowed.</p>\n</li>\n<li>\n<p>All attribute values must be of type string.</p>\n</li>\n<li>\n<p>All attributes are indexed with the keyword analyzer, so wildcards and submatches cannot be used on them, they are also case-sensitive.</p>\n</li>\n<li>\n<p>System attributes start with <code>ogit/_</code>.</p>\n</li>\n<li>\n<p>Changes to system attributes apart of described below are not allowed.</p>\n</li>\n<li>\n<p><code>ogit/_xid</code> is an external ID which could be set on vertex creation used to map to an external system. Setting this id in a local cache will throw a <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409\">409</a> if another entity has the same <code>ogit/_xid</code>. Nevertheless multiple entities with the same <code>ogit/_xid</code> may exist at the same time if data is created with sync.</p>\n</li>\n<li>\n<p><code>ogit/_content</code> when written is indexed with the standard analyzer. It is also indexed with an ngram analyzer. a text like \"a sample text of things\" can be queried like <code>ogit/_content:sample</code> to find words in it, or <code>ogit/_content.ngram:amp</code> to find ngrams in it. This field is allowed for all entities and can be filled automatically by setting the indexed: property in the entity definition.</p>\n</li>\n<li>\n<p><code>ogit/_content</code> is the sum of all attribute values that are specified in OGIT under <code>ogit:indexed-attributes</code> in OGIT. e.g. <a href=\"https://github.com/arago/OGIT/blob/master/NTO/Automation/entities/MARSNode.ttl#L131\" class=\"bare\">https://github.com/arago/OGIT/blob/master/NTO/Automation/entities/MARSNode.ttl#L131</a></p>\n</li>\n<li>\n<p><code>ogit/_tags</code> when written is indexed as a list of keywords. The format when writing is \"some, tag, with spaces\" and internally is indexed as [\"some\", \"tag\", \"with spaces\"]. It can be searched like <code>ogit/_tags:some</code> to find full tags in the list. This field is allowed for all entities.</p>\n</li>\n<li>\n<p><code>ogit/_owner</code> could be set to team id to allow sharing data by policies. if not set in request default team from account profile (in case not set default for organization) would be used</p>\n</li>\n<li>\n<p><code>ogit/_scope</code> could be set on vertex creation to put vertex in specific data scope, if not default from context would be used</p>\n</li>\n<li>\n<p>The length of attribute values <em>must not exceed</em> <strong>60kB</strong>. If they are larger than 60kB, they will not be indexed. The following attributes can have an <em>arbitrary content length</em>, but <strong>can not be used</strong> to match in queries:</p>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>ogit/message</code></p>\n</li>\n<li>\n<p><code>ogit/content</code></p>\n</li>\n<li>\n<p><code>ogit/description</code></p>\n</li>\n<li>\n<p><code>ogit/comment</code></p>\n</li>\n<li>\n<p><code>ogit/licenseKey</code></p>\n</li>\n<li>\n<p><code>ogit/question</code></p>\n</li>\n<li>\n<p><code>ogit/response</code></p>\n</li>\n<li>\n<p><code>ogit/reason</code></p>\n</li>\n<li>\n<p><code>ogit/serviceContract</code></p>\n</li>\n<li>\n<p><code>ogit/taskLog</code></p>\n</li>\n<li>\n<p><code>ogit/value</code></p>\n</li>\n<li>\n<p><code>ogit/values</code></p>\n</li>\n</ul>\n</div>\n</li>\n<li>\n<p><em>Free attributes</em> can have any length but <strong>cannot be used in queries if over 60kB</strong>.</p>\n</li>\n<li>\n<p>Limitations on data size (trying to create or update data bigger than allowed would end up with 400 error). For performance reasons it is recommended to build applications in the way that single data piece is not bigger than 1MB.</p>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>issue/task in engine - 1MB</p>\n</li>\n<li>\n<p>vertex - 10MB</p>\n</li>\n<li>\n<p>timeseries value - 100MB</p>\n</li>\n<li>\n<p>BLOB content - 100MB</p>\n</li>\n<li>\n<p>api request payload 100MB</p>\n</li>\n</ul>\n</div>\n</li>\n<li>\n<p>Stream responses are used to transfer possibly bigger amount of data pieces like query or timeseries values response. each item it send from server separately and could be parsed by json streaming. e. g. <code>{\"items\":[{$data1},{$data2},&#8230;&#8203;,{\"error\":{\"code\":408,\"messge\":\"internal request timeout\"}}]}</code>. Note: client shall check if data piece contain `\"error\"`and handle it (after \"error\" no more data would be send)</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n</div>","document":{"main":"HIRO API Overview","title":"HIRO API Overview","subtitle":""},"fields":{"toc":true,"location":["documentation","api","api-overview"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"ad680d4f-1ab3-5575-9e9c-59a3329f108d","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}