-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic query CLI is now working. An initial betweenness has been imple…
…mented
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
bionetdb-app/src/main/java/org/opencb/bionetdb/app/cli/QueryCommandExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.opencb.bionetdb.app.cli; | ||
|
||
import org.opencb.bionetdb.core.api.NetworkDBAdaptor; | ||
import org.opencb.bionetdb.core.neo4j.Neo4JNetworkDBAdaptor; | ||
import org.opencb.datastore.core.Query; | ||
|
||
/** | ||
* Created by imedina on 28/09/15. | ||
*/ | ||
public class QueryCommandExecutor extends CommandExecutor { | ||
|
||
private CliOptionsParser.QueryCommandOptions queryCommandOptions; | ||
|
||
public QueryCommandExecutor(CliOptionsParser.QueryCommandOptions queryCommandOptions) { | ||
super(queryCommandOptions.commonOptions.logLevel, queryCommandOptions.commonOptions.conf); | ||
|
||
this.queryCommandOptions = queryCommandOptions; | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
|
||
try { | ||
NetworkDBAdaptor networkDBAdaptor = new Neo4JNetworkDBAdaptor(queryCommandOptions.database); | ||
|
||
if (queryCommandOptions.betweenness) { | ||
Query query = new Query("id", queryCommandOptions.id); | ||
query.put("nodeLabel", queryCommandOptions.nodeType); | ||
|
||
networkDBAdaptor.betweenness(query); | ||
} | ||
|
||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
|
||
} | ||
|
||
} |