You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somewhat related to cases #271 and #267, but both are a few years old, so wanted to re-clarify and see if there is a newer answer:
In attempting to provide @context to a JSON structure I don't own, I'm running into the issue of being unable to flatten the source structure, without adding the @context definitions into the JSON structure. The source data looks like:
{
"version":"0.0.1",
"header":{"datastore":"namecoin"},
"data":{
"name":"u/midnight",
"value":{
"website":"http://midnightdesign.ws",
"bio":"Teaching computers / to make art with just some code. / It is what I do.",
"github":{
"username":"MidnightLightning",
"proof":{
"url":"https://gist.github.com/MidnightLightning/bcfffdf02fde63e7f25a"
}
},
"name":{
"formatted":"Brooks Boyd"
},
"twitter":{
"username":"midnight426",
"proof":{
"url":"https://twitter.com/midnight426/status/486919185448972288"
}
},
"next":"i/midnight-1"
},
"txid":"17fbf8cc44194703a7bddd736b49837e9e17298b2c17dc54dfc6fb848a3a62fe",
"address":"N3XERXXsAEqmRAoyQpwtJqSAPPunWMMswT",
"expires_in":11423
}
}
(This is the JSON data stored in the Namecoin blockchain by the OneName identity service (example is the representation of my profile, which is stored on the Namecoin blockchain).
The issue is that the data is buried several layers deep, but really only refers to one entity. For example, to try and map myself to a Schema.org Person, with a Name and Website:
That @context gets the values for "name" and "website" out, though it doesn't directly relate it to the "person" node, but rather to the "nc:value" -> "nc:name" middle nodes I have to put in there to make the "formatted" name show up.
Is there an existing way to flatten this hierarchy into one node worth of data? Or do I need to craft a pre-processor to restructure that data first? Or could using something like the Javascript dot-notation, with nested contexts be added to the spec to support this sort of thing:
With this structure, the parser could know that because "value.name.formatted" is defined in the root level of "data", it's a direct child of that node (which is a Person), rather than nodes in their own right? This would also solve the issue where "name" got doubled-up: data.name is an ID, while data.value.name is just a wrapper node, and this dot-notation allows separate contexts for them.
The text was updated successfully, but these errors were encountered:
Somewhat related to cases #271 and #267, but both are a few years old, so wanted to re-clarify and see if there is a newer answer:
In attempting to provide
@context
to a JSON structure I don't own, I'm running into the issue of being unable to flatten the source structure, without adding the@context
definitions into the JSON structure. The source data looks like:(This is the JSON data stored in the Namecoin blockchain by the OneName identity service (example is the representation of my profile, which is stored on the Namecoin blockchain).
The issue is that the data is buried several layers deep, but really only refers to one entity. For example, to try and map myself to a Schema.org Person, with a Name and Website:
That
@context
gets the values for "name" and "website" out, though it doesn't directly relate it to the "person" node, but rather to the "nc:value" -> "nc:name" middle nodes I have to put in there to make the "formatted" name show up.Is there an existing way to flatten this hierarchy into one node worth of data? Or do I need to craft a pre-processor to restructure that data first? Or could using something like the Javascript dot-notation, with nested contexts be added to the spec to support this sort of thing:
With this structure, the parser could know that because "value.name.formatted" is defined in the root level of "data", it's a direct child of that node (which is a Person), rather than nodes in their own right? This would also solve the issue where "name" got doubled-up:
data.name
is an ID, whiledata.value.name
is just a wrapper node, and this dot-notation allows separate contexts for them.The text was updated successfully, but these errors were encountered: