forked from bio-xyz/BioAgentsEliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.ts
More file actions
110 lines (94 loc) · 3.16 KB
/
Copy pathconstants.ts
File metadata and controls
110 lines (94 loc) · 3.16 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import OpenAI from 'openai';
export const QUERY_LIMIT = 8;
export const QUERY_LIMIT_LIGHTER = 20;
export const GRAPH_SCHEMA = {
'@context': {
schema: 'https://schema.org/',
fabio: 'http://purl.org/spar/fabio/',
cito: 'http://purl.org/spar/cito/',
dcterms: 'http://purl.org/dc/terms/',
foaf: 'http://xmlns.com/foaf/0.1/',
bibo: 'http://purl.org/ontology/bibo/',
go: 'http://purl.obolibrary.org/obo/GO_',
doid: 'http://purl.obolibrary.org/obo/DOID_',
chebi: 'http://purl.obolibrary.org/obo/CHEBI_',
atc: 'http://purl.obolibrary.org/obo/ATC_',
pw: 'http://purl.obolibrary.org/obo/PW_',
eco: 'http://purl.obolibrary.org/obo/ECO_',
mondo: 'http://purl.obolibrary.org/obo/MONDO_',
comptox: 'https://comptox.epa.gov/',
mesh: 'http://id.nlm.nih.gov/mesh/',
},
// The unique identifier for the paper (usually a DOI URL)
'@id': 'string (DOI URL)',
// The type of the paper (e.g., schema:ScholarlyArticle)
'@type': 'string',
// The title of the paper
'dcterms:title': 'string',
// The authors of the paper, as an array of objects
'dcterms:creator': [
{
'@id': 'string (ORCID or unique author URI)',
'@type': "string (usually 'foaf:Person')",
'foaf:name': "string (author's full name)",
},
// ... more authors
],
// The abstract of the paper
'dcterms:abstract': 'string',
// The publication date (ISO format)
'schema:datePublished': "string (e.g., '2023-01-19')",
// Keywords as an array of strings
'schema:keywords': [
'string',
// ... more keywords
],
// The publication venue (journal), as an object
'fabio:hasPublicationVenue': {
'@id': 'string (journal DOI or URI)',
'@type': "string (usually 'fabio:Journal')",
'schema:name': 'string (journal name)',
},
// Sections of the paper, as an array of objects
'fabio:hasPart': [
{
'@id': 'string (section id)',
'@type': "string (e.g., 'fabio:Section')",
'dcterms:title': 'string (section title)',
'fabio:hasContent': 'string (section content)',
},
// ... more sections
],
// Citated papers, as an array of objects
'cito:cites': [
{
'@id': 'string (DOI URL of citated paper)',
'@type': "string (e.g., 'bibo:AcademicArticle' or 'schema:ScholarlyArticle')",
'dcterms:title': 'string (title of citated paper)',
'bibo:doi': 'string (short DOI)',
},
// ... more citations
],
// Ontology terms about the paper, as an array of objects
'schema:about': [
{
'@id': 'string (ontology term URL)',
'dcterms:name': 'string (ontology term label)',
'dcterms:description': "string (description of the term's relevance to the paper)",
},
// ... more ontology terms
],
// Related organizations, as an array of objects
'schema:relatedTo': [
{
'@id': 'string (organization id or URI)',
'@type': "string (e.g., 'schema:Organization')",
'schema:name': 'string (organization name)',
},
// ... more organizations
],
};
export const KG_TRIPLE_STORE_URL = process.env.KG_TRIPLE_STORE_URL || 'http://localhost:7878/query';
export const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});