Skip to content

Asset Types

An Asset Type is a root node in the Asset graph space. It is a custom actor type that defines the kind of business data a type holds, what sub-types may be present, and any relations with other resources. For instance, a Vendor Asset type models vendor business data.

Asset Types are unavoidable because every Asset instance must be tied to a custom type.

Start by defining a new Asset type key in a YAML file with the uri path as /registry/actors/asset/types/<ASSET TYPE KEY>. The Graph will automatically index the new type.

Keep in mind that Asset type definitions have a schema.

Example: Create a New Vendor Asset Type

Create a New Vendor Asset Type

This example models a Vendor data model and includes two types of vendors, local and global vendors.

  1. Create a YAML file containing the necessary fields.
newAssetType.yaml
uri: /registry/actors/asset/types/vendor
spec:
value:
graphSetName: vendor
itemEdgeName: head
defaultNumberPrefix: "VE"
items:
localVendor:
graphSetName: localVendors
edgeName: localVendors
relations:
supplies:
node: 'order'
cardinality: many
globalVendor:
graphSetName: globalVendors
edgeName: globalVendors
relations:
payments:
node: 'order'
cardinality: many
relations:
order:
node: 'order'
cardinality: many
  1. Send the YAML file to the Registry via the CLI using h_ manage apply
h_ manage apply .\newAssetType.yaml -s demo-ecom

Response

Updated registry keys:
- actors/asset/types/vendor
- Old: undefined
- New: {"graphSetName":"vendor","itemEdgeName":"head","defaultNumberPrefix":"VE","items":{"localVendor":{"graphSetName":"localVendors","edgeName":"localVendors","relations":{"supplies":{"node":"order","cardinality":"many"}}},"globalVendor":{"graphSetName":"globalVendors","edgeName":"globalVendors","relations":{"payments":{"node":"order","cardinality":"many"}}}},"relations":{"order":{"node":"order","cardinality":"many"}}}

Choose unique names for asset type definitions, If now, existing types may be overwritten.

Example: Query the Vendor Asset

Query the Vendor Asset from the Graph

Let’s query the Graph to return all Vendors. We will also return local and global vendors for each Vendor.

Send the following POST request to /resources/graph. You must a valid JSON body containing the graphSetName or rootEdgeName of the node. In this case, from the type definition, it is vendor.

Request

POST https://<hantera-hostname>/resources/graph
Authorization: Bearer <YOUR TOKEN>
Content-Type: application/json
[{
"edge": "vendor",
"node": {
"fields": ["assetId", "assetNumber", "lastModified"],
"navigate": [
{
"edge": "globalVendors",
"node": {
"fields": ["assetItemId"]
}
},
{
"edge": "localVendors",
"node": {
"fields": ["assetItemId"]
}
}
]}}]

Response

HTTP/1.1 200 OK
{
"vendor": {
"nodes": [
{
"assetId": "01999d00-2b4a-7439-97bc-1c90a60aabc4",
"lastModified": "2025-09-30T23:40:58.079047+00:00",
"assetNumber": "VE100001",
"globalVendors": {
"nodes": []
},
"localVendors": {
"nodes": [
{
"assetItemId": "01999d00-a1cf-7ced-96b3-1ab55b5e4ef0",
"cursor": "WyIwMTk5OWQwMC1hMWNmLTdjZWQtOTZiMy0xYWI1NWI1ZTRlZjAiXQ=="
}
],
"firstCursor": "WyIwMTk5OWQwMC1hMWNmLTdjZWQtOTZiMy0xYWI1NWI1ZTRlZjAiXQ==",
"lastCursor": "WyIwMTk5OWQwMC1hMWNmLTdjZWQtOTZiMy0xYWI1NWI1ZTRlZjAiXQ=="
},
"cursor": "WyIwMTk5OWQwMC0yYjRhLTc0MzktOTdiYy0xYzkwYTYwYWFiYzQiXQ=="
}
...
],
"firstCursor": "WyIwMTk5OWQwMC0yYjRhLTc0MzktOTdiYy0xYzkwYTYwYWFiYzQiXQ==",
"lastCursor": "WyIwMTk5OWQ0OC0zOWQ5LTdiMjMtYmVlZC0wMjdiM2UzYmVjNGQiXQ=="
}
}

You can also customize graph queries to make them more specific.