robos:GameItem
Validation shape for robos:GameItem nodes in the game package group.
Details
| Class | robos:GameItem |
| Shape id | urn:robos:shape:GameItemShape |
| Package | Game Rules (robos.game) (game) |
| Schema.org type | schema:Product |
| Domain standard | robos.dev |
Properties
Count is the minimum and maximum number of values (* means no maximum). The validator enforces both. The type column is documentation only; the validator does not check types.
| Property | Count | Type | Rule or description |
|---|---|---|---|
dcterms:title | 1..* | xsd:string | Game item must have a name. |
Example node
This node comes from .robos/kgraphs/game/package.jsonld in the RobOS repository. That graph holds sample data for a fictional company, so treat the values as illustrations.
{
"@id": "urn:robos:game:item:dagger",
"@type": [
"oslc_am:Resource",
"robos:GameItem",
"schema:Product"
],
"dcterms:title": "Dagger",
"robos:itemCategory": "weapon",
"robos:cost": 25,
"robos:package": "game",
"robos:namespace": "robos.game"
}
Validate the example
Save the example as node.json in the repository root, then run:
node -e "const { SHACLValidator } = require('./packages/robos-graph/lib/shacl-validator'); console.log(new SHACLValidator().validate([require('./node.json')]).conforms)"
The command prints true when the node meets every rule for its types.