This repository contains sample profiles and repository templates for use with the Library of Congress BIBFRAME Editor (and derived codebases including Sinopia). These are the specifications that guide input form generation in those editors, and maps the form field values to RDF statements (or vice versa).
Profiles generally are combinations of resource templates with some additional metadata included. For the sake of this repository, we make the following assumptions:
- Profiles are used primarily / only by the LC Profile Editor to group a set of Resource Templates for editing;
- The LC BFE and Sinopia Editor load at the Resource Template level for generating RDF resource editing forms;
- Thus, a Profile is a collection of Resource Templates (referenced via their identifiers) and some additional metadata, and each Profile has its own identifier;
- A Resource Template is a collection of Property Templates (that guide assertions about the same implied Resource or Entity) and some additional metadata, and each Resource Template has its own identifier;
- And Property Templates are embedded / nested hashes within a Resource Template.
.
├── LICENSE
├── README.md
├── schemas
│ └── profile-schema.json : Validates a Profile (captured as a JSON document)
│ └── profiles-array.json : Validates an array of Profiles
│ └── property-template.json : Validates a Property Template embedded in a Resource Template
│ └── property-templates-array.json : Validates an array of Property Templates embedded in a Resource Template
│ └── resource-template.json : Validates a Resource Template
│ └── resource-templates-array.json : Validates an array of Resource Templates
├── resourceTemplates
│ └── v1
│ ├── all_resource_templates.json : All resource templates derived from LC Verso, updated to validate for Sinopia
├── profiles
│ └── v1
│ ├── all_profiles.json : All profiles derived from LC Verso, updated to validate for Sinopia
└── bfe-verso-profiles
├── profiles : All profiles as captured in LC Verso, both as a single JSON document and broken apart into separate JSON documents
├── derived-resource-templates : Resource Templates derived from the profiles above from LC Verso
Moved / Moving to ld4p sinopia github pages https://ld4p.github.io/sinopia.
We decided to serve them via github pages so it would be easiest for the devs to
have clearly versioned schemas
persist old versions of the schemas
be able to add new versions with a minimum of dependency on ops
The version 0.0.1 schemas have already moved. Subsequent official versions of the schemas will be created there and the schemas directory here will be emptied except for a SCHEMAS_HAVE_MOVED.md file.
Schemas with version 0.0.1 have be written to cleanly validate the profiles from https://github.com/lcnetdev/verso to with a minimum of changes.
The official place to look for version 0.0.1 JSON schemas is
- https://ld4p.github.io/sinopia/schemas/0.0.1/profile.json
- https://ld4p.github.io/sinopia/schemas/0.0.1/resource-templates-array.json
- https://ld4p.github.io/sinopia/schemas/0.0.1/resource-template.json
- https://ld4p.github.io/sinopia/schemas/0.0.1/property-templates-array.json
- https://ld4p.github.io/sinopia/schemas/0.0.1/property-template.json
- https://ld4p.github.io/sinopia/schemas/0.0.1/profiles-array.json
In schemas
there is currently a set of JSON schema files that are under construction.
- these will soon live at https://ld4p.github.io/sinopia/schemas (and will be removed from here, with a README note)
- source will be in git repo at https://github.com/LD4P/sinopia, in the
schemas
directory.
These are under construction because we have to coordinate changes to resource templates in addition to the schemas, but we wanted to wire up validation for existing BFE Verso Profiles first. Basically, we want to build the plumbing before we upgrade the faucets.
The following commands validate use the ajv CLI library
for JSON schema validation. However, there are many available JSON Schema validation libraries in numerous languages; just make sure you select one that validates JSON Schema version draft-07.
If the schemas themselves aren't valid, the following commands will so indicate.
$ ajv validate -s schemas/profiles-array.json -r 'schemas/*.json' -d profiles/v1/all_profiles.json
profiles/v1/all_profiles.json invalid
[ { keyword: 'format',
dataPath:
'[3].Profile.resourceTemplates[1].propertyTemplates[0].valueConstraint.valueDataType.dataTypeURI',
schemaPath:
'#/properties/valueConstraint/properties/valueDataType/properties/dataTypeURI/format',
params: { format: 'uri' },
message: 'should match format "uri"' } ]
$ ajv validate -s bfe-verso-profiles/schemas/profile -r 'bfe-verso-profiles/schemas/*.json' -d "bfe-verso-profiles/profiles/BIBFRAME 2.0 Place.json"
bfe-verso-profiles/profiles/BIBFRAME 2.0 Place.json valid
$ ajv validate -s bfe-verso-profiles/schemas/profile -r 'bfe-verso-profiles/schemas/*.json' -d "bfe-verso-profiles/profiles/*.json"
bfe-verso-profiles/profiles/all_profiles.json invalid
[ { keyword: 'type',
dataPath: '',
schemaPath: '#/type',
params: { type: 'object' },
message: 'should be object' } ]
bfe-verso-profiles/profiles/BIBFRAME 2.0 Admin Metadata.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Agents Contribution.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Agents Primary Contribution.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Agents.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Cartographic.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 DDC.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Edition Information.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Extra menus.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Form.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 IBC.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Identifiers.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Item.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Language.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 LCC.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Load.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Monograph.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Moving Image-35mm Feature Film.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Moving Image-BluRay DVD.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Notated Music.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Note.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Place.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Prints and Photographs.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Publication, Distribution, Manufacturer Activity.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Rare Materials.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Related Works and Expressions.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 RWO.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Serial.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Series Information.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Sound Recording-Analog.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Sound Recording-Audio CD-R.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Sound Recording-Audio CD.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Title Information.json valid
bfe-verso-profiles/profiles/BIBFRAME 2.0 Topic.json valid
bfe-verso-profiles/profiles/PMO Medium of Performance.json valid
$ ajv compile -s bfe-verso-profiles/schemas/property-template
schema bfe-verso-profiles/schemas/property-template is valid
$ ajv compile -s bfe-verso-profiles/schemas/profile
schema bfe-verso-profiles/schemas/profile is invalid
error: can't resolve reference resource-templates-array from id profile#