Hi Jack
This is not conforms to the current spec.
The problem with the above is that you end-up with that:
record --> attribute --> attribute --> linked-record
But I know that what you are trying to archive is to create/generate new
structure such as lists. No new structure have been created in BibJSON
(yet) that were not in the JSON spec. So, right now, we can create lists
with JSON arrays introduced with brackets ([...]).
I think we should have some discussions about lists, and what they are.
Well, there are many kind of such structures such as colelctions,
ordered lists (sequences), unordered lists (bag), etc. But the question
is: should we introduce them in BibJSON, and if yes, what would be the
best way to do this?
In the past, we had several discussion about JSON "objects" and JSON
"arrays", what should we use and when, etc.
So, here is a question for the group: what if everything is a JSON
object, and that we don't use any arrays (brackets). And if we want to
introduce a structure (a bag, a sequence, etc), we do this with some
core attributes that have been added for that special purpose.
Lets try with the example below, which switched the logic in Jack's example.
{
"id": "ap79",
"type": "Article",
"author": {
"bibtex_label: "J. Pitman and David Aldous",
"sequence": {
{
"prefLabel": "David Aldous",
"ref": "@Aldous_David"
},
{
"prefLabel": "James Pitman",
"ref": "@Pitman_Jim"
}
}
},
"series": {
"prefLabel": "Annals of Probabiliity,
"ref": "@Annals_of_Probability"
},
"title": "On the zero-one law for exchangeable events",
"year": "1979",
"subject": "Markov chain, Coupling, Zero one law,
Exchangeable events",
"volume": "7",
"pages": "704-723",
"mrClass": "60F20 (60J10)",
"mrid": "MR537216"
},
So, we could have keywords such as "sequence" when the order is
important, and "bag" when the order is not important (or "listSequence)
and "listBag"; or "orderedList" and "unorderedList"; etc...)
When no "structural" keywords are used like what we have with "series",
it means that the reference is to a single record.
The example above would mean something like:
"The article "On the zero-one law for exchangeable events" has two
authors, and the names of the authors appears in the ordered list "David
Aldous" and "James Pitman". Additionally, we have some "meta-data" that
gives us some more information about the bibtex author string."
Then, in the structure schema, the definition of the "author" attribute
would be something like:
"author": {
"prefLabel": "author",
"description": "The name(s) of the author(s) (in the
case of more than one author, separated by and)",
"allowedType": "Document",
"allowedValue": ["String", "Person"],
"minCardinality": "1"
},
So, author attribute described that way means:
Someone can use the "author" attribute to describe a "Document" record.
The value of this attribute can be either a "String" or a "Person"
record. The minimum cardinality is 1, but there can be multiple values.
What is important is to see is what "minCardinality" and
"maxCardinality" implies. If we can have multiple values for an
attribute (minCardinality >= 1 or maxCardinality >= 2), that implies
that a "list" structure can be expected by a parser/validator. This
means that the following three examples would be valid BibJSON:
{
"id": "ap79",
"type": "Article",
"author": {
"sequence": {
{
"prefLabel": "David Aldous",
"ref": "@Aldous_David"
},
{
"prefLabel": "James Pitman",
"ref": "@Pitman_Jim"
}
}
}
}
OR
{
"id": "abc",
"type": "Article",
"author": {
"sequence": {
{
"prefLabel": "Bob",
"ref": "@Bob"
}
}
}
}
(a sequence of a single value)
OR
{
"id": "abc",
"type": "Article",
"author": {
"prefLabel": "Bob",
"ref": "@Bob"
}
}
After thinking about this, I think it would make sense to only use JSON
objects to describe everything, and to introduce these new "structural
keywords" instead. One advantage is that we can have multiple different
kind of structures, and that we don't confuse structured related
information between JSON's syntax and BibJSON's.
Any thoughts?
Thanks!
Take care,
Fred