{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/api/DomainObjectApi/Overview/","result":{"data":{"asciidoc":{"id":"a1a5abcb-6ea2-5876-b1b5-9fb53d6bba3a","html":"<div class=\"sect1\">\n<h2 id=\"_hiro_domain_object_api\">HIRO Domain Object API</h2>\n<div class=\"sectionbody\">\n<div class=\"sect2\">\n<h3 id=\"_overview\">Overview</h3>\n<div class=\"paragraph\">\n<p>This section describes the Domain Object REST API from the point-of-view of a client of the API.</p>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_scope_of_the_domain_object_api\">Scope of the Domain Object API</h4>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/connector_images/DoapiConcept_Ticket.png\" alt=\"DoapiConcept Ticket\" width=\"49%\">\n</div>\n</div>\n<div class=\"imageblock\">\n<div class=\"content\">\n<img src=\"/7.0/images/connector_images/DoapiConcept_Model.png\" alt=\"DoapiConcept Model\" width=\"49%\">\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The Domain Object API enables the client to:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>Write and update complex data structures to HIRO DB were they will be mapped to a graph structure (defined by a <code>view</code> definition). The view is defined in <a href=\"https://github.com/arago/OGIT/tree/master/SDF\">OGIT</a>.</p>\n</li>\n<li>\n<p>Recieve information on the process of the write transactions (via the <code>transactions</code> endpoint).</p>\n</li>\n<li>\n<p>Recieve updates in a complex data structure for ticket data (mapped to <code>ogit/Automation/AutomationIssue</code> and the related IssueHistory by a <code>view</code> definition) via the <code>updates</code> endpoint.</p>\n</li>\n</ul>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_domain_objects\">Domain Objects</h4>\n<div class=\"paragraph\">\n<p>The Domain Object API exposes the content of the HIRO Graph in terms of high-level domain-specific objects, such as <em>Incident</em>, <em>House</em>, etc, rather than in terms of low-level vertices and edges. In other words, a domain object is a sub-graph of the HIRO graph expressed as a JSON object. Domain objects are identified by an identifier that is guaranteed by the client to be unique on the client&#8217;s side. Through this identifier, objects can be created/updated and deleted.</p>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_ongoing_writes_to_domain_objects\">Ongoing writes to domain objects</h4>\n<div class=\"paragraph\">\n<p>As writing a domain object (that is, calling <code>PUT /views/&lt;viewid&gt;/objects/&lt;object-id&gt;</code>) can take a long time, these operations return a transaction. A transaction is a representation of the package of work implied by the operation, e.g., <em>create vertex A, create vertex B, connect A with B through verb C</em>. To get the current status of a transaction do <code>GET /views/&lt;viewid&gt;/transaction/&lt;transaction-id&gt;</code>.</p>\n</div>\n</div>\n<div class=\"sect3\">\n<h4 id=\"_updates_to_domain_objects\">Updates to domain objects</h4>\n<div class=\"paragraph\">\n<p>Updates made to domain objects (made by some other user than the client) are readable at the <code>/views/&lt;viewid&gt;/updates/&lt;index&gt;</code> end-point on the REST API. This end-point can be read in three different ways. Either by explicitly indexing the update, e.g., <code>GET /views/&lt;viewid&gt;/updates/&lt;index&gt;</code>, or using a server-managed iterator, e.g., <code>GET /views/&lt;viewid&gt;/updates/?iterator=&lt;iterator-id&gt;</code>, or finally using websockets through the notification meachanism (see below). If the client needs to read updates in a random-access manner, use explicit indexing. If you prefer to read updates in a single bulk, use the iterator interface. Finally, if you wish to minimize latency use the websockets.</p>\n</div>\n<div class=\"sect4\">\n<h5 id=\"_notifications\">Notifications</h5>\n<div class=\"paragraph\">\n<p>A client can create a notification subscription using <code>POST /views/&lt;viewid&gt;/notifications</code>, which will allow a client to receive notifications when a transaction or domain object has been updated. Outstanding notifications are handled by the server, thus, a client can disconnect and receive any updates occurring while disconnected upon reconnect.</p>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>","document":{"main":"HIRO Domain Object API","title":"HIRO Domain Object API","subtitle":""},"fields":{"toc":false,"location":["documentation","api","DomainObjectApi","Overview"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"a1a5abcb-6ea2-5876-b1b5-9fb53d6bba3a","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}