summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-03 23:54:54 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-04 00:19:15 -0700
commit09c8fffe9fbf94a3004b5dda5dd9e50496591ad6 (patch)
treebced6f77377b812c25695e4be3047e09d3a63890
parent733962480b4ee084bb9e019351143a9181d2cbc2 (diff)
downloadfatcat-09c8fffe9fbf94a3004b5dda5dd9e50496591ad6.tar.gz
fatcat-09c8fffe9fbf94a3004b5dda5dd9e50496591ad6.zip
updates to schema(s): more complete, alignment
-rw-r--r--fatcat-openapi2.yml38
-rw-r--r--notes/alignments.csv8
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql43
3 files changed, 64 insertions, 25 deletions
diff --git a/fatcat-openapi2.yml b/fatcat-openapi2.yml
index a981cc44..c53ff4a7 100644
--- a/fatcat-openapi2.yml
+++ b/fatcat-openapi2.yml
@@ -80,12 +80,16 @@ definitions:
creator_entity:
type: object
required:
- - full_name
+ - display_name
properties:
<<: *ENTITYPROPS
- full_name:
+ display_name:
type: string
example: "Grace Hopper"
+ given_name:
+ type: string
+ surname:
+ type: string
orcid:
type: string
#format: custom
@@ -106,10 +110,17 @@ definitions:
type: string
#format: custom
example: "d41efcc592d1e40ac13905377399eb9b"
+ sha256:
+ type: string
+ #format: custom
+ example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
url:
type: string
format: url
example: "https://example.edu/~frau/prcding.pdf"
+ mimetype:
+ type: string
+ example: "application/pdf"
releases:
type: array
items:
@@ -132,8 +143,11 @@ definitions:
example: "00000000-0000-0000-adce-000000000001"
release_type:
type: string
+ example: "book"
+ release_status:
+ type: string
example: "preprint"
- date:
+ release_date:
type: string
format: date
doi:
@@ -152,6 +166,8 @@ definitions:
example: "12"
publisher:
type: string
+ language:
+ type: string
contribs:
type: array
items:
@@ -269,8 +285,20 @@ definitions:
target_release_id:
type: string
#format: uuid
- stub:
+ raw:
+ type: string
+ key:
+ type: string
+ year:
+ type: integer
+ format: int64
+ container_title:
+ type: string
+ title:
+ type: string
+ locator:
type: string
+ example: "p123"
release_contrib:
type: object
properties:
@@ -280,7 +308,7 @@ definitions:
creator_id:
type: string
#format: uuid
- creator_stub:
+ raw:
type: string
role:
type: string
diff --git a/notes/alignments.csv b/notes/alignments.csv
index c5bd6cea..d6d2c171 100644
--- a/notes/alignments.csv
+++ b/notes/alignments.csv
@@ -13,18 +13,18 @@ RELEASE,,,,,,,Instance,,,,,,
,doi,always lower-case,DOI,,doi,DOI,,Identifier,,,,citation_doi,
,isbn13,,ISBN (converted),,,ISBN,,Identifier,,,,citation_isbn,
,publisher,,publisher,,publisher,,,Publisher,,,,"citation_dissertation_institution, citation_technical_report_institution",
-,language,NEW; some ISO?,,,,,,Language,,,,,
+,language,NEW; ISO 639-3 (3 char),,,,,,Language,,,,,
,ref:index,,reference:[index],,,Citation-number,,,,,,,
,ref:key,NEW,reference:key,,,citation-label,,,,,,,
,ref:raw,RENAME,reference:unstructured,,,,,,,,,,
,ref:container_title,NEW,reference:journal-title,,,,,,,,,,
-,ref:release_year,NEW,reference:year,,,,,,,,,,
+,ref:year,NEW,reference:year,,,,,,,,,,
,ref:title,NEW,,,,,,,,,,,
,ref:locator,"NEW; (aka, page number)",,,,,,,,,,,
,contrib:role,,,,,,Role,,,,,,
,contrib:index,,author[index],,,,,,,,,,
,contrib:raw,RENAME,Author:{given+family},,author,,,,,,,,
-,Extra:number,tech reports,,,,,,,,,,citation_technical_report_number,
+,extra:number,tech reports,,,,,,,,,,citation_technical_report_number,
,extra:institution,for tech reports and dissertations,,,,,,,,,,,
,extra:abstract,,,,,,,Description,,,,citation_abstract,
,extra:pmcid,,,,,,,,,,,,
@@ -35,7 +35,7 @@ CREATOR,,,,,,,Agent,Creator / Contributor,,,,,
,display_name,NEW; usually western/latinized ,,.name.credit-name.value (?),,,,,,,,citation_author,
,orcid,,,.path,,,,,,,,,
,given_name,NEW,,.name.given-names.value,,,,,,,,,
-,sur_name,NEW,,.name.family-names.value,,,,,,,,,
+,surname,NEW,,.name.family-names.value,,,,,,,,,
,extra:viaf,,,,,,,,,,,,
,extra:alt_names[],,,,,,,,,,,,
,,,,,,,,,,,,,
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index 2bd6714a..e6c54d32 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -37,7 +37,9 @@ CREATE TABLE creator_rev (
id BIGSERIAL PRIMARY KEY,
extra_json JSON,
- full_name TEXT NOT NULL,
+ display_name TEXT NOT NULL,
+ given_name TEXT,
+ surname TEXT,
orcid TEXT
-- TODO: aliases/alternatives
-- TODO: sortable name?
@@ -100,8 +102,10 @@ CREATE TABLE file_rev (
size BIGINT,
sha1 TEXT, -- TODO: varchar or bytes
+ sha256 TEXT, -- TODO: varchar or bytes
md5 TEXT, -- TODO: varchar or bytes
- url TEXT -- TODO: URL table
+ url TEXT, -- TODO: URL table
+ mimetype TEXT
);
CREATE TABLE file_ident (
@@ -129,13 +133,15 @@ CREATE TABLE release_rev (
container_ident_id UUID REFERENCES container_ident(id),
title TEXT NOT NULL,
release_type TEXT, -- TODO: enum
- date DATE,
+ release_status TEXT, -- TODO: enum
+ release_date DATE,
doi TEXT,
isbn13 TEXT,
volume TEXT,
pages TEXT,
issue TEXT,
- publisher TEXT -- for books, NOT if container exists
+ publisher TEXT, -- for books, NOT if container exists
+ language TEXT -- primary language of the work's fulltext
-- TODO: identifier table?
);
@@ -196,7 +202,7 @@ CREATE TABLE release_contrib (
creator_ident_id UUID REFERENCES creator_ident(id),
role TEXT, -- TODO: enum?
index BIGINT,
- stub TEXT
+ raw TEXT
);
CREATE TABLE release_ref (
@@ -204,7 +210,12 @@ CREATE TABLE release_ref (
release_rev BIGSERIAL REFERENCES release_rev(id) NOT NULL,
target_release_ident_id UUID REFERENCES release_ident(id), -- or work?
index BIGINT,
- stub TEXT
+ key TEXT,
+ raw TEXT,
+ container_title TEXT,
+ year BIGINT,
+ title TEXT,
+ locator TEXT
);
CREATE TABLE file_release (
@@ -256,10 +267,10 @@ INSERT INTO container_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
('00000000-0000-0000-1111-000000000001', 1, null, 4),
('00000000-0000-0000-1111-000000000002', 2, null, 5);
-INSERT INTO creator_rev (full_name, orcid) VALUES
- ('Grace Hopper', null),
- ('Emily Noethe', null),
- ('Christine Moran', '0000-0003-2088-7465');
+INSERT INTO creator_rev (display_name, given_name, surname, orcid) VALUES
+ ('Grace Hopper', null, null, null),
+ ('Emily Noether', 'Emily', 'Noether', null),
+ ('Christine Moran', 'Christine', 'Moran', '0000-0003-2088-7465');
INSERT INTO creator_ident (id, is_live, rev_id, redirect_id) VALUES
('00000000-0000-0000-2222-000000000001', true, 1, null),
@@ -273,9 +284,9 @@ INSERT INTO creator_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
('00000000-0000-0000-2222-000000000003', 3, null, 3),
('00000000-0000-0000-2222-000000000004', 2, null, 4);
-INSERT INTO file_rev (size, sha1, md5, url) VALUES
- (null, null, null, null),
- (4321, '7d97e98f8af710c7e7fe703abc8f639e0ee507c4', null, 'http://archive.org/robots.txt');
+INSERT INTO file_rev (size, sha1, sha256, md5, url, mimetype) VALUES
+ (null, null, null, null, null, null),
+ (4321, '7d97e98f8af710c7e7fe703abc8f639e0ee507c4', null, null, 'http://archive.org/robots.txt', 'text/plain');
INSERT INTO file_ident (id, is_live, rev_id, redirect_id) VALUES
('00000000-0000-0000-3333-000000000001', true, 1, null),
@@ -297,7 +308,7 @@ INSERT INTO work_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
('00000000-0000-0000-5555-000000000001', 1, null, 4),
('00000000-0000-0000-5555-000000000002', 2, null, 5);
-INSERT INTO release_rev (work_ident_id, container_ident_id, title, release_type, date, doi, isbn13, volume, pages, issue, publisher) VALUES
+INSERT INTO release_rev (work_ident_id, container_ident_id, title, release_type, release_date, doi, isbn13, volume, pages, issue, publisher) VALUES
('00000000-0000-0000-5555-000000000001', null, 'example title', null, null, null, null, null, null, null, null),
('00000000-0000-0000-5555-000000000002', '00000000-0000-0000-1111-000000000001', 'bigger example', 'journal-article', '2018-01-01', null, '10.123/abc', '12', '5-9', 'IV', null);
@@ -309,11 +320,11 @@ INSERT INTO release_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
('00000000-0000-0000-4444-000000000001', 1, null, 4),
('00000000-0000-0000-4444-000000000002', 2, null, 5);
-INSERT INTO release_contrib (release_rev, creator_ident_id, stub, role, index) VALUES
+INSERT INTO release_contrib (release_rev, creator_ident_id, raw, role, index) VALUES
(2, null, null, null, null),
(2, '00000000-0000-0000-2222-000000000002', 'some contrib', 'editor', 4);
-INSERT INTO release_ref (release_rev, target_release_ident_id, index, stub) VALUES
+INSERT INTO release_ref (release_rev, target_release_ident_id, index, raw) VALUES
(2, null, null, null),
(2, '00000000-0000-0000-4444-000000000001', 4, 'citation note');