Skip to content

Instantly share code, notes, and snippets.

@xdelox
Created February 8, 2023 17:01
Show Gist options
  • Save xdelox/428c55de567f84b842ecee33c7d89d75 to your computer and use it in GitHub Desktop.
Save xdelox/428c55de567f84b842ecee33c7d89d75 to your computer and use it in GitHub Desktop.
Global donut style rule
curl --request POST \
--url http://localhost:8080/api/v1/knowledgeGraphs/618509ae-b44d-4a5e-801f-4bcd81d66afd/styles \
--header 'Content-Type: application/json' \
--header 'x-api-key: 1C_W3FWUSxjZ7BIv6XCk9RpxVjKraiE6' \
--data '{
"label": "Bla7",
"captionRules": [],
"styleRules": [
{
"type": "CLASS_GLOBAL_DONUT",
"attributeCategory": "SCHEMA",
"attributeName": "points",
"globalAttributeDefinition": {
"type": "NUMBER",
"list": false
},
"domainMax": 100,
"color": "#6685ff"
}
]
}
'
GLOBAL DONUT, STYLE RULE AND CAPTION RULES
curl --request POST \
--url http://localhost:8080/api/v1/knowledgeGraphs/618509ae-b44d-4a5e-801f-4bcd81d66afd/styles \
--header 'Content-Type: application/json' \
--header 'x-api-key: 1C_W3FWUSxjZ7BIv6XCk9RpxVjKraiE6' \
--data '{
"label": "Name, Price and points 3",
"captionRules": [
{
"type": "CLASS_GLOBAL",
"attributes": [
"__#label#__", "price"
],
"maxLength": 18
},
{
"type": "CLASS",
"fqn": "Winery",
"attributes": [
"__#label#__","name"
],
"maxLength": 5
}
],
"styleRules": [
{
"type": "CLASS_GLOBAL_DONUT",
"attributeCategory": "SCHEMA",
"attributeName": "points",
"globalAttributeDefinition": {
"type": "NUMBER",
"list": false
},
"domainMax": 100,
"color": "#6685ff"
}
]
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment