Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Explanations and bug-fixing (#45)
Browse files Browse the repository at this point in the history
* Modal and time on workflows

* Version number changed

* Fixed timestamp to date

* List description now is hidden in edit mode

* Updating links

* Version number

* removing unused imports

* Fixed test LOI

* Added message when hypothesis not match tloi

* Added workflow input files and documentation.

* Added explanation for user: and other prefixes

* Version 2.3.2
  • Loading branch information
hvarg authored Jun 25, 2020
1 parent 049bf98 commit cad8afb
Show file tree
Hide file tree
Showing 25 changed files with 367 additions and 156 deletions.
2 changes: 1 addition & 1 deletion portal/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.disk-project</groupId>
<artifactId>disk-project</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,21 @@
display: flex;
justify-content: space-between;
border: 1px solid darkgray;
border-radius: 4px;
padding: 1px 10px;
line-height: 24px;
margin-bottom: 4px;
}
border-radius: 4px;
padding: 1px 10px;
line-height: 24px;
margin-bottom: 4px;
}
.code {
font:12px Monaco,Consolas,"Andale Mono","DejaVu Sans Mono",monospace;
font-weight: bold;
}
</style>
<p:PaperFab ui:field="addicon" icon="add" mini="true" style="--paper-fab-background: var(--paper-blue-200);"
addStyleNames="addicon" title="Add Data" tabindex="0" disabled="true"/>
<div style="padding: 4px 10px; font-size: 14px;">
A list of all the ontologies currently loaded in the system is displayed bellow.
To add a new Ontologies click on the top-right button.
A list of all the ontologies currently loaded in the system is displayed below.
<!-- To add a new Ontologies click on the top-right button.-->
</div>
<div class="ontolist">
<div class="ontoentry">
Expand All @@ -122,7 +126,7 @@
<p:PaperIconButton addStyleNames="linkicon smallicon" style="padding: 0px; height: 20px; width: 20px;" icon="link" />
</a>
</div>
<div class="ontoentry">
<!-- div class="ontoentry">
<span>http://www.w3.org/2002/07/owl#</span>
<a target="_blank" href="http://www.w3.org/2002/07/owl#">
<p:PaperIconButton addStyleNames="linkicon smallicon" style="padding: 0px; height: 20px; width: 20px;" icon="link" />
Expand Down Expand Up @@ -157,18 +161,28 @@
<a target="_blank" href="http://purl.org/dc/elements/1.1/">
<p:PaperIconButton addStyleNames="linkicon smallicon" style="padding: 0px; height: 20px; width: 20px;" icon="link" />
</a>
</div>
</div>
<div style="padding: 4px 10px; font-size: 14px;">
You can also add data directly below:
</div-->
</div>

<l:Loader ui:field="loader" />
<div class="outlined">
<lw:ListWidget ui:field="datalist" styleName="list" />
</div>
<g:HTMLPanel ui:field="form" styleName="padded">
<div class="vertical center-justified layout">
<div class="vertical-section">
<div style="padding: 4px 10px; font-size: 14px;">
<p>
You can also add data directly bellow.
Each line represents one triple <span class="code">subject predicate object</span>.<br/>
To define a new resource use as prefix <span class="code">:</span> in the textbox below,
all resources defined here can be used with the prefix <span class="code">user:</span>.
</p><p>
For example, we can define a named resource in one line with
<span class="code">:example rdfs:label "Example_name"^^xsd:string</span>.<br/>
To reference this resource in a hypothesis we can use <span class="code">user:example</span>.
</p>
</div>
<label class="small-grey">Metadata (Ctrl-Space for suggestions)</label>
<tr:TripleInput ui:field="triples" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import com.google.gwt.core.client.Callback;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
Expand Down Expand Up @@ -64,7 +65,8 @@ public class HypothesisView extends ApplicationSubviewImpl
@UiField PaperFab addicon;
@UiField HTMLPanel matchlist;
@UiField HTMLPanel description;

@UiField DivElement notloi;

@UiField DialogBox dialog;
@UiField HTMLPanel dialogContent;

Expand All @@ -86,7 +88,7 @@ public HypothesisView(Binder binder) {
"green-button query-action");
tree.addDeleteAction();
}

@Override
public void initializeParameters(String userid, String domain,
String[] params, boolean edit,
Expand Down Expand Up @@ -115,8 +117,9 @@ else if(params.length == 2 && params[1].equals("query")) {
this.showHypothesisMatches(params[0]);
}
}

private void clear() {
notloi.removeAttribute("visible");
loader.setVisible(false);
form.setVisible(false);
tree.setVisible(false);
Expand All @@ -125,7 +128,7 @@ private void clear() {
matchlist.setVisible(false);
addmode = false;
}

private void showHypothesisList() {
loader.setVisible(true);
DiskREST.listHypotheses(new Callback<List<TreeItem>, Throwable>() {
Expand Down Expand Up @@ -157,12 +160,12 @@ public void onFailure(Throwable reason) {
}
});
}

private void loadHypothesisTLOITree() {
if(treelist == null || tloilist == null)
return;

loader.setVisible(false);
clear();
addicon.setVisible(true);
tree.setVisible(true);
description.setVisible(true);
Expand Down Expand Up @@ -213,7 +216,7 @@ private void loadHypothesisTLOITree() {
}
tree.setRoot(root);
}

private void showHypothesis(final String id) {
loader.setVisible(true);
Polymer.ready(form.getElement(), new Function<Object, Object>() {
Expand All @@ -237,7 +240,7 @@ public void onFailure(Throwable reason) {
}
});
}

private void showHypothesisMatches(final String id) {
loader.setVisible(true);
DiskREST.queryHypothesis(id,
Expand All @@ -260,6 +263,11 @@ public void onFailure(Throwable reason) {
private void showTriggeredLOIOptions(List<TriggeredLOI> tlois) {
matchlist.clear();

if (tlois.size() == 0) {
notloi.setAttribute("visible", "");
return;
}

for(final TriggeredLOI tloi : tlois) {
final TriggeredLOIViewer tviewer = new TriggeredLOIViewer();
tviewer.initialize(userid, domain);
Expand Down Expand Up @@ -329,7 +337,7 @@ void updateDialogContent (List<WorkflowBindings> workflows) {
}
}
}

void triggerMatchedLOI(final TriggeredLOI tloi) {
DiskREST.addTriggeredLOI(tloi, new Callback<Void, Throwable>() {
@Override
Expand All @@ -345,7 +353,7 @@ public void onSuccess(Void result) {
}
});
}

@UiHandler("addicon")
void onAddIconClicked(ClickEvent event) {
tree.setVisible(false);
Expand All @@ -364,7 +372,7 @@ void onAddIconClicked(ClickEvent event) {

History.newItem(this.getHistoryToken(NameTokens.hypotheses, id), false);
}

@UiHandler("form")
void onHypothesisFormSave(HypothesisSaveEvent event) {
Hypothesis hypothesis = event.getHypothesis();
Expand Down Expand Up @@ -392,14 +400,14 @@ public void onFailure(Throwable reason) {
});
}
}

@UiHandler("tree")
void onTreeItemSelected(TreeItemSelectionEvent event) {
TreeNode node = event.getItem();
String token = this.getHistoryToken(node.getType(), node.getId());
History.newItem(token);
}

@UiHandler("tree")
void onTreeItemAction(TreeItemActionEvent event) {
final TreeNode node = event.getItem();
Expand Down Expand Up @@ -439,7 +447,7 @@ else if(event.getAction().getId().equals("query")) {
History.newItem(token);
}
}

@UiHandler("dialogOkButton")
void onOkButtonClicked(ClickEvent event) {
String var = varList.getSelectedValue();
Expand All @@ -466,7 +474,7 @@ void onOkButtonClicked(ClickEvent event) {
void onCancelButtonClicked(ClickEvent event) {
dialog.hide();
}

private void setHeader(SimplePanel toolbar) {
// Set Toolbar header
toolbar.clear();
Expand All @@ -476,18 +484,20 @@ private void setHeader(SimplePanel toolbar) {
HTML div = new HTML("<nav><div class='layout horizontal center'>"
+ "<iron-icon class='orange' icon='" + icon + "'/></div></nav>");
div.getElement().getChild(0).getChild(0).appendChild(new HTML(title).getElement());

toolbar.add(div);
}

private void setSidebar(SimplePanel sidebar) {
// TODO: Modify sidebar
}

private String getHistoryToken(String type, String id) {
return type+"/" + this.userid+"/"+this.domain + "/" + id;
}

private String getNamespace(String id) {
return Config.getServerURL() + "/"+userid+"/"+domain + "/hypotheses/" + id + "#";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,58 @@
margin-left: 20px;
width: calc(100% - 55px);
}
.aux {
font-size: 14px;
padding: 15px;
display:none;
}
.aux[visible] {
display: block;
}
</style>
<p:PaperFab ui:field="addicon" icon="add" mini="true"
addStyleNames="addicon" title="Add Hypothesis" tabindex="0" />
<g:HTMLPanel ui:field="description">
<div style="padding: 4px 10px; font-size: 14px;">
A list of all the available Hypotheses in the system is displayed bellow.
To add a new hypothesis click on the top-right button.
</div>
<div style="padding: 4px 10px; font-size: 14px; color: #666">
<details>
<summary style="font-weight: bold; font-size: 1.1em;">
A hypothesis is a set of assertions about entities in the problem domain.
</summary>
A hypothesis h consists of:
<ol>
<li>
A hypothesis statement, which is a set of assertions about entities in the domain.
For example, they express assertions such as “The mutant form of Protein ABCD is associated with colon cancer.”
</li>
<li>
A hypothesis qualification (confidence report), which qualifies the veracity of the hypothesis based on the data and the analyses done so far.
A typical qualification is a numeric confidence value.
For example, for the hypothesis statement above we could have a confidence value of 0.7.
Each of the statements of a hypothesis may have a different confidence value.
</li>
<li>
A hypothesis provenance, which is a record of the analyses that were carried out in support of the hypothesis statement.
For example the provenance may include an analysis of mass spectrometry data for 25 patients with colon cancer and 25 healthy controls followed by clustering, cluster metrics and binary hypothesis testing.
</li>
<li>
A hypothesis history, which points to a prior hypothesis h’ that was revised to generate h.
In our example, a prior hypothesis could be “Protein ABCD is associated with cancer.
</li>
</ol>
</details>
<div style="margin-top: 5px;">
A list of all the available Hypotheses in the system is displayed below.
To add a <b>new hypothesis</b> click on the top-right button.
</div>
</div>
</g:HTMLPanel>
<l:Loader ui:field="loader" />
<div ui:field="notloi" class="aux">No Line of Inquiry matches your hypothesis.</div>
<t:TreeWidget ui:field="tree" styleName="tree" />
<h:HypothesisEditor ui:field="form" styleName="padded" />
<g:HTMLPanel ui:field="matchlist" styleName="tree list matchlist" />

<div style="visibility: hidden">
<div style="visibility: collapse">
<g:DialogBox autoHide="true" modal="true" ui:field='dialog'>
<g:caption><b>Edit variable bindings</b></g:caption>
<g:VerticalPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,50 @@
.list paper-item iron-icon.blue {
background-color: transparent;
border: 0px;
}
summary::-webkit-details-marker {
display: none
}
</style>
<p:PaperFab ui:field="addicon" icon="add" mini="true"
addStyleNames="addloiicon" title="Add Line of Inquiry" tabindex="0" />
<g:HTMLPanel ui:field="description">
<div style="padding: 4px 10px; font-size: 14px;">
A list of all the available Lines of Inquiry in the system is displayed bellow.
To add a new Line of Inquery click on the top-right button.
<div style="padding: 4px 10px; font-size: 14px; color: #666">
<details>
<summary style="font-weight: bold; font-size: 1.1em;">
A line of inquiry represents potential analyses that can be pursued to test a type of hypothesis (more).
</summary>
A line of inquiry consists of:
<ol>
<li>
A hypothesis pattern, which represents the type of hypotheses that can be explored with this line of inquiry.
This hypothesis pattern must be expressed in the same language as hypothesis statements, so that they can be matched against a user’s hypothesis.
</li>
<li>
A set of query patterns, representing the kinds of data relevant to testing the hypothesis pattern as a set of templates of queries to a data repository.
Several kinds of data may be relevant, so there may be several query patterns.
</li>
<li>
A set of workflows, which capture data analysis methods that can be applied to the data retrieved by the query patterns in order to test the hypothesis pattern.
</li>
<li>
A set of workflow mappings, indicating how the query patterns and the datasets retrieved should be used to instantiate the workflows above to create execution-ready workflows.
</li>
<li>
A set of meta-workflows, which describe how to aggregate the results of the workflow executions done to analyze the data.
</li>
<li>
A set of meta-workflow mappings, which describe how the results of the workflow executions are to be used to generate bindings for the inputs of the meta-workflows.
</li>
<li>
A set of priorities, which describe the relative importance of running different execution-ready workflows given the hypothesis at hand.
</li>
</ol>
</details>
<div style="margin-top: 5px;">
A list of all the available Lines of Inquiry in the system is displayed below.
To add a <b>new Line of Inquery</b> click on the top-right button.
</div>
</div>
</g:HTMLPanel>
<l:Loader ui:field="loader" />
Expand Down
Loading

0 comments on commit cad8afb

Please sign in to comment.