From b4eb2f9ec21b0cf8b33dcaf139334cf41c88a5cc Mon Sep 17 00:00:00 2001 From: Robert Isele Date: Mon, 23 Mar 2020 17:33:22 +0100 Subject: [PATCH 1/4] Improved CSS --- .../app/views/start.scala.html | 44 ++++++++++--------- .../silk-workbench-core/public/main.css | 9 ++-- .../app/views/learning/activeLearn.scala.html | 41 +++++++++++------ .../public/stylesheets/editor/editor.css | 2 +- .../public/stylesheets/table.css | 5 --- .../app/views/workspace/activities.scala.html | 6 ++- .../views/workspace/dataset/table.scala.html | 38 ++++++++++------ .../app/views/workspace/workspace.scala.html | 10 +++-- 8 files changed, 94 insertions(+), 61 deletions(-) diff --git a/silk-workbench/silk-workbench-core/app/views/start.scala.html b/silk-workbench/silk-workbench-core/app/views/start.scala.html index bf251b9778..7877562143 100644 --- a/silk-workbench/silk-workbench-core/app/views/start.scala.html +++ b/silk-workbench/silk-workbench-core/app/views/start.scala.html @@ -16,27 +16,31 @@ } @content = { -
- - @welcome +
+
+
+ + @welcome +
+ +

+ Your current workspace contains @projects.size project(s). +

+ + + @if(!projects.exists(_.name == exampleName)) { + + } + + +
- -

- Your current workspace contains @projects.size project(s). -

- - - @if(!projects.exists(_.name == exampleName)) { - - } - - } @main(None, "start")(header)(toolbar)(content) \ No newline at end of file diff --git a/silk-workbench/silk-workbench-core/public/main.css b/silk-workbench/silk-workbench-core/public/main.css index 3c66c9d198..3901a5dc85 100644 --- a/silk-workbench/silk-workbench-core/public/main.css +++ b/silk-workbench/silk-workbench-core/public/main.css @@ -147,13 +147,16 @@ div.actions .ui-button-text { margin-left: 3px; } -#content { +main { background: #f7f7f7; +} + +#content { float: left; min-width: 300px; width: calc(100% - 20px); - height: 100%; - padding: 10px 10px; + margin: 10px 10px; + padding: 0; } #help { diff --git a/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html b/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html index da160d1cf7..6631ec0698 100644 --- a/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html +++ b/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html @@ -75,9 +75,20 @@ } @content = { -
-
-
Linkage Rule Candidate
+
+
+ @learnedRuleCard +
+
+ @uncertainLinksCard +
+
+} + +@learnedRuleCard = { +
+
+
Linkage Rule Candidate
@@ -90,16 +101,16 @@
Hide the current Linking Rule Candidate
-
--
+
--
-
+
- @autoReload( - context = context, - contentPath = Learning.rule(context.project.name, context.task.id).url, - activityId = ActiveLearningFactory.pluginId - ) + @autoReload( + context = context, + contentPath = Learning.rule(context.project.name, context.task.id).url, + activityId = ActiveLearningFactory.pluginId + )
+} -
-
-
Uncertain links
+@uncertainLinksCard = { +
+
+
Uncertain links
-
+
diff --git a/silk-workbench/silk-workbench-rules/public/stylesheets/editor/editor.css b/silk-workbench/silk-workbench-rules/public/stylesheets/editor/editor.css index 6fc9b75169..0b3afdb758 100644 --- a/silk-workbench/silk-workbench-rules/public/stylesheets/editor/editor.css +++ b/silk-workbench/silk-workbench-rules/public/stylesheets/editor/editor.css @@ -53,7 +53,7 @@ body{ width: auto; height: 800px; padding: 5px; - overflow: scroll; + overflow: auto; position: relative; background: url("../../img/editor/grid.png") repeat scroll 0 0; border:1px solid #d9d9d9; diff --git a/silk-workbench/silk-workbench-rules/public/stylesheets/table.css b/silk-workbench/silk-workbench-rules/public/stylesheets/table.css index 2dac2bc23d..e0795e8ed6 100644 --- a/silk-workbench/silk-workbench-rules/public/stylesheets/table.css +++ b/silk-workbench/silk-workbench-rules/public/stylesheets/table.css @@ -1,8 +1,3 @@ -body { - color: #656565; - background: #f7f7f7; -} - p { margin-top: 4px; } diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/activities.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/activities.scala.html index 2fde5c39d8..c08b72c011 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/activities.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/activities.scala.html @@ -105,7 +105,11 @@ } @content = { - @workspaceActivities(WorkspaceFactory().workspace) +
+
+ @workspaceActivities(WorkspaceFactory().workspace) +
+
} diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html index 37712a73d4..191614f799 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html @@ -6,27 +6,37 @@ @(context: Context[GenericDatasetSpec], paths: IndexedSeq[UntypedPath], entities: Seq[Entity])(implicit session: play.api.mvc.Session) @header = { + } @toolbar = { } @content = { - - - @for(path <- paths) { - - - @for(entity <- entities) { - - @for(path <- paths) { - +
@path.toString - } -
@entity.evaluate(path) + + + + @for(path <- paths) { + + + + @for(entity <- entities) { + + @for(path <- paths) { + } - - } -
@path.toString + } +
@entity.evaluate(path) + } +
+
} @main(Some(context), titleLabel = context.task.taskLabel())(header)(toolbar)(content) \ No newline at end of file diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/workspace.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/workspace.scala.html index 1b9fcf0c6e..dd5c1e70c8 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/workspace.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/workspace.scala.html @@ -25,9 +25,13 @@ } @content = { -
-
- +
+
+
+
+ +
+
} From 265d3829addbe4ccc724a02cafbb2bf62870942b Mon Sep 17 00:00:00 2001 From: Robert Isele Date: Mon, 23 Mar 2020 18:13:16 +0100 Subject: [PATCH 2/4] Improved dataset tabs --- .../app/views/learning/activeLearn.scala.html | 2 +- .../controllers/workspace/DatasetApi.scala | 5 -- .../workspace/WorkbenchPluginDataset.scala | 7 +- .../workspace/dataset/dataset.scala.html | 25 ------- .../views/workspace/dataset/sparql.scala.html | 70 ++++++++++++------- .../conf/workspace.routes | 1 - 6 files changed, 49 insertions(+), 61 deletions(-) delete mode 100644 silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/dataset.scala.html diff --git a/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html b/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html index 6631ec0698..0c9d3ae784 100644 --- a/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html +++ b/silk-workbench/silk-workbench-rules/app/views/learning/activeLearn.scala.html @@ -88,7 +88,7 @@ @learnedRuleCard = {
-
Linkage Rule Candidate
+
Linkage Rule
diff --git a/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala b/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala index 6e4be30530..aa5fc76e1d 100644 --- a/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala +++ b/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala @@ -103,11 +103,6 @@ class DatasetApi @Inject() () extends InjectedController with ControllerUtilsTra } } - def dataset(project: String, task: String): Action[AnyContent] = RequestUserContextAction { implicit request => implicit userContext => - val context = Context.get[GenericDatasetSpec](project, task, request.path) - Ok(views.html.workspace.dataset.dataset(context)) - } - def table(project: String, task: String, maxEntities: Int): Action[AnyContent] = RequestUserContextAction { implicit request => implicit userContext => val context = Context.get[GenericDatasetSpec](project, task, request.path) val source = context.task.data.source diff --git a/silk-workbench/silk-workbench-workspace/app/org/silkframework/workbench/workspace/WorkbenchPluginDataset.scala b/silk-workbench/silk-workbench-workspace/app/org/silkframework/workbench/workspace/WorkbenchPluginDataset.scala index 19ab6b126d..ab3173dbbe 100644 --- a/silk-workbench/silk-workbench-workspace/app/org/silkframework/workbench/workspace/WorkbenchPluginDataset.scala +++ b/silk-workbench/silk-workbench-workspace/app/org/silkframework/workbench/workspace/WorkbenchPluginDataset.scala @@ -66,14 +66,11 @@ object WorkbenchPluginDataset { override def tabs: Seq[Tab] = { task.data match { case dataset: GenericDatasetSpec => - var tabs = Seq(Tab("Dataset", s"workspace/datasets/$project/$taskId/dataset")) if (dataset.plugin.isInstanceOf[RdfDataset]) { - tabs = tabs :+ Tab("Sparql", s"workspace/datasets/$project/$taskId/sparql") + Seq(Tab("SPARQL", s"workspace/datasets/$project/$taskId/sparql")) } else { - tabs = tabs :+ Tab("Tableview", s"workspace/datasets/$project/$taskId/table") + Seq(Tab("Tableview", s"workspace/datasets/$project/$taskId/table")) } - tabs - case _ => Seq.empty } } } diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/dataset.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/dataset.scala.html deleted file mode 100644 index 012c60b189..0000000000 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/dataset.scala.html +++ /dev/null @@ -1,25 +0,0 @@ -@import org.silkframework.dataset.rdf.RdfDataset -@import org.silkframework.dataset.DatasetSpec.GenericDatasetSpec -@import org.silkframework.workbench.Context - -@(context: Context[GenericDatasetSpec])(implicit session: play.api.mvc.Session) - -@header = { - -} - -@toolbar = { - -} - -@content = { - -@if(context.task.data.plugin.isInstanceOf[RdfDataset]) { - This is an RDF-Dataset that can be queried using the SPARQL query language. -} else { - This is not an RDF-Dataset and thus cannot be queried using SPARQL. -} - -} - -@main(Some(context), titleLabel = context.task.taskLabel())(header)(toolbar)(content) diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html index 43f7269e04..d54e14492d 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html @@ -14,35 +14,57 @@ } @content = { -
- +
+ + +
+
} -LIMIT 20} else {@query} - -
- - - - - - @for(results <- queryResults.toList; - variable <- results.variables) { - - @for(results <- queryResults.toList; bindings <- results.bindings) { - +@resultTable = { +
@variable - } -
+ + + @for(results <- queryResults.toList; + variable <- results.variables) { + + + + @for(results <- queryResults.toList; bindings <- results.bindings) { + @for((variable, node) <- bindings) { - } -
@variable + } +
@node.value - } -
+ } + + } + + +} + +@defaultQuery = {@for((prefix, namespace) <- context.project.config.prefixes.prefixMap) {PREFIX @prefix: <@namespace> +} +SELECT * WHERE { + ?s ?p ?o +} +LIMIT 20 } @main(Some(context), titleLabel = context.task.taskLabel())(header)(toolbar)(content) \ No newline at end of file diff --git a/silk-workbench/silk-workbench-workspace/conf/workspace.routes b/silk-workbench/silk-workbench-workspace/conf/workspace.routes index b79862714d..de2a075f29 100644 --- a/silk-workbench/silk-workbench-workspace/conf/workspace.routes +++ b/silk-workbench/silk-workbench-workspace/conf/workspace.routes @@ -31,7 +31,6 @@ GET /dialogs/editDataset/:project/:task GET /dialogs/editDatasetAutoConfigured/:project/:task/:pluginId controllers.workspace.DatasetApi.datasetDialogAutoConfigured(project, task, pluginId) # Tabs -GET /datasets/:project/:task/dataset controllers.workspace.DatasetApi.dataset(project, task) GET /datasets/:project/:task/table controllers.workspace.DatasetApi.table(project, task, maxEntities: Int ?= 20) GET /datasets/:project/:task/sparql controllers.workspace.DatasetApi.sparql(project, task, query ?= "") GET /datasets/:project/:task/types controllers.workspace.DatasetApi.types(project, task, search) From a72034c4a0c5272a871581e2a99a7bf7d55f84f7 Mon Sep 17 00:00:00 2001 From: Robert Isele Date: Tue, 24 Mar 2020 10:52:49 +0100 Subject: [PATCH 3/4] Dataset route redirects directly to either SPARQL or table view --- .../app/controllers/workspace/DatasetApi.scala | 12 ++++++++++++ .../silk-workbench-workspace/conf/workspace.routes | 1 + 2 files changed, 13 insertions(+) diff --git a/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala b/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala index aa5fc76e1d..159aec6c10 100644 --- a/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala +++ b/silk-workbench/silk-workbench-workspace/app/controllers/workspace/DatasetApi.scala @@ -103,6 +103,18 @@ class DatasetApi @Inject() () extends InjectedController with ControllerUtilsTra } } + def dataset(project: String, task: String): Action[AnyContent] = RequestUserContextAction { implicit request => implicit userContext => + val context = Context.get[GenericDatasetSpec](project, task, request.path) + context.task.data match { + case dataset: GenericDatasetSpec => + if (dataset.plugin.isInstanceOf[RdfDataset]) { + Redirect(routes.DatasetApi.sparql(project, task)) + } else { + Redirect(routes.DatasetApi.table(project, task)) + } + } + } + def table(project: String, task: String, maxEntities: Int): Action[AnyContent] = RequestUserContextAction { implicit request => implicit userContext => val context = Context.get[GenericDatasetSpec](project, task, request.path) val source = context.task.data.source diff --git a/silk-workbench/silk-workbench-workspace/conf/workspace.routes b/silk-workbench/silk-workbench-workspace/conf/workspace.routes index de2a075f29..b79862714d 100644 --- a/silk-workbench/silk-workbench-workspace/conf/workspace.routes +++ b/silk-workbench/silk-workbench-workspace/conf/workspace.routes @@ -31,6 +31,7 @@ GET /dialogs/editDataset/:project/:task GET /dialogs/editDatasetAutoConfigured/:project/:task/:pluginId controllers.workspace.DatasetApi.datasetDialogAutoConfigured(project, task, pluginId) # Tabs +GET /datasets/:project/:task/dataset controllers.workspace.DatasetApi.dataset(project, task) GET /datasets/:project/:task/table controllers.workspace.DatasetApi.table(project, task, maxEntities: Int ?= 20) GET /datasets/:project/:task/sparql controllers.workspace.DatasetApi.sparql(project, task, query ?= "") GET /datasets/:project/:task/types controllers.workspace.DatasetApi.types(project, task, search) From 0d4f4ead9ebf7d0dd3900c9121c41252998edab5 Mon Sep 17 00:00:00 2001 From: Robert Isele Date: Tue, 24 Mar 2020 14:14:03 +0100 Subject: [PATCH 4/4] Fixed dataset tables for long string values --- .../app/views/workspace/dataset/sparql.scala.html | 4 ++-- .../app/views/workspace/dataset/table.scala.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html index d54e14492d..3d258588bf 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/sparql.scala.html @@ -43,7 +43,7 @@ @for(results <- queryResults.toList; variable <- results.variables) { - @variable + @variable } @@ -51,7 +51,7 @@ @for(results <- queryResults.toList; bindings <- results.bindings) { @for((variable, node) <- bindings) { - @node.value + @node.value } } diff --git a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html index 191614f799..279d89386a 100644 --- a/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html +++ b/silk-workbench/silk-workbench-workspace/app/views/workspace/dataset/table.scala.html @@ -23,7 +23,7 @@ @for(path <- paths) { - @path.toString + @path.toString } @@ -31,7 +31,7 @@ @for(entity <- entities) { @for(path <- paths) { - @entity.evaluate(path) + @entity.evaluate(path) } }