How to Schema
This guide will take you through registering schemas that are compliant with the Asset Register.
These schemas and shapes help ensure that data about assets, NFTs, and other entities adhere to the required structure and constraints.
Examples
Futureverse
This example defines the core classes and their hierarchies within the Futureverse framework. These definitions create a hierarchy where fv:Asset
is the root, and the more specific classes like fv:NFT
and fv:SFT
inherit from it. Each of these asset types can be further categorized into on-chain or off-chain, depending on where the asset data is stored.
TNL Boxer
This example defines a specific instance of an OnChainNFT
, called Boxer
, using SHACL (Shapes Constraint Language).
TNX Boxer properties
sh:property
:The
sh:property
construct defines constraints on a particular property of a node. Inside eachsh:property
block, you specify details about the property, such as its path, type, cardinality, and more.
sh:maxCount
andsh:minCount
:sh:maxCount 1
: This specifies that the property can have at most one value. It's used to enforce uniqueness or singularity of a particular property in a node.sh:minCount 0
: This means that the property is optional (it can have zero values). If this were set to 1, the property would be required.
Together, these constraints define a property that is optional but can only occur once if present.
sh:class asm:Brain
:The
sh:class
property is used to enforce that the value of the property must be of a specific RDF class, in this case,asm:Brain
. This ensures that the value ofasm:equippedWith_brain
must be an instance of theasm:Brain
class.
Targeting Multiple Classes with
sh:class
:You can target multiple classes by listing them in a comma-separated list within the
sh:class
property. For example:This specifies that the property can be an instance of either
fv:Gloves
orfv:Mittens
.
sh:path
Property:The
sh:path
statement indicates the exact RDF property within your data model that is subject to the constraints defined in the SHACL shape.In this case,
asm:equippedWith_brain
is the RDF property that the shape is describing. This property might represent a relationship where aBoxer
is equipped with aBrain
.
ASM Brain
This example defines Brain
as a specialized type of OnChainNFT
, inheriting properties and constraints from its parent classes.
Last updated