Commit 1eea1f5a authored by Marvin Hofer's avatar Marvin Hofer
Browse files

view: added step 8 and 9 card

parent 850e79c3
......@@ -81,11 +81,12 @@ class DataApiServlet(implicit val swagger: Swagger)
}
}
get("/release/completeness/:group/:version") {
get("/release/completeness/:publisherName/:group/:version") {
val group = params("group")
val version = params("version")
val publisherName = params("publisherName")
CompletenessHandler.getStatus(group, version) match {
CompletenessHandler.getStatus(publisherName, group, version) match {
case Some(success) => success
case _ => List()
}
......
......@@ -8,18 +8,28 @@ import scala.collection.mutable.ListBuffer
object CompletenessHandler {
private def getQuery(group: String, version: String): Option[String] = {
private def getQuery(publisherName: String, group: String, version: String): Option[String] = {
if(publisherName == "marvin")
group match {
case "mappings" => Some(Config.completeness.query.mappings(version))
case "generic" => Some(Config.completeness.query.generic(version))
case "wikidata" => Some(Config.completeness.query.wikidata(version))
case "mappings" => Some(Config.completeness.query.marvin.mappings(version))
case "generic" => Some(Config.completeness.query.marvin.generic(version))
case "wikidata" => Some(Config.completeness.query.marvin.wikidata(version))
case _ => None
}
else if(publisherName == "dbpedia")
group match {
case "mappings" => Some(Config.completeness.query.dbpedia.mappings(version))
case "generic" => Some(Config.completeness.query.dbpedia.generic(version))
case "wikidata" => Some(Config.completeness.query.dbpedia.wikidata(version))
case _ => None
}
else
None
}
def getStatus(group: String, version: String): Option[List[ArtifactStatus]] = {
def getStatus(publisherName: String, group: String, version: String): Option[List[ArtifactStatus]] = {
try {
getQuery(group, version).map(query => {
getQuery(publisherName, group, version).map(query => {
val buffer = new ListBuffer[ArtifactStatus]
val exec = QueryExecutionFactory
.sparqlService("https://databus.dbpedia.org/repo/sparql", query)
......@@ -40,7 +50,7 @@ object CompletenessHandler {
def main(args: Array[String]): Unit = {
getStatus("wikidata", "2020.03.01").foreach(_.foreach(x => println(x.artifact, x.actual, x.expected)))
getStatus("marvin", "wikidata", "2020.03.01").foreach(_.foreach(x => println(x.artifact, x.actual, x.expected)))
}
}
......@@ -6,6 +6,7 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
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">
<link rel="stylesheet" href="stylesheets/style.css">
</head>
......@@ -440,8 +441,8 @@
</section>
<!-- end of logs -->
<!-- completeness -->
<section id="completeness">
<!-- marvin completeness -->
<section id="marvin-completeness">
<div class="container-fluid">
<div class=row>
<div class="col-lg-10 ml-auto">
......@@ -450,24 +451,24 @@
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="mappings-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/mappings/">7: MARVIN Release Completeness</a></h4>
<h4><a id="marvin-mappings-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/mappings/">7: MARVIN Mappings Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="mappings-comp-query" target="_blank">query</a>
<a id="marvin-mappings-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="mappings-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-mappings-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="mappings-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-mappings-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="mappings-completeness-table" data-pagination="true"
<table id="marvin-mappings-completeness-table" data-pagination="false"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
......@@ -481,24 +482,24 @@
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="generic-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/generic/">7: MARVIN Release Completeness</a></h4>
<h4><a id="marvin-generic-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/generic/">7: MARVIN Generic Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="generic-comp-query" target="_blank">query</a>
<a id="marvin-generic-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="generic-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-generic-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="generic-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-generic-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="generic-completeness-table" data-pagination="true"
<table id="marvin-generic-completeness-table" data-pagination="false"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
......@@ -512,24 +513,24 @@
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="wikidata-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/wikidata/">7: MARVIN Release Completeness</a></h4>
<h4><a id="marvin-wikidata-group-link" target="_blank" href="https://databus.dbpedia.org/marvin/wikidata/">7: MARVIN Wikidata Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="wikidata-comp-query" target="_blank">query</a>
<a id="marvin-wikidata-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="wikidata-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-wikidata-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="wikidata-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
<div id="marvin-wikidata-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="wikidata-completeness-table" data-pagination="true"
<table id="marvin-wikidata-completeness-table" data-pagination="false"
data-page-size="4" class="table">
<thead>
<th data-field="state">State</th>
......@@ -546,9 +547,145 @@
</div>
</div>
</section>
<!-- end of completeness -->
</div>
<!-- end of content -->
<!-- end of marvin completeness -->
<!-- parse logs -->
<section id="parsing">
<div class="container-fluid">
<div class=row>
<div class="col-lg-10 ml-auto">
<div class="row px-5 mt-3">
<!-- grid -->
<div class="col-sm-12 p-3">
<div class="card">
<div class="card-body">
<h4>8: Parse Logs</h4>
<ul>
<li><a href="http://dbpedia-mappings.tib.eu/parse-reports/mappings/">Mappings Release</a></li>
<li><a href="http://dbpedia-mappings.tib.eu/parse-reports/generic/">Generic Release</a></li>
<li><a href="http://dbpedia-wikidata.tib.eu/parse-reports/wikidata/">Wikidata Release</a></li>
</ul>
</div>
</div>
</div>
<!-- end of grid -->
</div>
</div>
</div>
</div>
</section>
<!-- end of parse logs -->
<!-- dbpedia completeness -->
<section id="dbpedia-completeness">
<div class="container-fluid">
<div class=row>
<div class="col-lg-10 ml-auto">
<div class="row px-5 mt-3">
<!-- grid -->
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="dbpedia-mappings-group-link" target="_blank" href="https://databus.dbpedia.org/dbpedia/mappings/">9: DBpedia Mappings Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="dbpedia-mappings-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="dbpedia-mappings-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="dbpedia-mappings-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="dbpedia-mappings-completeness-table" data-pagination="false"
data-page-size="4" class="table" data-sortable="true">
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
</div>
</div>
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="dbpedia-generic-group-link" target="_blank" href="https://databus.dbpedia.org/dbpedia/generic/">9: DBpedia Generic Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="dbpedia-generic-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="dbpedia-generic-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="dbpedia-generic-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="dbpedia-generic-completeness-table" data-pagination="false"
data-page-size="4" class="table" data-sortable="true">
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
</div>
</div>
<div class="col-sm-4 p-3">
<div class="card">
<div class="card-body">
<h4><a id="dbpedia-wikidata-group-link" target="_blank" href="https://databus.dbpedia.org/dbpedia/wikidata/">9: DBpedia Wikidata Release Completeness</a></h4>
<span class="text-muted">TODO add State </span>
<p>
<a id="dbpedia-wikidata-comp-query" target="_blank">query</a>
</p>
Artifact
<div class="progress">
<div id="dbpedia-wikidata-completeness-artifacts" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
Files
<div class="progress">
<div id="dbpedia-wikidata-completeness-files" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
0/0
</div>
</div>
<table id="dbpedia-wikidata-completeness-table" data-pagination="false"
data-page-size="4" class="table" data-sortable="true">
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
</div>
</div>
<!-- end of grid -->
</div>
</div>
</div>
</div>
</section>
<!-- end of dbpedia completeness -->
</div>
<!-- end of content -->
<!-- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
......@@ -561,6 +698,7 @@
integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-table@1.16.0/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/bootstrap-table@1.16.0/dist/extensions/multiple-sort/bootstrap-table-multiple-sort.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="js/dashboard.js"></script>
</body>
const api = "http://release-dashboard.dbpedia.org/api/"
//const api = "http://release-dashboard.dbpedia.org/api/"
const api = "http://localhost:8080/api/"
/* anchor scroll offset */
window.addEventListener("hashchange", function () {
......@@ -303,21 +304,30 @@ SELECT ?expected_files ?actual_files ?delta ?artifact {
} GROUP BY ?artifact ?expected_files ?actual_files }
}`.replace('$version',version)
function linkQuery(group, query) {
function linkQuery(publisherName, group, query) {
var encodedQuery = encodeURIComponent(query)
var link = `https://databus.dbpedia.org/yasgui/#query=${encodedQuery}`
$(`#${group}-comp-query`).attr("href", link);
}
linkQuery('mappings',mappingsCompQuery)
linkQuery('generic',genericCompQuery)
linkQuery('wikidata',wikidataCompQuery)
if(publisherName == 'marvin') {
var link = `https://databus.dbpedia.org/yasgui/#query=${encodedQuery}`
$(`#${publisherName}-${group}-comp-query`).attr("href", link);
}
else {
var link = `https://databus.dbpedia.org/yasgui/#query=${encodedQuery}`
$(`#${publisherName}-${group}-comp-query`).attr("href", link);
}
}
linkQuery('marvin','mappings',mappingsCompQuery)
linkQuery('marvin','generic',genericCompQuery)
linkQuery('marvin','wikidata',wikidataCompQuery)
linkQuery('dbpedia','mappings',mappingsCompQuery)
linkQuery('dbpedia','generic',genericCompQuery)
linkQuery('dbpedia','wikidata',wikidataCompQuery)
function checkCompleteness(group, expectedArtifacts) {
function checkCompleteness(publisherName, group, expectedArtifacts) {
var mappingsCompletenessTable = $(`#${group}-completeness-table`)
var mappingsCompletenessTable = $(`#${publisherName}-${group}-completeness-table`)
$.getJSON(api + `release/completeness/${group}/${version}`, function (data) {
$.getJSON(api + `release/completeness/${publisherName}/${group}/${version}`, function (data) {
var expectedFilesTotal = 0
var actualFilesTotal = 0
var actualArtifacts = 0
......@@ -342,7 +352,7 @@ function checkCompleteness(group, expectedArtifacts) {
releaseCompleteness.sort((a, b) => b.missing - a.missing)
mappingsCompletenessTable.bootstrapTable({ 'data': releaseCompleteness })
let progBarArt = $(`#${group}-completeness-artifacts`)
let progBarArt = $(`#${publisherName}-${group}-completeness-artifacts`)
setProgressBar(progBarArt, actualArtifacts, expectedArtifacts)
// progBarArt.html(`${actualArtifacts}/${expectedArtifacts} `)
// let progArt = actualArtifacts * 100 / expectedArtifacts
......@@ -351,7 +361,7 @@ function checkCompleteness(group, expectedArtifacts) {
// else if (progArt < 50) progBarArt.addClass('bg-danger')
// else progBarArt.addClass('bg-warning')
let progBarFil = $(`#${group}-completeness-files`)
let progBarFil = $(`#${publisherName}-${group}-completeness-files`)
setProgressBar(progBarFil, actualFilesTotal, expectedFilesTotal)
// progBarFil.html(`${actualFilesTotal}/${expectedFilesTotal}`)
// let progFil = actualFilesTotal * 100 / expectedFilesTotal
......@@ -376,7 +386,11 @@ function setProgressBar(bar, actual, max) {
}
$(function () {
checkCompleteness('mappings', 6)
checkCompleteness('generic', 20)
checkCompleteness('wikidata', 16)
checkCompleteness('marvin','mappings', 6)
checkCompleteness('marvin','generic', 20)
checkCompleteness('marvin','wikidata', 16)
checkCompleteness('dbpedia','mappings', 6)
checkCompleteness('dbpedia','generic', 20)
checkCompleteness('dbpedia','wikidata', 16)
})
......@@ -12,4 +12,5 @@ class ReleaseDashboardServletTests extends ScalatraFunSuite {
}
}
override def header = {}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment