olisb Thanks, this helps.
"Why is linked_schemas a property [of] a node, rather than a property of a schema or a field property, which would seem to make more sense?"
Please see above. Maybe this question is due to the terminology (i.e., the choice of name for this field)?
What's confusing me is an apparent circularity of definitions here: this schema is defining a field which profiles conforming to the schema must use to define the schemas they conform to...
Also I think I was assuming the schema was a function of the index the profile was subscribed to, rather than something each profile can pick and choose. The wording you used can be interpreted this way: "you list all of the schemas with which you want profiles to conform [suggesting one rule for all profiles], and the Index will then [assert this rule from above to] ensure that the data provided an any profile files meets all of the requirements of the schema(s) you have selected in the linked_schemas field."
But now I see how this works: each profile can independently declare which schemas it implements (so long as those schemas don't say anything contradictory, such as defining different field schemas for the same field name). In this way it can be an amalgamation of those schemas. The index checks that each profile does what it claims. Correct?
There might be problems if there isn't a careful curation of schemas: they must not assert contradictory things. For instance, a field called version
which is an integer in one schema and a string in another. And they can force duplication of information: you might want to implement two or more schemas, each of which mandate semantically and syntactically identical fields but with different names. For instance, three schemas implemented (call them A
, B
and C
) all might expect an URL for the main website, but call it "website", "www", and "url". It might be nice if there was a way to avoid this duplication, perhaps by asserting "this field in my profile maps to A.website
, B.www
and C.url
".
Finally, there I believe there is something "special" about the linked_schemas
- it's not like other fields. Like you say, it's mandatory, at a level above the logic of the profile schema itself. However this is not explicitly stated at any level. I wonder if there needs to be something mixed in with the JSON schema definitions, something which asserts this field's requirement, and perhaps defines the metadata properties (author, version, etc.) as well?