-
Notifications
You must be signed in to change notification settings - Fork 5
Json Structure
Every json file includes a Metadata
and Data
attribute on the root object. The metadata structure is identical across every file. The data varies depending on the CreedFormat
but there are some conventions.
- The bulk text of a creed should be in
Content
attributes
This is the header information that every creed should have. Read the schema here!
{
"Metadata": {
"Title": "",
"AlternativeTitles": [""],
"Year": "",
"Authors": [""],
"Location": "",
"OriginalLanguage": "",
"OriginStory": "",
"SourceUrl": "",
"SourceAttribution": "",
"CreedFormat": ""
}
}
There are several 'formats' to these creeds. Here are the big 4 and what they are called.
This format is named such due to most of the earliest creeds falling into this category. It is just one string of text without any other structure. This string of text could have multiple paragraphs but will not have sections, chapters or the like. Read the schema here!
{
"Data": {
"Content": "..."
}
}
This format needed a name and so it has one. Though maybe 'Consensus' would be more fitting. It is a list of titled strings (ie: paragraphs). Read the schema here!
{
"Data": [
{
"Article": "",
"Title": "",
"Content": "..."
}
]
}
This format is named after the Westminster Confession. It has a list of chapters, each with a list of sections. Read more about this schema here!
{
"Data": [
{
"Chapter": "",
"Title": "",
"Sections": [
{
"Section": "",
"Content": "..."
}
]
}
]
}
The only format with an intuitive name. It is a list of question/answer pairs. Read more about the schema here!
{
"Data": [
{
"Number": "",
"Question": "...",
"Answer": "..."
}
]
}
Any object with a Content
attribute could optionally have proof texts for that content.
{
"Content": "...",
"ContentWithProofs": "...",
"Proofs": [
{
"Id": "",
"References": ""
}
],
"ProofsWithScripture`": [
{
"Id": "",
"References": ""
}
]
}
Add metadata to existing json:
jq '{ "Metadata": { "Title": "", "AlternativeTitles": [""], "Year": "", "Authors": [""], "Location": "", "OriginalLanguage": "", "OriginStory": "", "SourceUrl": "", "SourceAttribution": "", "CreedFormat": "" }, "Data": . }' ten_theses_of_berne.json
Convert Reformed Standards confession into Creeds.json confession:
yq '.|{ Metadata: {Title: .name, Year: .publication_year, AlternativeTitles:[], Authors:[], Location: null, OriginalLanguage: null, OriginStory: null, SourceUrl: null, SourceAttribution: "Copyright - Reformed Standards", CreedFormat: "Confession"}, Data: [.chapters[] | {Chapter: .number | tostring, Title: .name, Sections: [.articles[] | {Section: .number | tostring, Content: .text | gsub("\\[[a-z]\\]";"") | sub("\n$";""), ContentWithProofs: .text | sub("\n$";""), Proofs: [.verses | to_entries[] | {Id: .key, References: .value}] }]}]}' file.yml