private String getColumnNameFromInputParams(JSONArray inputParamArr) { String columnName = HistoryJsonUtil.getStringValue("newColumnName", inputParamArr); if ("".equals(columnName)) { JSONArray columnNames = HistoryJsonUtil.getJSONArrayValue("targetHNodeId", inputParamArr); for(int j=0; j<columnNames.length(); j++) { JSONObject columnNameObj = columnNames.getJSONObject(j); columnName =columnNameObj.getString("columnName"); } } return columnName; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String extractionURL = HistoryJsonUtil.getStringValue(Arguments.extractionURL.name(), inputJson); String entitiesToBeExt = HistoryJsonUtil.getStringValue(Arguments.entitiesToBeExt.name(), inputJson); String selectionName = HistoryJsonUtil.getStringValue(Arguments.selectionName.name(), inputJson); ExtractEntitiesCommand cmd = new ExtractEntitiesCommand(getNewId(workspace), model, worksheetId, hNodeId, extractionURL, entitiesToBeExt, selectionName); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String newColumnName = HistoryJsonUtil.getStringValue(Arguments.newColumnName.name(), inputJson); RenameColumnCommand renCommand = new RenameColumnCommand(getNewId(workspace), model, newColumnName, hNodeId, worksheetId); renCommand.setInputParameterJson(inputJson.toString()); return renCommand; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); UnassignSemanticTypeCommand comm = new UnassignSemanticTypeCommand(getNewId(workspace), model, hNodeId, worksheetId); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String properties = HistoryJsonUtil.getStringValue(Arguments.properties.name(), inputJson); SetWorksheetPropertiesCommand cmd = new SetWorksheetPropertiesCommand( getNewId(workspace), model, worksheetId, properties); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String alignmentNodeId = HistoryJsonUtil.getStringValue(Arguments.alignmentNodeId.name(), inputJson); String contextJSON = HistoryJsonUtil.getStringValue(Arguments.contextJSON.name(), inputJson); String contextURL = HistoryJsonUtil.getStringValue(Arguments.contextURL.name(), inputJson); boolean contextFromModel = Boolean.parseBoolean(HistoryJsonUtil.getStringValue(Arguments.contextFromModel.name(), inputJson)); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); ExportJSONCommand comm = new ExportJSONCommand( getNewId(workspace), model, alignmentNodeId, worksheetId, selectionName, contextFromModel, contextJSON, contextURL); comm.setInputParameterJson(inputJson.toString()); return comm; }
public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String delimiter = HistoryJsonUtil.getStringValue(Arguments.delimiter.name(), inputJson); String newColName = HistoryJsonUtil.getStringValue(Arguments.newColName.name(), inputJson); String newHNodeId = null; if(HistoryJsonUtil.valueExits(Arguments.newHNodeId.name(), inputJson)) newHNodeId = HistoryJsonUtil.getStringValue(Arguments.newHNodeId.name(), inputJson); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); Command comm = new SplitValuesCommand(getNewId(workspace), model, worksheetId, hNodeId, delimiter, newColName, newHNodeId, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String alignmentNodeId = HistoryJsonUtil.getStringValue(Arguments.alignmentNodeId.name(), inputJson); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); ExportAvroCommand comm = new ExportAvroCommand( getNewId(workspace), model, alignmentNodeId, worksheetId, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }
public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String delimiter = HistoryJsonUtil.getStringValue(Arguments.delimiter.name(), inputJson); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); SplitByCommaCommand comm = new SplitByCommaCommand(getNewId(workspace), model, worksheetId, hNodeId, delimiter, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { boolean show_rdfs_label_first = false; if(HistoryJsonUtil.valueExits(Arguments.show_rdfs_label_first.name(), inputJson)) show_rdfs_label_first = Boolean.parseBoolean(HistoryJsonUtil.getStringValue(Arguments.show_rdfs_label_first.name(), inputJson)); boolean show_rdfs_id_first = false; if(HistoryJsonUtil.valueExits(Arguments.show_rdfs_id_first.name(), inputJson)) show_rdfs_id_first = Boolean.parseBoolean(HistoryJsonUtil.getStringValue(Arguments.show_rdfs_id_first.name(), inputJson)); UpdateUIConfigurationCommand cmd = new UpdateUIConfigurationCommand(getNewId(workspace), model, show_rdfs_label_first, show_rdfs_id_first); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); String alignmentId = AlignmentManager.Instance().constructAlignmentId( workspace.getId(), worksheetId); String label = HistoryJsonUtil.getStringValue( Arguments.label.name(), inputJson); String id = HistoryJsonUtil.getStringValue( Arguments.id.name(), inputJson); DeleteNodeCommand cmd = new DeleteNodeCommand(getNewId(workspace), model, worksheetId, alignmentId, id, label); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { boolean r2rml_export_superclass = false; if(HistoryJsonUtil.valueExits(Arguments.r2rml_export_superclass.name(), inputJson)) r2rml_export_superclass = Boolean.parseBoolean(HistoryJsonUtil.getStringValue(Arguments.r2rml_export_superclass.name(), inputJson)); UpdateModelConfigurationCommand cmd = new UpdateModelConfigurationCommand(getNewId(workspace), model, r2rml_export_superclass); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException { String edgeId = HistoryJsonUtil.getStringValue(Arguments.edgeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); String alignmentId = AlignmentManager.Instance().constructAlignmentId(workspace.getId(), worksheetId); AddUserLinkToAlignmentCommand comm = new AddUserLinkToAlignmentCommand(getNewId(workspace), model, edgeId, alignmentId, worksheetId); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); return new GetLinkSuggestionsCommand(getNewId(workspace), model, worksheetId, hNodeId, selectionName); }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue(Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); String classUri = null; if(HistoryJsonUtil.valueExits(Arguments.classUri.name(), inputJson)) classUri = HistoryJsonUtil.getStringValue(Arguments.classUri.name(), inputJson); return new GetSemanticSuggestionsCommand(getNewId(workspace), model, worksheetId, hNodeId, classUri, selectionName); }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue( Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); GenerateClusterValuesCommand comm = new GenerateClusterValuesCommand( getNewId(workspace), model, hNodeId, worksheetId, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue( Arguments.hNodeId.name(), inputJson); String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); MergeClusterValuesCommand comm = new MergeClusterValuesCommand( getNewId(workspace), model, hNodeId, worksheetId, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); String alignmentId = AlignmentManager.Instance().constructAlignmentId( workspace.getId(), worksheetId); JSONObject newEdge = HistoryJsonUtil.getJSONObjectWithName( Arguments.edge.name(), inputJson).getJSONObject("value"); AddLinkCommand cmd = new AddLinkCommand( getNewId(workspace), model, worksheetId, alignmentId, newEdge); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); String alignmentId = AlignmentManager.Instance().constructAlignmentId( workspace.getId(), worksheetId); JSONObject edge = HistoryJsonUtil.getJSONObjectWithName( Arguments.edge.name(), inputJson).getJSONObject("value");; DeleteLinkCommand cmd = new DeleteLinkCommand( getNewId(workspace), model, worksheetId, alignmentId, edge); cmd.setInputParameterJson(inputJson.toString()); return cmd; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { String worksheetId = HistoryJsonUtil.getStringValue( Arguments.worksheetId.name(), inputJson); String alignmentId = AlignmentManager.Instance().constructAlignmentId( workspace.getId(), worksheetId); JSONArray initialEdges = HistoryJsonUtil.getJSONArrayValue( Arguments.initialEdges.name(), inputJson); JSONArray newEdges = HistoryJsonUtil.getJSONArrayValue( Arguments.newEdges.name(), inputJson); ChangeInternalNodeLinksCommand cmd = new ChangeInternalNodeLinksCommand( getNewId(workspace), model, worksheetId, alignmentId, initialEdges, newEdges); cmd.setInputParameterJson(inputJson.toString()); return cmd; }