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.1.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for oarepo_invenio_model-2.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b88d3bc29c422d151464b059629084524cc2b48fe0b7c3bc032b3e5708b181 |
|
MD5 | c93895483ff577a0907422068a930414 |
|
BLAKE2b-256 | 3a5bb5a7983e1776b107271c7026dfa88ee6be561905ea05d705e1d2752c594a |
Close
Hashes for oarepo_invenio_model-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77b97f64d19a5ae96d665e8beec84421b1999f57ba9c458cf623d1f9624713e8 |
|
MD5 | 45fb1bda06654a9b17b6f5149031939d |
|
BLAKE2b-256 | 54baefa75351b80aac5d1316ba75cfb84543a85d09d4046d96f7e0f73f835676 |