-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_add_bibtex_to_author_nodes.aql
39 lines (37 loc) · 1.26 KB
/
05_add_bibtex_to_author_nodes.aql
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
// AQL query to execute IN arangodb QUERIES
// or /usr/bin/arangosh on DB host machine
// to add bibtex to author nodes
// LET ptypes = (
// FOR ptype IN pub_type
// RETURN DISTINCT ptype.name
// )
//
// LET all_authors_unformatted = (
// FOR ptype IN ptypes
// FOR doc IN dblp
// // LIMIT 4000000
// FILTER doc[ptype].author != null
// RETURN DISTINCT doc[ptype].author
// )
//
// LET all_authors_formatted_mixed = (
// FOR author_list IN all_authors_unformatted
// FOR author IN author_list[*]
// RETURN DISTINCT author
// )
//
// FOR a IN all_authors_formatted_mixed
// INSERT { author_data: a } INTO authors_formatted_mixed
//
// LET all_authors_formatted_mixed_with_bibtex = (
// FOR auth_moredata IN authors_formatted_mixed
// FILTER auth_moredata.author_data["@bibtex"] != null
// RETURN DISTINCT auth_moredata
// )
//
// FOR au IN all_authors_formatted_mixed_with_bibtex
// INSERT { name: au.author_data["#text"], bibtex: au.author_data["@bibtex"] } INTO authors_formatted_mixed_with_bibtex
FOR auth1 IN authors_formatted_mixed_with_bibtex
FOR auth2 IN author
FILTER auth2.name == auth1.name
UPDATE auth2 WITH { bibtex: auth1.bibtex } IN author