@Override public Command createCommand(JSONArray inputJson, VWorkspace vWorkspace) throws JSONException, KarmaException { String hNodeId = HistoryJsonUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String vWorksheetId = HistoryJsonUtil.getStringValue(Arguments.vWorksheetId.name(), inputJson); String examples = HistoryJsonUtil.getStringValue(Arguments.examples.name(), inputJson); SubmitCleaningCommand comm = new SubmitCleaningCommand(getNewId(vWorkspace), hNodeId, vWorksheetId, examples); 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); METAPROPERTY_NAME prop = METAPROPERTY_NAME.valueOf( HistoryJsonUtil.getStringValue(Arguments.metaPropertyName.name(), inputJson)); String propUri, propId; if (HistoryJsonUtil.valueExits(Arguments.metaPropertyUri.name(), inputJson)) { propUri = HistoryJsonUtil.getStringValue(Arguments.metaPropertyUri.name(), inputJson); propId = HistoryJsonUtil.getStringValue(Arguments.metaPropertyId.name(), inputJson); } else { propUri = HistoryJsonUtil.getStringValue(ArgumentsOld.metaPropertyValue.name(), inputJson); propId = propUri; } boolean train = HistoryJsonUtil.getBooleanValue(Arguments.trainAndShowUpdates.name(), inputJson); String rdfLiteralType = HistoryJsonUtil.getStringValue(Arguments.rdfLiteralType.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); SetMetaPropertyCommand comm = new SetMetaPropertyCommand( getNewId(workspace), model, worksheetId, hNodeId, prop, propUri, propId, train, rdfLiteralType, selectionName); comm.setInputParameterJson(inputJson.toString()); return comm; }