-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathworks-import.ts
76 lines (71 loc) · 2.36 KB
/
works-import.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { api } from "./neolace-api-client.ts";
import { DehydratedInstitution } from "./institutions-import.ts";
import { DehydratedAuthor } from "./authors-import.ts";
import { DehydratedVenue } from "./venue-import.ts";
import { DehydratedConcept } from "./concept-import.ts";
interface Authorship extends DehydratedAuthor {
"author_position": "first" | "middle" | "last";
"institutions": DehydratedInstitution[];
"raw_affiliation_string": string;
}
interface HostVenue extends DehydratedVenue {
"url": string;
"is_oa": boolean;
"version": "publishedVersion" | "acceptedVersion" | "submittedVersion";
"licence"?: string;
// NOTE there is also type field here, but it is not described
}
interface OpenAccess {
"is_oa": boolean;
"oa_status": "gold" | "green" | "hybrid" | "bronze" | "closed";
"oa_url"?: string;
}
export interface Work {
"id": string;
"doi": string;
"title": string;
"display_name": string;
"publication_year": number;
"publication_date": string;
"ids": {
"openalex": string;
"doi": string;
"mag"?: string;
"pmid"?: string;
"pmcid"?: string;
};
"host_venue": HostVenue; // rel
"type": string; // TODO add Crossref's controlled vocabulary // TODO add to schema
"open_access": OpenAccess;
"authorships": Authorship[]; // ??? rel
"cited_by_count": number;
"biblio": { // TODO to add to schema
"volume"?: string;
"issue"?: string;
"first_page"?: string;
"last_page"?: string;
};
"is_retracted": boolean;
"is_paratext": boolean;
"concepts": (DehydratedConcept & { // rels
"score": number;
})[];
"mesh"?: { // NOTE Mesh object from PubMed //TODO add to schema
"descriptor_ui"?: string;
"descriptor_name"?: string;
"qualifier_ui"?: string;
"qualifier_name"?: string;
"is_major_topic"?: boolean;
}[];
"alternate_host_venues": HostVenue[]; // rels
"referenced_works": string[]; // list of openalex ids REL
"related_works": string[]; //list of openalex ids REL
"abstract_inverted_index": Record<string, number[]>; // ???
// "cired_by_api_url"
// "counts_by_year"
"updated_date"?: string;
"created_date"?: string;
}
export function importWork(_work: Work): api.AnyBulkEdit[] {
throw new Error("Not implemented yet.");
}