private void fetchRdfPrefixAndNamespaceFromPreferences(Workspace workspace) { //get the rdf prefix from the preferences JSONObject prefObject = workspace.getCommandPreferences().getCommandPreferencesJSONObject("PublishRDFCommandPreferences"); this.rdfNamespace = "http://localhost/source/"; this.rdfPrefix = "s"; if(prefObject!=null){ this.rdfPrefix = prefObject.optString("rdfPrefix"); this.rdfNamespace = prefObject.optString("rdfNamespace"); } if(rdfPrefix==null || rdfPrefix.trim().isEmpty()) { this.rdfPrefix = "http://localhost/source/"; } } }
private void fetchRdfPrefixAndNamespaceFromPreferences(Workspace workspace) { //get the rdf prefix from the preferences JSONObject prefObject = workspace.getCommandPreferences().getCommandPreferencesJSONObject("PublishRDFCommandPreferences"); this.rdfNamespace = "http://localhost/source/"; this.rdfPrefix = "s"; if(prefObject!=null){ this.rdfPrefix = prefObject.optString("rdfPrefix"); this.rdfNamespace = prefObject.optString("rdfNamespace"); } if(rdfPrefix==null || rdfPrefix.trim().isEmpty()) { this.rdfPrefix = "http://localhost/source/"; } }
@Override public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) { JSONObject prefObject = vWorkspace.getWorkspace().getCommandPreferences().getCommandPreferencesJSONObject(commandName); JSONObject responseObj = new JSONObject(); try { responseObj.put("commandId", commandId); responseObj.put("updateType", commandName); // Populate the preferences if there are any if(prefObject != null) { responseObj.put("PreferenceValues", prefObject); } pw.print(responseObj.toString()); } catch (JSONException e) { logger.error("Error writing JSON values for the preference update!", e); } }
public R2RMLAlignmentFileSaver(Workspace workspace) { this.workspace = workspace; JSONObject prefObject = workspace.getCommandPreferences().getCommandPreferencesJSONObject( "PublishRDFCommand"+"Preferences"); if (prefObject != null) { if (prefObject.has(PreferencesKeys.rdfNamespace.name())) namespace = prefObject.getString(PreferencesKeys.rdfNamespace.name()); if (prefObject.has(PreferencesKeys.rdfPrefix.name())) prefix = prefObject.getString(PreferencesKeys.rdfPrefix.name()); namespace = ((namespace == null) || (namespace.equals(""))) ? Namespaces.KARMA_DEV : namespace; prefix = ((prefix == null) || (prefix.equals(""))) ? Prefixes.KARMA_DEV : prefix; } else { namespace = Namespaces.KARMA_DEV; prefix = Prefixes.KARMA_DEV; } }
@Override public Command createCommand(HttpServletRequest request, Workspace workspace) { String worksheetId = request.getParameter(Arguments.worksheetId .name()); //get the rdf prefix from the preferences JSONObject prefObject = workspace.getCommandPreferences().getCommandPreferencesJSONObject("PublishRDFCommandPreferences"); String rdfNamespace = "http://localhost/source/"; String rdfPrefix = "s"; if(prefObject!=null){ rdfPrefix = prefObject.optString("rdfPrefix"); } if(rdfPrefix==null || rdfPrefix.trim().isEmpty()) rdfPrefix = "http://localhost/source/"; String nodeId = request.getParameter(Arguments.nodeId.name()); return new PublishRDFCellCommand(getNewId(workspace), Command.NEW_MODEL, worksheetId, nodeId, rdfPrefix,rdfNamespace); }
String prefix = ""; try { JSONObject prefObject = workspace.getCommandPreferences().getCommandPreferencesJSONObject( PublishRDFCommand.class.getSimpleName()+"Preferences"); if (prefObject != null) {
JSONObject pref = workspace.getCommandPreferences().getCommandPreferencesJSONObject("PublishRDFCommandPreferences"); String rdfNamespace = ""; if(pref != null) {