Open cmaumet opened 9 years ago
still looking for this.
Could we do something like this?
@prefix jsd http://json-schema.org/draft-04/schema# ... niiri:contrast_id a prov:Entity , nidm:ContrastWeights ; ... other attributes ... prov:value "[1, 0, 0]"^^jsd:array ;
I don't think standard rdf parsers will know how to handle this, will they?
On Fri, Apr 10, 2015 at 3:21 PM, David Keator notifications@github.com wrote:
Could we do something like this?
@prefix https://github.com/prefix jsd http://json-schema.org/draft-04/schema# ... niiri:contrast_id a prov:Entity , nidm:ContrastWeights ; ... other attributes ... prov:value "[1, 0, 0]"^^jsd:array ;
— Reply to this email directly or view it on GitHub https://github.com/incf-nidash/nidm/issues/297#issuecomment-91707503.
I'm not sure about the syntax. Essentially I'm thinking we could reference an array type from the json schema http://json-schema.org/draft-04/schema# (for example) similar to what we did with xsd:string. In the json schema linked above they have:
"stringArray": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }
I don't have a firm grasp of validating json documents but if I use the same principles as XML schema then essentially we'd build a json schema document that defines integerArray or numberArray as below and use that as the schema then if we were using integerArray (or numberArray) in a json document it would validate against the schema. If our NIDM documents were serialized in json then the document should validate and a parser shouldn't have problems with it because it would be a well formed json document. In our case we're using TURTLE (or PROVN) and then adding in an xml schema type so it's a bit confusing to me:
"integerArray": { "type": "array", "items": { "type": "integer" }, "minItems": 1, "uniqueItems": true }
This issue is open to keep track of a discussion point raised during NIDASH call on March 23rd (Minutes, also cf. #270):
In the following example "xsd:string" would thus be replaced by a more specific type outlining that
prov:value
is a json-array: