Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE!!! #438

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG targetBranch=development
ARG originBranch=development
ARG defaultBranch=development

ARG build_type=production
ARG mvnOpt="-Dhttps.protocols=TLSv1.2 -DskipTests --quiet -Pmaster"

ARG googleAnalyticsSiteCode=UA-45841517-1

Expand All @@ -32,25 +32,25 @@ WORKDIR $HOME/workspace
RUN ../copy.sh https://github.com/openworm/org.geppetto.model.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\
cd org.geppetto.model &&\
/bin/echo -e "\e[96mMaven install org.geppetto.model\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/openworm/org.geppetto.core.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\
cd org.geppetto.core &&\
/bin/echo -e "\e[96mMaven install org.geppetto.core\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/openworm/org.geppetto.simulation.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\
cd org.geppetto.simulation &&\
/bin/echo -e "\e[96mMaven install org.geppetto.simulation\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/openworm/org.geppetto.datasources.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\
cd org.geppetto.datasources &&\
/bin/echo -e "\e[96mMaven install org.geppetto.datasources\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/VirtualFlyBrain/uk.ac.vfb.geppetto.git "${targetBranch}" "${originBranch}" "${defaultBranch}"
Expand All @@ -60,13 +60,13 @@ RUN export DEBUG=false; if test "$build_type" = "development" ; then export DEBU

RUN cd uk.ac.vfb.geppetto &&\
/bin/echo -e "\e[96mMaven install uk.ac.vfb.geppetto\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/openworm/org.geppetto.model.swc.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\
cd org.geppetto.model.swc &&\
/bin/echo -e "\e[96mMaven install org.geppetto.model.swc\e[0m" &&\
mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\
mvn ${mvnOpt} install &&\
rm -rf src

RUN ../copy.sh https://github.com/openworm/org.geppetto.frontend.git "${targetBranch}" "${originBranch}" "${defaultBranch}"
Expand All @@ -85,6 +85,8 @@ COPY dockerFiles/geppetto.plan $HOME/workspace/org.geppetto/geppetto.plan
COPY dockerFiles/config.json $HOME/workspace/org.geppetto/utilities/source_setup/config.json
COPY dockerFiles/startup.sh /

RUN if [ "${targetBranch}" == "master" ]; then /startup.sh; fi

WORKDIR $HOME
RUN mkdir -p $SERVER_HOME/./repository/usr

Expand Down
8 changes: 4 additions & 4 deletions components/configuration/queryBuilderConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ var sorterColumns = [
column: "score",
order: "DESC"
},
{
column: "name",
order: "ASC"
},
{
column: "images",
order: "DESC"
},
{
column: "name",
order: "ASC"
}
];

module.exports = {
Expand Down
34 changes: 18 additions & 16 deletions components/interface/TreeWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default class TreeWidget extends React.Component {
return { nodes: nodesArray, edges: edgesArray };
}

searchChildren (array, key, target){
searchChildren (array, key, target, label){
// Define Start and End Index
let startIndex = 0;
let endIndex = array.length - 1;
Expand All @@ -222,7 +222,13 @@ export default class TreeWidget extends React.Component {
let middleIndex = Math.floor((startIndex + endIndex) / 2);
// Compare Middle Index with Target for match
if (this.isNumber(array[middleIndex][key]) === this.isNumber(target[key])) {
return middleIndex;
// check for target relationship (label)
if (array[middleIndex].label === label){
return middleIndex;
} else {
// move on if not matching target relationship (label)
startIndex = middleIndex + 1;
}
}
// Search Right Side Of Array
if (this.isNumber(target[key]) > this.isNumber(array[middleIndex][key])) {
Expand All @@ -237,9 +243,9 @@ export default class TreeWidget extends React.Component {
return undefined;
}

findChildren (parent, key, familyList) {
findChildren (parent, key, familyList, label) {
var childrenList = [];
var childKey = this.searchChildren(familyList, key, parent);
var childKey = this.searchChildren(familyList, key, parent, label);
if (childKey !== undefined) {
childrenList.push(childKey);
var i = childKey - 1;
Expand All @@ -257,18 +263,19 @@ export default class TreeWidget extends React.Component {
}

insertChildren (nodes, edges, child) {
var childrenList = this.findChildren({ from: child.id }, "from", edges);
var childrenList = this.findChildren({ from: child.id }, "from", edges, "part of");
// child.images = this.findChildren({ from: child.id }, "from", edges, "INSTANCEOF");
var nodesList = [];
for ( var i = 0; i < childrenList.length; i++) {
nodesList.push(edges[childrenList[i]].to)
}
var uniqNodes = [...new Set(nodesList)];
for ( var j = 0; j < uniqNodes.length; j++) {
var node = nodes[this.findChildren({ id: uniqNodes[j] }, "id", nodes)[0]];
var node = nodes[this.findChildren({ id: uniqNodes[j] }, "id", nodes, "part of")[0]];
child.children.push({
title: node.title,
subtitle: node.instanceId,
description: node.instanceId + " \n- " + node.info,
description: node.info,
instanceId: node.instanceId,
id: node.id,
children: []
Expand All @@ -284,11 +291,12 @@ export default class TreeWidget extends React.Component {
refinedDataTree.push({
title: nodes[i].title,
subtitle: nodes[i].instanceId,
description: "- " + nodes[i].instanceId + " \n- " + nodes[i].info,
description: nodes[i].info,
instanceId: nodes[i].instanceId,
id: nodes[i].id,
isSelected: true,
children: []
children: [],
images: []
});
break;
}
Expand Down Expand Up @@ -341,13 +349,7 @@ export default class TreeWidget extends React.Component {
this.restPost({
"statements": [
{
"statement": "MATCH (root:Class)<-[:INSTANCEOF]-(t:Individual { short_form : '" + instance + "'})"
+ "<-[:depicts]-(tc:Individual)<-[ie:in_register_with]-(c:Individual)-[:depicts]->"
+ "(image:Individual)-[:INSTANCEOF]->(ac:Class) WHERE has(ie.index) WITH root, COLLECT"
+ " (ac.short_form) as tree_nodes, COLLECT (DISTINCT{ image: image.short_form, anat_ind:"
+ " image.short_form, type: ac.short_form}) AS domain_map MATCH p=allShortestPaths((root)"
+ "<-[:SUBCLASSOF|part_of*..]-(anat:Class)) WHERE anat.short_form IN tree_nodes RETURN p,"
+ " domain_map",
"statement": "MATCH (root:Class)<-[:INSTANCEOF]-(t:Individual {short_form:'" + instance + "'})<-[:depicts]-(tc:Individual)<-[ie:in_register_with]-(c:Individual)-[:depicts]->(image:Individual)-[r:INSTANCEOF]->(anat:Class) WHERE has(ie.index) WITH root, anat,r,image MATCH p=allShortestPaths((root)<-[:SUBCLASSOF|part_of*..]-(anat:Class)) RETURN p,r,image",
"resultDataContents": ["graph"]
}
]
Expand Down
2 changes: 1 addition & 1 deletion dockerFiles/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ grep -rls '"useSsl":' $HOME/workspace/org.geppetto.frontend/src/main/webapp | xa
# Frontend final build
cd $HOME/workspace/org.geppetto.frontend
/bin/echo -e "\e[96mMaven install org.geppetto.frontend\e[0m"
mvn -Dhttps.protocols=TLSv1.2 -DcontextPath=org.geppetto.frontend -DuseSsl=false -DskipTests install
mvn ${mvnOpt} -DcontextPath=org.geppetto.frontend -DuseSsl=false install
rm -rf src

# Start a logfile
Expand Down