-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGQP.py
More file actions
138 lines (101 loc) · 4.36 KB
/
GQP.py
File metadata and controls
138 lines (101 loc) · 4.36 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
from pandas import DataFrame
from pyparsing import null_debug_action
from impl import RelationalQueryProcessor, RelationalProcessor
from graph_01 import TriplestoreQueryProcessor
import pandas as pd
class GenericQueryProcessor(object):
def __init__(self):
self.queryProcessor = list()
def cleanQueryProcessors(self):
self.queryProcessor = self.queryProcessor.clear()
return True
def addQueryProcessor(self, qp):
self.queryProcessor.add(qp)
return True
#list of methods
def getPublicationPublishedinYear(self, year):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getPublicationsPublishedInYear(year)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
#the generic query processor will call eather the relational or the triplestore query processor
#for testing the user will decide the value of the year
def getPublicationsByAuthorId(self, orcid):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getPublicationsByAuthorId(orcid)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getMostCitedPublication(self, cites):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getMostCitedPublication(cites)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getMostCitedVenue(self, cites):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getMostCitedVenue(cites)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getVenuesByPublisherId(self, venue_id):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getVenuesByPublisherId(venue_id)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getJournalArticlesInIssue(self, issue, volume, identifier):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getJournalArticlesInIssue(issue, volume, identifier)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getJournalArticlesInVolume(self, volume, identifier):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getJournalArticlesInVolume(volume, identifier)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getJournalArticlesInJournal(self, identifier):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getJournalArticlesInJournal(identifier)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getProceedingsByEvent(self, event, name):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getProceedingsByEvent(event, name)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getPublicationAuthors(self, author, identifier):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessors:
result = qp.getPublicationAuthors(author, identifier)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getPublicationsByAuthorName(self, author, name):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getPublicationsByAuthorName(self, author, name)
MyDataFrame = pd.concat([MyDataFrame, result])
return result
def getDistinctPublisherOfPublication(self, publisher, venue_id, identifier):
MyDataFrame = pd.DataFrame()
result = []
for qp in self.queryProcessor:
result = qp.getPublicationsByAuthorName(publisher, venue_id, identifier)
MyDataFrame = pd.concat([MyDataFrame, result])
return result