Skip to content

Commit

Permalink
Merge branch 'main' into cok-issue-92a-table
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcok committed Feb 6, 2024
2 parents 8724e52 + 6f445d0 commit 3e4766e
Show file tree
Hide file tree
Showing 71 changed files with 1,103 additions and 732 deletions.
4 changes: 2 additions & 2 deletions tools/rack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Versions of dependencies which share the same version -->
<version.javafx>21.0.1</version.javafx>
<version.javafx>21.0.2</version.javafx>
<version.rack>${project.version}</version.rack>
<version.surefire>3.2.5</version.surefire>
<version.tycho>4.0.4</version.tycho>
<version.tycho>4.0.5</version.tycho>
</properties>

<!-- Set all dependency versions in one place -->
Expand Down
2 changes: 1 addition & 1 deletion tools/rack/rack.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Bundle-ClassPath: .,
lib/opencsv.jar,
lib/sparqlGraphLibrary.jar,
lib/viz.js-graphviz-java.jar
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Activator: com.ge.research.rack.Activator
Automatic-Module-Name: rack.plugin
Binary file added tools/rack/rack.plugin/RITE-128.ICO
Binary file not shown.
Binary file added tools/rack/rack.plugin/RITE-128.bmp
Binary file not shown.
Binary file added tools/rack/rack.plugin/RITE-16.bmp
Binary file not shown.
Binary file added tools/rack/rack.plugin/RITE-256.bmp
Binary file not shown.
Binary file added tools/rack/rack.plugin/RITE-32.bmp
Binary file not shown.
10 changes: 7 additions & 3 deletions tools/rack/rack.plugin/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ bin.includes = .,\
lib/sparqlGraphLibrary.jar,\
lib/viz.js-graphviz-java.jar,\
plugin.xml,\
splash.bmp
splash.bmp,\
RITE-16.bmp,\
RITE-32.bmp
src.includes = icons/,\
resources/,\
src/,\
splash.bmp
splash.bmp,\
RITE-16.bmp,\
RITE-32.bmp,\
rack.plugin/icons/
Binary file added tools/rack/rack.plugin/icons/RITE-128.ICO
Binary file not shown.
10 changes: 10 additions & 0 deletions tools/rack/rack.plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -497,5 +497,15 @@
type="java.lang.Object">
</propertyTester>
</extension>
<extension id="com.ge.research.rack.product" name="RITE"
point="org.eclipse.core.runtime.products">
<product name="RITE"
application="org.eclipse.ui.ide.workbench">
</product>
<property name="appName" value="RITE" />
<property name="windowImages"
value="./RITE-16.bmp,./RITE-32.bmp,./RITE-128.bmp,./RITE-256.bmp" />

</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ public static IStatus buildNodegroups(IProgressMonitor monitor) {
return Status.CANCEL_STATUS;
}

String path = /* ProjectUtils.getOverlayProjectPath(); */
RackPreferencePage.getInstanceDataFolder();

String ingestionNodegroupPath = RackPreferencePage.getInstanceDataFolder();

ProjectUtils.createNodegroupFolder(ingestionNodegroupPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.*;
import org.eclipse.swt.widgets.Display;

public class ClearAllHandler extends AbstractHandler {
Expand Down Expand Up @@ -108,7 +107,10 @@ public Object execute(ExecutionEvent event) throws ExecutionException {

return null;

/* try {
/* A computational thread is used, the RackConsole.getConsole().error calls
* have to be changed to ErrorMessageUtil.showError calls.
*
* try {
String consoleViewId = IConsoleConstants.ID_CONSOLE_VIEW;
IConsoleView consoleView =
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.handlers.HandlerUtil;

public class IngestTemplatesHandler extends AbstractHandler {

Expand Down Expand Up @@ -187,7 +185,6 @@ public static void uploadNodegroup(String ingestId, boolean isCore) throws Excep

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.*;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ManifestSelectedPropertyTester extends PropertyTester {
public static final String MY_PROPERTY = "isManifestSelected";

public static IEvaluationService getEvalService(BundleContext ctxt) {
final ServiceReference reference =
final ServiceReference<?> reference =
ctxt.getServiceReference(IEvaluationService.class.getName());
return (IEvaluationService) ctxt.getService(reference);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package com.ge.research.rack;

import com.ge.research.rack.utils.ConnectionUtil;
import com.ge.research.rack.utils.ErrorMessageUtil;
import com.ge.research.rack.utils.RackConsole;
import com.ge.research.rack.utils.RackManifestIngestionBuilderUtil;
import com.ge.research.rack.utils.RackManifestIngestionBuilderUtil.IngestionBuilderException;
Expand Down Expand Up @@ -62,6 +63,7 @@
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.SWT;
Expand Down Expand Up @@ -133,6 +135,7 @@ public Object execute(ExecutionEvent event, boolean shouldUpload, boolean keepZi

if (eventResourcePaths.length != 1) {
RackConsole.getConsole().error(NO_SELECTED_PROJECT);
MessageDialog.openError(null, "Ingestion failed", NO_SELECTED_PROJECT);
RackConsole.getConsole().activate();
return null;
}
Expand All @@ -145,13 +148,15 @@ public Object execute(ExecutionEvent event, boolean shouldUpload, boolean keepZi

if (selectedProject.isEmpty()) {
RackConsole.getConsole().error(NO_SELECTED_PROJECT);
MessageDialog.openError(null, "Ingestion failed", NO_SELECTED_PROJECT);
RackConsole.getConsole().activate();
}

try {

if (shouldUpload && !startRun()) {
RackConsole.getConsole().error(UPLOAD_DEBOUNCED);
MessageDialog.openError(null, "Ingestion failed", UPLOAD_DEBOUNCED);
RackConsole.getConsole().activate();
return null;
}
Expand Down Expand Up @@ -266,22 +271,20 @@ private void addChangeListeners(final Runnable asyncCallback) {
@Override
public void done(IJobChangeEvent event) {
if (event.getResult() != Status.OK_STATUS) {
RackConsole.getConsole()
.error(
String.format(
upload ? UPLOAD_FAILED : CREATION_FAILED,
ingestionPackageZipFilepath));
ErrorMessageUtil.error(
String.format(
upload ? UPLOAD_FAILED : CREATION_FAILED,
ingestionPackageZipFilepath));
}
asyncCallback.run();
}

@Override
public void scheduled(IJobChangeEvent event) {
RackConsole.getConsole()
.print(
String.format(
upload ? UPLOAD_QUEUED : CREATION_QUEUED,
ingestionPackageZipFilepath));
ErrorMessageUtil.print(
String.format(
upload ? UPLOAD_QUEUED : CREATION_QUEUED,
ingestionPackageZipFilepath));
}
};

Expand Down Expand Up @@ -309,7 +312,7 @@ protected IStatus run(IProgressMonitor monitor) {
}

} catch (final Exception e) {
RackConsole.getConsole().error(e.getMessage());
ErrorMessageUtil.error(e.getMessage());
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
Expand All @@ -325,8 +328,7 @@ private static Path zipIt(Path folder, Path zipFilepath)
try (FileOutputStream fos = new FileOutputStream(zipFilepath.toFile());
ZipOutputStream zipStream = new ZipOutputStream(fos)) {

RackConsole.getConsole()
.print(String.format(GENERATING_PROJECT, zipFilepath.toString()));
ErrorMessageUtil.error(String.format(GENERATING_PROJECT, zipFilepath.toString()));

new RackManifestIngestionBuilderUtil().zipManifestResources(folder, zipStream);
}
Expand Down Expand Up @@ -365,9 +367,9 @@ private static void uploadIngestionZip(Path zipFilepath, IProgressMonitor monito
return;
}
if (semTkOutputLine.contains(ERROR_LINE)) {
RackConsole.getConsole().errorEcho(semTkOutputLine);
ErrorMessageUtil.errorEcho(semTkOutputLine);
} else {
RackConsole.getConsole().printEcho(semTkOutputLine);
ErrorMessageUtil.printEcho(semTkOutputLine);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package com.ge.research.rack;

import com.ge.research.rack.report.utils.RackQueryUtils;
import com.ge.research.rack.utils.ErrorMessageUtil;
import com.ge.research.rack.utils.RackConsole;
import java.io.File;
import java.util.List;
Expand Down Expand Up @@ -202,16 +203,16 @@ public NodegroupsUploadJob(
@Override
public void done(IJobChangeEvent event) {
if (event.getResult() != Status.OK_STATUS) {
RackConsole.getConsole()
.error(String.format(UPLOAD_FAILED, nodegroupFilepaths));
ErrorMessageUtil.error(
String.format(UPLOAD_FAILED, nodegroupFilepaths));
}
asyncCallback.run();
}

@Override
public void scheduled(IJobChangeEvent event) {
RackConsole.getConsole()
.println(String.format(UPLOAD_QUEUED, nodegroupFilepaths));
ErrorMessageUtil.println(
String.format(UPLOAD_QUEUED, nodegroupFilepaths));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,27 +198,27 @@ public void setDependencyList(List<InstanceData> dependencyList) {
*
* @author Saswata Paul
*/
public class TreeItemAndBoolean {
public class TreeItemAndBoolean<T> {

TreeItem treeItem;
TreeItem<T> treeItem;
Boolean expandFlag;

public TreeItemAndBoolean(TreeItem treeItem, Boolean expandFlag) {
public TreeItemAndBoolean(TreeItem<T> treeItem, Boolean expandFlag) {
this.treeItem = treeItem;
this.expandFlag = expandFlag;
}

/**
* @return the treeItem
*/
public TreeItem getTreeItem() {
public TreeItem<T> getTreeItem() {
return treeItem;
}

/**
* @param treeItem the treeItem to set
*/
public void setTreeItem(TreeItem treeItem) {
public void setTreeItem(TreeItem<T> treeItem) {
this.treeItem = treeItem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class CustomStringUtils {
* @return
*/
public static String getGsnOutDir(String instanceFilePath) {
String dirPath = "";
// String dirPath = "";

// get the instance folder path
String instDir = CustomFileUtils.getFileDirectory(instanceFilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
package com.ge.research.rack.autoGsn.utils;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
Expand Down Expand Up @@ -69,12 +68,12 @@ public static String getUriPrefix(JSONObject ontInfo, String key) {
public static List<String> getPropertyRangeURIs(
JSONObject ontInfo, String classId, String propId) {
// Create a list of strings to store values
List rangeUris = new ArrayList<String>();
List<String> rangeUris = new ArrayList<String>();

System.out.println("Finding range of " + classId + " | " + propId);

JSONArray classPropertyRangeList = (JSONArray) ontInfo.get("classPropertyRangeList");
Iterator classPropertyRangeListIter = classPropertyRangeList.iterator();
var classPropertyRangeListIter = classPropertyRangeList.iterator();

// Flag to check if propertyUri has been added as first element
Boolean addedPropUriFlag = false;
Expand All @@ -87,8 +86,8 @@ public static List<String> getPropertyRangeURIs(
String rowRangeInfo = classPropertyRange.get(2).toString();

String rowClassId = rowClassInfo.split("\\:")[1];
String rowClassUri =
getUriPrefix(ontInfo, rowClassInfo.split("\\:")[0]) + "#" + rowClassId;
// String rowClassUri =
// getUriPrefix(ontInfo, rowClassInfo.split("\\:")[0]) + "#" + rowClassId;
String rowPropId = rowPropInfo.split("\\:")[1];
String rowPropUri =
getUriPrefix(ontInfo, rowPropInfo.split("\\:")[0]) + "#" + rowPropId;
Expand Down Expand Up @@ -146,7 +145,7 @@ public static String getClassURI(JSONObject ontInfo, String classId) {
System.out.println("Finding URI of class " + classId);

JSONArray subClassSuperClassList = (JSONArray) ontInfo.get("subClassSuperClassList");
Iterator subClassSuperClassListIter = subClassSuperClassList.iterator();
var subClassSuperClassListIter = subClassSuperClassList.iterator();

while (subClassSuperClassListIter.hasNext()) {
JSONArray subSuperPair = (JSONArray) subClassSuperClassListIter.next();
Expand Down Expand Up @@ -183,7 +182,7 @@ public static String getSuperClassId(JSONObject ontInfo, String classId) {
System.out.println("Finding Superclass of class " + classId);

JSONArray subClassSuperClassList = (JSONArray) ontInfo.get("subClassSuperClassList");
Iterator subClassSuperClassListIter = subClassSuperClassList.iterator();
var subClassSuperClassListIter = subClassSuperClassList.iterator();

while (subClassSuperClassListIter.hasNext()) {
JSONArray subSuperPair = (JSONArray) subClassSuperClassListIter.next();
Expand Down Expand Up @@ -219,7 +218,7 @@ public static Boolean isForwardProperty(
JSONObject ontInfo, String classAId, String propId, String classBId) {

JSONArray classPropertyRangeList = (JSONArray) ontInfo.get("classPropertyRangeList");
Iterator classPropertyRangeListIter = classPropertyRangeList.iterator();
var classPropertyRangeListIter = classPropertyRangeList.iterator();

/**
* Note: Since class can be from overlays, the JSON ontology information can have the Class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static String binaryConnectionQuery(
String targetClassUri = OntologyJsonObjUtils.getClassURI(ontInfo, targetClassId);
String sourceClassUri = OntologyJsonObjUtils.getClassURI(ontInfo, sourceClassId);

List propertyInfo =
List<String> propertyInfo =
OntologyJsonObjUtils.getPropertyRangeURIs(ontInfo, sourceClassId, propertyId);

String propertyUri =
Expand Down Expand Up @@ -187,7 +187,7 @@ public static String binaryConnectionQueryWithDesc(
String targetClassUri = OntologyJsonObjUtils.getClassURI(ontInfo, targetClassId);
String sourceClassUri = OntologyJsonObjUtils.getClassURI(ontInfo, sourceClassId);

List propertyInfo =
List<String> propertyInfo =
OntologyJsonObjUtils.getPropertyRangeURIs(ontInfo, sourceClassId, propertyId);

String propertyUri =
Expand Down
Loading

0 comments on commit 3e4766e

Please sign in to comment.