Is there a way to always force single objects to arrays with EasyRdf?
If there are multiple values as rdf:type
I get an array like this one. Note the @type
property is an array.
{
"@context": {
"ethon": "http://ethon.consensys.net/",
"ethstats": "http://ethereum.ethstats.io/"
},
"@graph": [{
"@id": "ethstats:Uncle_0x5cd50096dbb856a6d1befa6de8f9c20decb299f375154427d90761dc0b101109",
"@type": ["ethon:Uncle", "ethon:Block"],
"ethon:blockCreationTime": "2015-07-30T15:26:58.000Z",
"ethon:blockHash": "0x5cd50096dbb856a6d1befa6de8f9c20decb299f375154427d90761dc0b101109",
"ethon:number": "1"
}]
}
But if there is only one rdf:type
the @type
property is not an array.
{
"@context": {
"ethon": "http://ethon.consensys.net/",
"ethstats": "http://ethereum.ethstats.io/"
},
"@graph": [{
"@id": "ethstats:Uncle_0x5cd50096dbb856a6d1befa6de8f9c20decb299f375154427d90761dc0b101109",
"@type": "ethon:Uncle",
"ethon:blockCreationTime": "2015-07-30T15:26:58.000Z",
"ethon:blockHash": "0x5cd50096dbb856a6d1befa6de8f9c20decb299f375154427d90761dc0b101109",
"ethon:number": "1"
}]
}
When serializing the graph, I send to EasyRdf the options
'frame' => (object) [
'@context' => (object) [
'ethon' => 'http://ethon.consensys.net/',
'ethstats' => 'http://ethereum.ethstats.io/',
],
Is there a way to send the @set
option for the rdf:type
/ @type
property?