Invenio data model for OARepo
Project description
OARepo Invenio data model
Invenio base record model.
Instalation
pip install oarepo-invenio-model
Usage
The library provides extensible Invenio base record model.
JSON Schema
Add this package to your dependencies and use it via $ref in json schema.
Usage example
{
"type": "object",
"allOf": [
{
"properties": {
"title": {
"type": "string"
}
}
},
{
"$ref": "/schemas/invenio-v1.0.0.json#/definitions/InvenioRecord"
}
],
"additionalProperties": "false"
}
Elastic Search Mapping
Use oarepo-mapping-includes
library for extanding invenio base record model mapping.
Usage example
{
"mappings": {
"dynamic": "strict",
"oarepo:extends": "invenio-v1.0.0.json#/InvenioRecord",
"properties": {
"title": {
"type": "text"
}
}
}
}
Marshmallow
You can extense your schema with Invenio base model schema by inheriting from InvenioRecordMetadataSchemaV1Mixin
.
Usage example
class SampleSchemaV1(InvenioRecordMetadataSchemaV1Mixin):
title = fields.String(validate=validate.Length(min=5), required=True)
Changes
[Version 2.0.0]
- Update schemas, mappings and marshmallow to latest records rest schemas
- Switch record id type from string to PersistentIdentifier
[Version 1.1.0]
- Export Invenio ES mappings
Invenio base record model.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oarepo_invenio_model-2.0.2.tar.gz
(11.3 kB
view hashes)
Built Distribution
Close
Hashes for oarepo_invenio_model-2.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f150e9cdff93b6f5df6ab223022866f08b016d6347a132398a1ceb913b8104 |
|
MD5 | ad125d0f5148e64531944a4765f670f7 |
|
BLAKE2b-256 | e27d1fd15776d90bcfc7f7a286f33c0a71d549bfa6e8fc3bd7ea1e93db739050 |
Close
Hashes for oarepo_invenio_model-2.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd446ba6409e3741e0a268289621676bd74a6e787071e176691a6287ec09e1d0 |
|
MD5 | db69e025ed511b9ae7c8b911b16fa2ba |
|
BLAKE2b-256 | 11b872d4d0ce17762f5926e6e5aa469d54c778805ee6ff78ed572f1022388eff |