Examples
Futureverse
This example defines the core classes and their hierarchies within the Futureverse framework. These definitions create a hierarchy wherefv: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 anOnChainNFT, called Boxer, using SHACL (Shapes Constraint Language).
TNX Boxer properties
-
sh:property:- The
sh:propertyconstruct defines constraints on a particular property of a node. Inside eachsh:propertyblock, you specify details about the property, such as its path, type, cardinality, and more.
- The
-
sh:maxCountandsh: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.
-
sh:class asm:Brain:- The
sh:classproperty 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_brainmust be an instance of theasm:Brainclass.
- The
-
Targeting Multiple Classes with
sh:class:-
You can target multiple classes by listing them in a comma-separated list within the
sh:classproperty. For example:This specifies that the property can be an instance of eitherfv:Glovesorfv:Mittens.
-
You can target multiple classes by listing them in a comma-separated list within the
-
sh:pathProperty:-
The
sh:pathstatement 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_brainis the RDF property that the shape is describing. This property might represent a relationship where aBoxeris equipped with aBrain.
-
The
ASM Brain
This example definesBrain as a specialized type of OnChainNFT, inheriting properties and constraints from its parent classes.