Enumeration as an API resource

Hi,

We're adding support for enumerations on our JSON-LD Framework (API Platform). Let's say that https://schema.org/GamePlayMode is one of our API resource, types are documented like this:

{
"@id": "schema:GamePlayMode",
"@type": "rdfs:Class",
"rdfs:comment": "Indicates whether this game is multi-player, co-op or single-player.",
"rdfs:label": "GamePlayMode",
"rdfs:subClassOf": {
"@id": "schema:Enumeration"
}
},
{
"@id": "schema:CoOp",
"@type": "schema:GamePlayMode",
"rdfs:comment": "Play mode: CoOp. Co-operative games, where you play on the same team with friends.",
"rdfs:label": "CoOp"
},
{
"@id": "schema:SinglePlayer",
"@type": "schema:GamePlayMode",
"rdfs:comment": "Play mode: SinglePlayer. Which is played by a lone player.",
"rdfs:label": "SinglePlayer"
},
we fetch game_play_modes​ that returns an hydra collection:
{
"@context": "/contexts/GamePlayMode",
"@id": "/game_play_modes",
"@type": "hydra:Collection",
"hydra:member": [
{"@id": "/game_play_modes/SinglePlayer", "@type": "schema:GamePlayMode", "value": "single_player"},
{"@id": "/game_play_modes/CoOp", "@type": "schema:GamePlayMode", "value": "coop"}
]
}

Does that look correct? I'm wondering if the RDF type should​ be schema:GamePlayMode​ or schema:SinglePlayer​? Is there a link between the /game_play_mode/SinglePlayer​ IRI and the schema:SinglePlayer​ that I'm misssing?

Received on Monday, 15 April 2024 18:03:53 UTC