Skip to content

Commit 132703d

Browse files
committed
update Index Files
1 parent 0c5d807 commit 132703d

File tree

7 files changed

+74
-17
lines changed

7 files changed

+74
-17
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ All api source code located in plumber folder. To run the server locally you nee
1717

1818
## APIs
1919

20-
Example APIs are deployed in http://178.62.126.59:8500/. Following we present short summary of the API used in the tool.
20+
Example APIs are deployed in http://datascience.ismb.it:9500/. Following we present short summary of the API used in the tool.
2121

2222
**runQury/**
2323

@@ -43,7 +43,7 @@ className<-gsub("#", "%23", className)
4343
graph<-"<http://dbpedia.org/resource/classes#>"
4444
graph<-gsub("#", "%23", graph)
4545
46-
parm<-paste0("http://178.62.126.59:8500/","runQuery?filename=",filename,"&endpoint=",endpoint,"&graph=",
46+
parm<-paste0("http://datascience.ismb.it:9500/","runQuery?filename=",schedulerName,"&endpoint=",endpoint,"&graph=",
4747
graph,"&className=",className)
4848
4949
r<-GET(parm)
@@ -65,7 +65,7 @@ Example:
6565
```
6666
schedulerName= "scheduler_event"
6767
68-
parm<-paste("http://178.62.126.59:8500/","readCSV?filename=",schedulerName,".csv",sep = "")
68+
parm<-paste("http://datascience.ismb.it:9500/","readCSV?filename=",schedulerName,".csv",sep = "")
6969
7070
r<-GET(parm)
7171
@@ -102,15 +102,15 @@ graph<-gsub("#", "%23", graph)
102102
103103
# It is necessary to create the R script before creating the Cron Job in the server
104104
105-
parm<-paste0("http://178.62.126.59:8500/","createRfile?filename=",schedulerName,"&className=",
105+
parm<-paste0("http://datascience.ismb.it:9500/","createRfile?filename=",schedulerName,"&className=",
106106
className,"&endpoint=",endpoint,"&graph=",graph)
107107
108108
responseCreateRfile<-GET(parm)
109109
resCreateRfileContent<-content(responseCreateRfile)
110110
111111
# In the server duplicate scheduler will generate error. For this before createing scheduler please check current # # available schedulers.
112112
113-
parm<-"http://178.62.126.59:8500/readSchedulerIndex"
113+
parm<-"http://datascience.ismb.it:9500//readSchedulerIndex"
114114
r<-tryCatch(GET(parm), error = function(e) return(NULL))
115115
dt<-content(r)
116116
DF<-fromJSON(dt[[1]])
@@ -121,7 +121,7 @@ resCreateRfileContent<-content(responseCreateRfile)
121121
freq="daily"
122122
time="14:25:00"
123123
124-
parm<-paste0("http://178.62.126.59:8500/","createCornJob?filename=",schedulerName,"&freq=",
124+
parm<-paste0("http://datascience.ismb.it:9500/","createCornJob?filename=",schedulerName,"&freq=",
125125
freq,"&time=",time)
126126
r<-GET(parm)
127127
@@ -140,9 +140,9 @@ Return: CronJOb list
140140

141141
```
142142
143-
parm<-"http://178.62.126.59:8500/getAllCornList"
143+
parm<-"http://datascience.ismb.it:9500/getAllCornList"
144144
145-
http_status(GET("http://178.62.126.59:8500/getAllCornList"))
145+
http_status(GET("http://datascience.ismb.it:9500/getAllCornList"))
146146
147147
r<-GET(parm)
148148
@@ -152,5 +152,6 @@ content(r)
152152

153153

154154
#### Licence
155+
155156
These scripts are free software; you can redistribute it and/or modify it under the terms of the GNU General Public License published by
156157
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the file Documentation/GPL3 in the original distribution for details. There is ABSOLUTELY NO warranty.

Test files/ApiTestR01.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
library(SPARQL)
22
library(jsonlite)
33
filename=TestR01.R
4-
endpoint=http://kb.3cixty.com/sparql
4+
endpoint="http://kb.3cixty.com/sparql"
55
className=dul:Place
6-
graph=<http://3cixty.com/nice/places>
7-
parm<-paste("http://178.62.126.59:8500/","runQuery?filename=",filename,"&className=",
6+
graph="<http://3cixty.com/nice/places>"
7+
parm<-paste("http://datascience.ismb.it:9500//shiny/KBDataObservetory/","runQuery?filename=",filename,"&className=",
88
className,"&endpoint=",endpoint,"&graph=",graph,sep = "")
99
r<-GET(parm)
1010
destfile=paste(getwd(),filename,sep = "/")

Test files/run-myserver.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
library(plumber)
22
myplumobject <- plumb('myserver.R')
33
myplumobject$run(port=4000)
4+
5+

plumber/apiServerCall.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library(SPARQL)
22
library(jsonlite)
33
library(cronR)
44
library(stringr)
5-
library(taskscheduleR)
5+
#library(taskscheduleR)
66

77

88
#* @get /getSchedulerResults
@@ -61,31 +61,31 @@ createSchedulerIndex<-function(schedulerName){
6161
#* @get /addSchedulerIndex
6262
createSchedulerIndex<-function(schedulerName){
6363

64-
st<-read.csv("/root/index/scheduleIndex.csv",header = T)
64+
st<-read.csv("/srv/shiny-server/KBDataObservetory/schedulerIndex/scheduleIndex.csv",header = T)
6565
df<-data.frame(schedulerName<-schedulerName,location<-"/usr/local/lib/R/site-library/cronR/extdata/",
6666
saveData<-"/usr/local/lib/R/site-library/cronR/extdata/saveData")
6767
df<-rbind(st,df)
6868

69-
write.csv(df,"/root/index/scheduleIndex.csv",row.names = F)
69+
write.csv(df,"/srv/shiny-server/KBDataObservetory/schedulerIndex/scheduleIndex.csv",row.names = F)
7070
rm(df)
7171
}
7272

7373
#* @get /readSchedulerIndex
7474
createSchedulerIndex<-function(){
75-
st<-read.csv("/root/index/scheduleIndex.csv",header = T)
75+
st<-read.csv("/srv/shiny-server/KBDataObservetory/schedulerIndex/scheduleIndex.csv",header = T)
7676
toJSON(st)
7777
}
7878

7979
#* @get /updateSchedulerIndex
8080
createSchedulerIndex<-function(schedulerName){
8181

82-
DF<-read.csv("/root/index/schedulerList.csv",header = T)
82+
DF<-read.csv("/srv/shiny-server/KBDataObservetory/schedulerIndex/schedulerList.csv",header = T)
8383

8484
ind <- which(with( DF, schedulerName==schedulerName))
8585

8686
DF <- DF[ -ind, ]
8787

88-
write.csv(data.frame(DF),"/root/index/schedulerList.csv",row.names = F)
88+
write.csv(data.frame(DF),"/srv/shiny-server/KBDataObservetory/schedulerIndex/schedulerList.csv",row.names = F)
8989
rm(DF)
9090
}
9191

schedulerIndex/scheduleIndex.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"filename"
2+
"lode:Event"

schedulerIndex/schedulerList.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"filename"
2+
"lode:Event"

testingApiCalls.R

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
library(httr)
2+
3+
endpoint<-"https://dbpedia.org/sparql"
4+
5+
schedulerName="scheduler_owl"
6+
endpoint<-"https://dbpedia.org/sparql"
7+
8+
className<-"<http://www.w3.org/2002/07/owl#Class>"
9+
className<-gsub("#", "%23", className)
10+
11+
graph<-"<http://dbpedia.org/resource/classes#>"
12+
graph<-gsub("#", "%23", graph)
13+
14+
filename="test"
15+
#130.192.85.247
16+
17+
parm<-paste0("http://datascience.ismb.it:9500/","runQuery?filename=",filename,"&endpoint=",endpoint,"&graph=",
18+
graph,"&className=",className)
19+
20+
r<-GET(parm)
21+
22+
#http://datascience.ismb.it:9500/readSchedulerIndex
23+
24+
r
25+
26+
dt<-content(r)
27+
28+
schedulerName= "scheduler_event"
29+
30+
parm<-paste("http://178.62.126.59:8500/","readCSV?filename=",schedulerName,".csv",sep = "")
31+
32+
r<-GET("http://datascience.ismb.it:9500/readSchedulerIndex")
33+
34+
r<-GET(parm)
35+
36+
dt<-content(r)
37+
38+
json_data <- fromJSON(dt[[1]])
39+
40+
41+
42+
# Create Scheduler Index
43+
44+
st=data.frame(filename=c("lode:Event"))
45+
46+
47+
write.csv(st,"/srv/shiny-server/KBDataObservetory/schedulerIndex/schedulerList.csv",row.names = F)
48+
49+
50+

0 commit comments

Comments
 (0)