I recommend adding an example that doesn't require specialization.
The following example illustrates how to use the <data> element to embed a
JSON-LD record in your DITA topic. The JSON-LD example appears in the JSON-LD
Primer (https://json-ld.org/primer/latest/).
<topic id="example_body">
<title>Catalog topic</title>
<prolog>
<data name="metadata-type" value="json-ld">
<data name="record_links-bike-shop" value="{ '@id': 'http://store.example.com/',">
<data name="record_type" value="'@type': 'Store',"/>
<data name="record_name" value="'name': 'Links Bike Shop',"/>
<data name="record_description" value="'description': 'The most \'linked\' bike store on earth!',"/>
<data name="record_product" value="'product': ["/>
<data name="product_id" value=" { '@id': 'p:links-swift-chain',"/>
<data name="product_type" value=" '@type': 'Product',"/>
<data name="product_name" value=" 'name': 'Links Swift Chain',"/>
<data name="product_description" value=" 'description': 'A fine chain with many links.',"/>
<data name="product_category" value=" 'category': ['cat:parts', 'cat:chains'],"/>
<data name="product_price" value=" 'price': '10.00',"/> <data name="product_stock" value=" 'stock': 10 },"/>
<data name="product_id" value=" { '@id': 'p:links-speedy-tube',"/>
<data name="product_type" value=" '@type': 'Product',"/>
<data name="product_name" value=" 'name': 'Links Speedy Tube',"/>
<data name="product_description" value=" 'description': 'Lubricant for your chain links.',"/>
<data name="product_category" value=" 'category': ['cat:lube', 'cat:chains'],"/>
<data name="product_price" value=" 'price': '5.00',"/>
<data name="product_stock" value=" 'stock': 20 },"/>
<data name="context" value=" ], '@context': {"/>
<data name="context_Store" value=" 'Store': 'http://ns.example.com/store#Store',"/>
<data name="context_Product" value=" 'Product': 'http://ns.example.com/store#Product',"/>
<data name="context_product" value=" 'product': 'http://ns.example.com/store#product',"/>
<data name="context_category" value=" 'category':"/>
<data name="context_category_id" value=" { '@id': 'http://ns.example.com/store#category',"/>
<data name="context_category_type" value=" '@type': '@id' },"/>
<data name="context_category_price" value=" 'price': 'http://ns.example.com/store#price',"/>
<data name="context_category_stock" value=" 'stock': 'http://ns.example.com/store#stock',"/>
<data name="context_category_name" value=" ' name': 'http://purl.org/dc/terms/title',"/>
<data name="context_category_description" value=" 'description': 'http://purl.org/dc/terms/description',"/>
<data name="context_category_p" value=" 'p': 'http://store.example.com/products/',"/>
<data name="context_category_cat" value=" 'cat': 'http://store.example.com/category/' }}"/>
</data>
</data>
</prolog>
</body>
</topic>
When processed by an external, JSON-LD -aware processor, the <data> structure
produces a complete JSON-LD script.
{
"@id": "http://store.example.com/",
"@type": "Store",
"name": "Links Bike Shop",
"description": "The most \"linked\" bike store on earth!",
"product": [
{
"@id": "p:links-swift-chain",
"@type": "Product",
"name": "Links Swift Chain",
"description": "A fine chain with many links.",
"category": ["cat:parts", "cat:chains"],
"price": "10.00", "stock": 10
},
{
"@id": "p:links-speedy-lube",
"@type": "Product",
"name": "Links Speedy Lube",
"description": "Lubricant for your chain links.",
"category": ["cat:lube", "cat:chains"],
"price": "5.00", "stock": 20
}
],
"@context": {
"Store": "http://ns.example.com/store#Store",
"Product": "http://ns.example.com/store#Product",
"product": "http://ns.example.com/store#product",
"category":
{
"@id": "http://ns.example.com/store#category",
"@type": "@id"
},
"price": "http://ns.example.com/store#price",
"stock": "http://ns.example.com/store#stock",
"name": "http://purl.org/dc/terms/title",
"description": "http://purl.org/dc/terms/description",
"p": "http://store.example.com/products/",
"cat": "http://store.example.com/category/"
}
}