Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dbpedia-assoc
MARVIN-config
Commits
38f7d54e
Commit
38f7d54e
authored
Jul 01, 2020
by
vehnem
Browse files
api: completeness & logs
parent
24a93d3f
Changes
5
Hide whitespace changes
Inline
Side-by-side
dashboard/build.sbt
View file @
38f7d54e
...
@@ -22,7 +22,15 @@ libraryDependencies ++= Seq(
...
@@ -22,7 +22,15 @@ libraryDependencies ++= Seq(
)
)
// https://mvnrepository.com/artifact/org.apache.jena/jena-arq
// https://mvnrepository.com/artifact/org.apache.jena/jena-arq
libraryDependencies
+=
"org.apache.jena"
%
"jena-arq"
%
"3.15.0"
libraryDependencies
+=
"org.apache.jena"
%
"jena-arq"
%
"3.13.0"
//val AkkaVersion = "2.5.31"
//
//libraryDependencies ++= Seq(
// "com.lightbend.akka" %% "akka-stream-alpakka-ftp" % "2.0.1",
// "com.typesafe.akka" %% "akka-stream" % AkkaVersion
//)
enablePlugins
(
SbtTwirl
)
enablePlugins
(
SbtTwirl
)
enablePlugins
(
ScalatraPlugin
)
enablePlugins
(
ScalatraPlugin
)
dashboard/src/main/scala/org/dbpedia/release/Config.scala
deleted
100644 → 0
View file @
24a93d3f
package
org.dbpedia.release
/**
* Dashboard config
*/
object
Config
{
}
dashboard/src/main/scala/org/dbpedia/release/DataApiServlet.scala
View file @
38f7d54e
package
org.dbpedia.release
package
org.dbpedia.release
import
org.apache.jena.query.
{
QueryException
,
QueryExecutionFactory
}
import
org.apache.jena.query.
{
QueryException
,
QueryExecutionFactory
}
import
org.dbpedia.release.handler.
{
CompletenessHandler
,
ReleaseLogHandler
}
import
org.json4s.
{
DefaultFormats
,
Formats
}
import
org.json4s.
{
DefaultFormats
,
Formats
}
import
org.scalatra._
import
org.scalatra._
import
org.scalatra.json.JacksonJsonSupport
import
org.scalatra.json.JacksonJsonSupport
...
@@ -31,6 +32,35 @@ class DataApiServlet(implicit val swagger: Swagger)
...
@@ -31,6 +32,35 @@ class DataApiServlet(implicit val swagger: Swagger)
protected
implicit
val
jsonFormats
:
Formats
=
DefaultFormats
protected
implicit
val
jsonFormats
:
Formats
=
DefaultFormats
get
(
"/release/versions"
)
{
}
get
(
"/release/logs/:group/:version"
)
{
val
group
=
params
(
"group"
)
val
version
=
params
(
"version"
).
replace
(
"."
,
"-"
)
ReleaseLogHandler
.
getLogFiles
(
group
,
version
)
match
{
case
Some
(
array
)
=>
array
.
toList
case
_
=>
List
}
}
get
(
"/release/downloads/:group/:version"
)
{
val
group
=
params
(
"group"
)
val
version
=
params
(
"version"
)
}
get
(
"/release/completeness/:group/:version"
)
{
val
group
=
params
(
"group"
)
val
version
=
params
(
"version"
)
CompletenessHandler
.
getStatus
(
group
,
version
)
}
private
val
getVersions
=
private
val
getVersions
=
apiOperation
[
VersionResponse
](
"versionsByGroup"
)
apiOperation
[
VersionResponse
](
"versionsByGroup"
)
.
summary
(
"Show all versions"
)
.
summary
(
"Show all versions"
)
...
@@ -54,8 +84,7 @@ class DataApiServlet(implicit val swagger: Swagger)
...
@@ -54,8 +84,7 @@ class DataApiServlet(implicit val swagger: Swagger)
.
sparqlService
(
.
sparqlService
(
"http://databus.dbpedia.org/repo/sparql"
,
"http://databus.dbpedia.org/repo/sparql"
,
Queries
.
versionQuery
(
group
)
Queries
.
versionQuery
(
group
)
)
).
execSelect
()
.
execSelect
()
.
forEachRemaining
(
row
=>
{
.
forEachRemaining
(
row
=>
{
val
version
=
row
.
get
(
"?version"
).
asLiteral
().
getLexicalForm
val
version
=
row
.
get
(
"?version"
).
asLiteral
().
getLexicalForm
val
account
=
row
.
get
(
"account"
).
asResource
().
getURI
val
account
=
row
.
get
(
"account"
).
asResource
().
getURI
...
...
dashboard/src/main/webapp/data.json
View file @
38f7d54e
[
[
{
{
"version"
:
"<a class=
\"
text-danger
\"
href=
\"
/
2020.06.01
\"
>2020.06.01</a> M|G|W"
"version"
:
"<a class=
\"
text-danger
\"
href=
\"
?version=
2020.06.01
#version
\"
>2020.06.01</a> M|G|W"
},
},
{
{
"version"
:
"<a class=
\"
text-warning
\"
href=
\"
/2020.05.01
\"
>2020.05.01</a>"
"version"
:
"<a class=
\"
text-warning
\"
href=
\"
/2020.05.01
\"
>2020.05.01</a>"
...
...
dashboard/src/main/webapp/index.html
View file @
38f7d54e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<html>
<html>
<head>
<head>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
integrity=
"sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
crossorigin=
"anonymous"
>
integrity=
"sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
crossorigin=
"anonymous"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/bootstrap-table@1.16.0/dist/bootstrap-table.min.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/bootstrap-table@1.16.0/dist/bootstrap-table.min.css"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment