diff --git a/Change Definitions/ontological/ChangesOntologySchema.n3 b/Change Definitions/ontological/EMBL/ChangesOntologySchema.n3 similarity index 100% rename from Change Definitions/ontological/ChangesOntologySchema.n3 rename to Change Definitions/ontological/EMBL/ChangesOntologySchema.n3 diff --git a/Change Definitions/ontological/EMBL/JSON definitions/Add Definition b/Change Definitions/ontological/EMBL/JSON definitions/Add Definition new file mode 100644 index 0000000..d625b4b --- /dev/null +++ b/Change Definitions/ontological/EMBL/JSON definitions/Add Definition @@ -0,0 +1,22 @@ +{ + "Complex_Change": "Add Definition", + "Priority": 11.0, + "Complex_Change_Parameters": [ + { + "subject": "1:ADD_PROPERTY_INSTANCE:-subject" + }, + { + "definition": "1:ADD_PROPERTY_INSTANCE:-object" + } + ], + "Simple_Changes": [ + { + "Simple_Change": "ADD_PROPERTY_INSTANCE", + "Simple_Change_Uri": "1:ADD_PROPERTY_INSTANCE", + "Is_Optional": false, + "Selection_Filter": "1:ADD_PROPERTY_INSTANCE:-property = ", + "Mapping_Filter": "", + "Join_Filter": "" + } + ] +} \ No newline at end of file diff --git a/Change Definitions/ontological/EMBL/JSON definitions/Add Synonym b/Change Definitions/ontological/EMBL/JSON definitions/Add Synonym new file mode 100644 index 0000000..0cf0030 --- /dev/null +++ b/Change Definitions/ontological/EMBL/JSON definitions/Add Synonym @@ -0,0 +1,22 @@ +{ + "Complex_Change": "Add Synonym", + "Priority": 13.0, + "Complex_Change_Parameters": [ + { + "subject": "1:ADD_PROPERTY_INSTANCE:-subject" + }, + { + "synonym": "1:ADD_PROPERTY_INSTANCE:-object" + } + ], + "Simple_Changes": [ + { + "Simple_Change": "ADD_PROPERTY_INSTANCE", + "Simple_Change_Uri": "1:ADD_PROPERTY_INSTANCE", + "Is_Optional": false, + "Selection_Filter": "1:ADD_PROPERTY_INSTANCE:-property = ", + "Mapping_Filter": "", + "Join_Filter": "" + } + ] +} \ No newline at end of file diff --git a/Change Definitions/ontological/EMBL/JSON definitions/Delete Definition b/Change Definitions/ontological/EMBL/JSON definitions/Delete Definition new file mode 100644 index 0000000..07292aa --- /dev/null +++ b/Change Definitions/ontological/EMBL/JSON definitions/Delete Definition @@ -0,0 +1,22 @@ +{ + "Complex_Change": "Delete Definition", + "Priority": 12.0, + "Complex_Change_Parameters": [ + { + "subject": "1:DELETE_PROPERTY_INSTANCE:-subject" + }, + { + "definition": "1:DELETE_PROPERTY_INSTANCE:-object" + } + ], + "Simple_Changes": [ + { + "Simple_Change": "DELETE_PROPERTY_INSTANCE", + "Simple_Change_Uri": "1:DELETE_PROPERTY_INSTANCE", + "Is_Optional": false, + "Selection_Filter": "1:DELETE_PROPERTY_INSTANCE:-property = ", + "Mapping_Filter": "", + "Join_Filter": "" + } + ] +} \ No newline at end of file diff --git a/Change Definitions/ontological/EMBL/JSON definitions/Delete Synonym b/Change Definitions/ontological/EMBL/JSON definitions/Delete Synonym new file mode 100644 index 0000000..ebbb9e3 --- /dev/null +++ b/Change Definitions/ontological/EMBL/JSON definitions/Delete Synonym @@ -0,0 +1,22 @@ +{ + "Complex_Change": "Delete Synonym", + "Priority": 14.0, + "Complex_Change_Parameters": [ + { + "subject": "1:DELETE_PROPERTY_INSTANCE:-subject" + }, + { + "synonym": "1:DELETE_PROPERTY_INSTANCE:-object" + } + ], + "Simple_Changes": [ + { + "Simple_Change": "DELETE_PROPERTY_INSTANCE", + "Simple_Change_Uri": "1:DELETE_PROPERTY_INSTANCE", + "Is_Optional": false, + "Selection_Filter": "1:DELETE_PROPERTY_INSTANCE:-property = ", + "Mapping_Filter": "", + "Join_Filter": "" + } + ] +} \ No newline at end of file diff --git a/Change Definitions/ontological/EMBL/JSON definitions/Mark as Obsolete b/Change Definitions/ontological/EMBL/JSON definitions/Mark as Obsolete new file mode 100644 index 0000000..abbad12 --- /dev/null +++ b/Change Definitions/ontological/EMBL/JSON definitions/Mark as Obsolete @@ -0,0 +1,30 @@ +{ + "Complex_Change": "Mark as Obsolete", + "Priority": 15.0, + "Complex_Change_Parameters": [ + { + "obs_class": "1:ADD_SUPERCLASS:-subclass" + }, + { + "reason": "2:ADD_PROPERTY_INSTANCE:-object" + } + ], + "Simple_Changes": [ + { + "Simple_Change": "ADD_SUPERCLASS", + "Simple_Change_Uri": "1:ADD_SUPERCLASS", + "Is_Optional": false, + "Selection_Filter": "1:ADD_SUPERCLASS:-superclass = ", + "Mapping_Filter": "", + "Join_Filter": "" + }, + { + "Simple_Change": "ADD_PROPERTY_INSTANCE", + "Simple_Change_Uri": "2:ADD_PROPERTY_INSTANCE", + "Is_Optional": false, + "Selection_Filter": "2:ADD_PROPERTY_INSTANCE:-property = ", + "Mapping_Filter": "", + "Join_Filter": "2:ADD_PROPERTY_INSTANCE:-subject = 1:ADD_SUPERCLASS:-subclass" + } + ] +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index c29aa87..ccaeef1 100644 --- a/pom.xml +++ b/pom.xml @@ -16,21 +16,11 @@ - - com.sun.jersey - jersey-json - 1.3 - com.sun.jersey jersey-server 1.3 - - com.sun.jersey - jersey-client - 1.3 - com.sun.jersey.contribs jersey-multipart diff --git a/src/main/java/clients/TestChangeDetection.java b/src/main/java/clients/TestChangeDetection.java index 10e2380..cd705a6 100644 --- a/src/main/java/clients/TestChangeDetection.java +++ b/src/main/java/clients/TestChangeDetection.java @@ -8,6 +8,8 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import javax.ws.rs.core.MediaType; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; /** * @@ -23,13 +25,14 @@ public static void main(String[] args) { String ip = "139.91.183.48"; ip = "localhost"; WebResource r = c.resource("http://" + ip + ":8181/ForthMaven-1.0/diachron/change_detection"); - String input = "{ \"Old_Version\" : \"" + v1 + "\", " - + "\"New_Version\" : \"" + v2 + "\", " - + "\"Ingest\" : " + ingest + ", " - + "\"Complex_Changes\" : [ ], " - + "\"Associations\" : null" - + "}"; - ClientResponse response = r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, input); + JSONObject input = new JSONObject(); + input.put("Dataset_URI", "http://www.ebi.ac.uk/efo/"); + input.put("Old_Version", v1); + input.put("New_Version", v2); + input.put("Ingest", ingest); + input.put("Complex_Changes", new JSONArray()); + input.put("Associations", null); + ClientResponse response = r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, input.toJSONString()); System.out.println(response.getEntity(String.class)); System.out.println(response.getStatus()); } diff --git a/src/main/java/clients/TestDefineCC.java b/src/main/java/clients/TestDefineCC.java index 558f911..48b5557 100644 --- a/src/main/java/clients/TestDefineCC.java +++ b/src/main/java/clients/TestDefineCC.java @@ -8,6 +8,7 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import javax.ws.rs.core.MediaType; +import org.json.simple.JSONObject; /** * @@ -19,10 +20,11 @@ public static void main(String[] args) { Client c = Client.create(); System.out.println("Testing Define CC Service..."); String ip = "139.91.183.48"; - ip = "localhost"; +// ip = "localhost"; String url = "http://" + ip + ":8181/ForthMaven-1.0/diachron/complex_change"; WebResource r = c.resource(url); - String input = "{ " + + String ccDef = "{ " + "\"Complex_Change\" : \"Mark_as_Obsolete_v2\", " + "\"Priority\" : 1.0, " + "\"Complex_Change_Parameters\": [" @@ -50,7 +52,11 @@ public static void main(String[] args) { + " ]" + "}"; - ClientResponse response = r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, input); + JSONObject input = new JSONObject(); + input.put("Dataset_URI", "http://www.ebi.ac.uk/efo/"); + input.put("CC_Definition", ccDef); + + ClientResponse response = r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, input.toJSONString()); System.out.println(response.getEntity(String.class)); System.out.println(response.getStatus()); System.out.println("-----\n"); diff --git a/src/main/java/clients/TestDeleteCC.java b/src/main/java/clients/TestDeleteCC.java index 582102f..41c5666 100644 --- a/src/main/java/clients/TestDeleteCC.java +++ b/src/main/java/clients/TestDeleteCC.java @@ -7,7 +7,9 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.core.util.MultivaluedMapImpl; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; /** * @@ -21,11 +23,14 @@ public static void main(String[] args) { // test delete cc service System.out.println("Testing Delete Service..."); String ip = "139.91.183.48"; - ip = "localhost"; +// ip = "localhost"; String url = "http://" + ip + ":8181/ForthMaven-1.0/diachron/complex_change"; String ccName = "Mark_as_Obsolete_v2"; + MultivaluedMap params = new MultivaluedMapImpl(); + params.putSingle("name", ccName); + params.putSingle("dataset_uri", "http://www.ebi.ac.uk/efo/"); WebResource r = c.resource(url); - ClientResponse response = r.path(ccName).accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class); + ClientResponse response = r.queryParams(params).accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class); System.out.println(response.getEntity(String.class)); System.out.println(response.getStatus()); System.out.println("-----\n"); diff --git a/src/main/java/clients/TestInfoCC.java b/src/main/java/clients/TestInfoCC.java index de8354d..e2f6f6a 100644 --- a/src/main/java/clients/TestInfoCC.java +++ b/src/main/java/clients/TestInfoCC.java @@ -7,8 +7,9 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.core.util.MultivaluedMapImpl; import javax.ws.rs.core.MediaType; - +import javax.ws.rs.core.MultivaluedMap; /** * * @author rousakis @@ -23,9 +24,13 @@ public static void main(String[] args) { String url = "http://" + ip + "/ForthMaven-1.0/diachron/complex_change"; WebResource r = c.resource(url); String ccName = "Add Synonym"; - ClientResponse response = r.path(ccName).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); + MultivaluedMap params = new MultivaluedMapImpl(); + params.putSingle("name", ccName); + params.putSingle("dataset_uri", "http://www.ebi.ac.uk/efo/"); + ClientResponse response = r.queryParams(params).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); System.out.println(response.getEntity(String.class)); System.out.println(response.getStatus()); System.out.println("-----\n"); + } } diff --git a/src/main/java/clients/TestQuery.java b/src/main/java/clients/TestQuery.java index 43e0e69..07b9cfb 100644 --- a/src/main/java/clients/TestQuery.java +++ b/src/main/java/clients/TestQuery.java @@ -18,7 +18,7 @@ public class TestQuery { public static void main(String[] args) { Client c = Client.create(); String ip = "139.91.183.48:8181"; - ip = "139.91.183.65:8080"; +// ip = "139.91.183.65:8080"; System.out.println("Testing Query Service..."); String query = "select ?sc ?param_name ?param_value ?v1 ?v2 where { " + "?sc a co:Add_Label; " diff --git a/src/main/java/services/change_detection/ChangeDetectionImpl.java b/src/main/java/services/change_detection/ChangeDetectionImpl.java index c8e1e22..5ae1a06 100644 --- a/src/main/java/services/change_detection/ChangeDetectionImpl.java +++ b/src/main/java/services/change_detection/ChangeDetectionImpl.java @@ -4,11 +4,8 @@ */ package services.change_detection; -import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; -import java.util.Properties; -import javax.servlet.ServletContext; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -35,7 +32,6 @@ import org.diachron.detection.repositories.SesameVirtRep; import org.diachron.detection.utils.ChangesDetector; import org.diachron.detection.utils.ChangesManager; -import org.diachron.detection.utils.SCDUtils; import utils.PropertiesManager; import utils.Utils; @@ -61,6 +57,7 @@ public ChangeDetectionImpl() { * @param inputMessage : A JSON-encoded string which has the * following form:
* {
+ * "Dataset_Uri" : "http://dataset",
* "Old_Version" : "v1",
* "New_Version" : "v2",
* "Ingest" : true,
@@ -69,6 +66,9 @@ public ChangeDetectionImpl() { * }
* where *
    + *
  • Dataset_Uri - The URI of the dataset whose versions will be compared. + * If this parameter is missing from the JSON input message, then the URI + * will be taken from the properties file.
    *
  • Old_Version - The old version URI of a DIACHRON entity.
    *
  • New_Version - The old version URI of a DIACHRON entity.
    *
  • Ingest - A flag which denotes whether the service is called due to a @@ -106,12 +106,16 @@ public Response changeDetectJSON(String inputMessage) { JSONParser jsonParser = new JSONParser(); try { JSONObject jsonObject = (JSONObject) jsonParser.parse(inputMessage); - if (jsonObject.size() != 5) { - String message = "JSON input message should have exactly 5 arguments."; + if (jsonObject.size() != 5 && jsonObject.size() != 6) { + String message = "JSON input message should have 5 or 6 arguments."; String json = "{ \"Success\" : false, " + "\"Message\" : \"" + message + "\" }"; return Response.status(400).entity(json).build(); } else { + String datasetUri = (String) jsonObject.get("Dataset_URI"); + if (datasetUri == null) { + datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + } String oldVersion = (String) jsonObject.get("Old_Version"); String newVersion = (String) jsonObject.get("New_Version"); boolean ingest = (Boolean) jsonObject.get("Ingest"); @@ -120,9 +124,7 @@ public Response changeDetectJSON(String inputMessage) { if (oldVersion == null || newVersion == null || ccs == null) { throw new ParseException(-1); } - /// - String datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); - String changesOntologySchema = propertiesManager.getPropertyValue("Changes_Ontology_Schema"); + String changesOntologySchema = Utils.getDatasetSchema(datasetUri); ChangesDetector detector = null; try { ChangesManager cManager = new ChangesManager(propertiesManager.getProperties(), datasetUri, oldVersion, newVersion, false); @@ -135,6 +137,7 @@ public Response changeDetectJSON(String inputMessage) { return Response.status(400).entity(json).build(); } if (ingest) { + detector.detectAssociations(oldVersion, newVersion); detector.detectSimpleChanges(oldVersion, newVersion, null); } String[] cChanges = {}; @@ -185,10 +188,8 @@ public Response changeDetectJSON(String inputMessage) { @Produces(MediaType.APPLICATION_JSON) public Response queryChangesOntologyGet(@QueryParam("query") String query, @QueryParam("format") String format) { - Properties prop = new Properties(); OutputStream output = null; try { -// prop.load(this.getClass().getResourceAsStream(propFile)); String ip = propertiesManager.getPropertyValue("Repository_IP"); String username = propertiesManager.getPropertyValue("Repository_Username"); String password = propertiesManager.getPropertyValue("Repository_Password"); @@ -198,7 +199,6 @@ public Response queryChangesOntologyGet(@QueryParam("query") String query, query = query.replace(" where ", " from <" + changesOntol + "> "); TupleQuery tupleQuery = sesame.getCon().prepareTupleQuery(QueryLanguage.SPARQL, query); output = new OutputStream() { - private StringBuilder string = new StringBuilder(); @Override @@ -292,8 +292,6 @@ public Response queryChangesOntologyPost(String inputMessage) { if (format == null || query == null) { throw new ParseException(-1); } - /// -// prop.load(this.getClass().getResourceAsStream(propFile)); String ip = propertiesManager.getPropertyValue("Repository_IP"); String username = propertiesManager.getPropertyValue("Repository_Username"); String password = propertiesManager.getPropertyValue("Repository_Password"); diff --git a/src/main/java/services/change_detection/ComplexChangeImpl.java b/src/main/java/services/change_detection/ComplexChangeImpl.java index 63dc7fd..4aa4221 100644 --- a/src/main/java/services/change_detection/ComplexChangeImpl.java +++ b/src/main/java/services/change_detection/ComplexChangeImpl.java @@ -4,18 +4,16 @@ */ package services.change_detection; -import java.io.FileInputStream; import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.Properties; -import javax.ws.rs.PathParam; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.diachron.detection.complex_change.CCDefinitionError.CODE; @@ -23,6 +21,8 @@ import org.diachron.detection.repositories.JDBCVirtuosoRep; import org.diachron.detection.utils.JSONMessagesParser; import org.diachron.detection.utils.MCDUtils; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; import utils.PropertiesManager; import utils.Utils; @@ -47,10 +47,12 @@ public ComplexChangeImpl() { * definition of a complex changes. Such information can be the name of the * complex change, the simple changes which compose it, its parameters along * with their corresponding filters etc.
    - * URL: /diachron/complex_change/{com_change} + * URL: /diachron/complex_change?name={name}&dataset_uri={uri} * - * @param com_change Path parameter which refers on the complex - * change name. + * @param name Query parameter which refers on the complex change + * name. + * @param dataset_uri Query parameter which refers on the dataset in + * which the complex change will be searched. * @return A Response instance which has a JSON-encoded entity content. We * discriminate the following cases:
    *
      @@ -86,8 +88,8 @@ public ComplexChangeImpl() { *
    */ @GET - @Path("{com_change}") - public Response getCCJSON(@PathParam("com_change") String name) { + public Response getCCJSON(@QueryParam("name") String name, + @QueryParam("dataset_uri") String datasetUri) { boolean result = false; String message = null; int code = 0; @@ -99,7 +101,9 @@ public Response getCCJSON(@PathParam("com_change") String name) { String json = "{ \"Message\" : \"Exception Occured: " + ex.getMessage() + ", \"Result\" : " + result + " }"; return Response.status(400).entity(json).build(); } - String datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + if (datasetUri == null) { + datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + } String ontologySchema = Utils.getDatasetSchema(datasetUri); String query = "select ?json from <" + ontologySchema + "> where { ?s co:name \"" + name + "\"; co:json ?json. }"; ResultSet res = jdbcRep.executeSparqlQuery(query, false); @@ -128,10 +132,12 @@ public Response getCCJSON(@PathParam("com_change") String name) { * parameter from the ontology of changes. In fact, it deletes all the * correlated triples with the corresponding complex change. This means that * any detected changes of this complex type will be deleted as well.
    - * URL: /diachron/complex_change/{com_change} + * URL: /diachron/complex_change?name={name}&dataset_uri={uri} * - * @param com_change Path parameter which refers on the complex - * change name. + * @param name Query parameter which refers on the complex change + * name. + * @param dataset_uri Query parameter which refers on the dataset in + * which the complex change will be deleted. * @return A Response instance which has a JSON-encoded entity content. We * discriminate the following cases:
    *
      @@ -144,13 +150,15 @@ public Response getCCJSON(@PathParam("com_change") String name) { *
    */ @DELETE - @Path("{com_change}") @Produces(MediaType.APPLICATION_JSON) - public Response deleteCCJSON(@PathParam("com_change") String name) { + public Response deleteCCJSON(@QueryParam("name") String name, + @QueryParam("dataset_uri") String datasetUri) { String message = null; int code; boolean result = false; - String datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + if (datasetUri == null) { + datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + } try { MCDUtils utils = new MCDUtils(propertiesManager.getProperties(), datasetUri, false); result = utils.deleteCC(name); @@ -170,42 +178,6 @@ public Response deleteCCJSON(@PathParam("com_change") String name) { String json = "{ \"Message\" : \"Exception Occured: " + ex.getMessage() + ", \"Result\" : " + result + " }"; return Response.status(400).entity(json).build(); } - -// String tmpUri = datasetUri; -// if (datasetUri.endsWith("/")) { -// tmpUri = datasetUri.substring(0, datasetUri.length() - 1); -// } -// String changesOntologySchema = tmpUri + "/changes/schema"; -// CCManager manager = null; -// try { -// manager = new CCManager(properties, changesOntologySchema); -// } catch (Exception ex) { -// result = false; -// String json = "{ \"Message\" : \"Exception Occured: " + ex.getMessage() + ", \"Result\" : " + result + " }"; -// return Response.status(400).entity(json).build(); -// } -// List ontologies = Utils.getChangesOntologies(datasetUri, manager.getJdbcRep()); -// if (ontologies.isEmpty()) { -// result = manager.deleteComplexChange(changesOntologySchema, name); -// } else { -// for (String ontology : ontologies) { -// boolean tmp = manager.deleteComplexChange(ontology, name); -// if (tmp) { -// result = tmp; -// } -// } -// } -// message = null; -// if (result) { -// code = 200; -// message = "Complex Change was successfully deleted from the ontology of changes."; -// } else { -// code = 204; -// message = "Complex Change was not found in the ontology of changes."; -// } -// String json = "{ \"Message\" : \"" + message + "\", \"Result\" : " + result + " }"; -// manager.terminate(); -// return Response.status(code).entity(json).build(); } /** @@ -216,6 +188,8 @@ public Response deleteCCJSON(@PathParam("com_change") String name) { * @param inputMessage : A JSON-encoded string which represents the * definition of a complex change and has the following form:
    * {
    + * "Dataset_Uri" : "http://dataset",
    + * "CC_Definition", {
    * "Complex_Change": "Mark_as_Obsolete_v2",
    * "Priority": 1,
    * "Complex_Change_Parameters": [
    @@ -241,8 +215,16 @@ public Response deleteCCJSON(@PathParam("com_change") String name) { * }
    * ]
    * }
    + * }
    + * * where *
      + *
    • Dataset_Uri - The URI of the dataset in which the new complex change + * will be defined. If this parameter is missing from the JSON input + * message, then the URI will be taken from the properties file. + *
    • CC_Definition - The JSON definition of the Complex change. It + * consists of the following fields: + *
        *
      • Complex_Change: the name of the complex change. *
      • Priority: its priority which can be any double number. *
      • Complex_Change_Parameters: the parameter names of the complex change @@ -268,7 +250,7 @@ public Response deleteCCJSON(@PathParam("com_change") String name) { * change parameter, c) a simple change parameter. The presence of the * triple is denoted by a flag which takes one of the values; EXISTS_IN_V2, * EXISTS_IN_V1, NOT_EXISTS_IN_V2, NOT_EXISTS_IN_V1 - *
      + *
* @return A Response instance which has a JSON-encoded entity content * depending on the input parameter of the method. We discriminate the * following cases:
@@ -293,11 +275,17 @@ public Response deleteCCJSON(@PathParam("com_change") String name) { @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response defineCCJSON(String inputMessage) { - String datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); - String changesOntologySchema = Utils.getDatasetSchema(datasetUri); - CCManager ccDef = null; + JSONParser jsonParser = new JSONParser(); + CCManager ccDef; try { - ccDef = JSONMessagesParser.createCCDefinition(propertiesManager.getProperties(), inputMessage, changesOntologySchema); + JSONObject jsonObject = (JSONObject) jsonParser.parse(inputMessage); + String datasetUri = (String) jsonObject.get("Dataset_URI"); + if (datasetUri == null) { + datasetUri = propertiesManager.getPropertyValue("Dataset_URI"); + } + String changesOntologySchema = Utils.getDatasetSchema(datasetUri); + String ccJson = (String) jsonObject.get("CC_Definition"); + ccDef = JSONMessagesParser.createCCDefinition(propertiesManager.getProperties(), ccJson, changesOntologySchema); } catch (Exception ex) { boolean result = false; String json = "{ \"Message\" : \"Exception Occured: " + ex.getMessage() + ", \"Result\" : " + result + " }"; diff --git a/target/ForthMaven-1.0.war b/target/ForthMaven-1.0.war deleted file mode 100644 index 308ae71..0000000 Binary files a/target/ForthMaven-1.0.war and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/.netbeans_automatic_build b/target/ForthMaven-1.0/WEB-INF/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000 diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestChangeDetection.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestChangeDetection.class deleted file mode 100644 index 4024fc1..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestChangeDetection.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDefineCC.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDefineCC.class deleted file mode 100644 index 441d95b..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDefineCC.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDeleteCC.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDeleteCC.class deleted file mode 100644 index b9ed918..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestDeleteCC.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestInfoCC.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestInfoCC.class deleted file mode 100644 index f116354..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestInfoCC.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestQuery.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestQuery.class deleted file mode 100644 index 557a0cc..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestQuery.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestRepair.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestRepair.class deleted file mode 100644 index bbb60b7..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestRepair.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestValidation.class b/target/ForthMaven-1.0/WEB-INF/classes/clients/TestValidation.class deleted file mode 100644 index 7e90bec..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/clients/TestValidation.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$1.class b/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$1.class deleted file mode 100644 index f76b667..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$1.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$2.class b/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$2.class deleted file mode 100644 index 55ce9ca..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl$2.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl.class b/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl.class deleted file mode 100644 index 426ee42..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ChangeDetectionImpl.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ComplexChangeImpl.class b/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ComplexChangeImpl.class deleted file mode 100644 index 064c9b5..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/change_detection/ComplexChangeImpl.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/repair/RepairImpl.class b/target/ForthMaven-1.0/WEB-INF/classes/services/repair/RepairImpl.class deleted file mode 100644 index 75f1ca7..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/repair/RepairImpl.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/services/repair/ValidationImpl.class b/target/ForthMaven-1.0/WEB-INF/classes/services/repair/ValidationImpl.class deleted file mode 100644 index fc3b24e..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/services/repair/ValidationImpl.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/classes/utils/Utils.class b/target/ForthMaven-1.0/WEB-INF/classes/utils/Utils.class deleted file mode 100644 index ed8ed15..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/classes/utils/Utils.class and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/activation-1.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/activation-1.1.jar deleted file mode 100644 index 53f82a1..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/activation-1.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/asm-3.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/asm-3.1.jar deleted file mode 100644 index 8217cae..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/asm-3.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/change-detection-1.0.jar b/target/ForthMaven-1.0/WEB-INF/lib/change-detection-1.0.jar deleted file mode 100644 index e787b09..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/change-detection-1.0.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jackson-core-asl-1.1.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/jackson-core-asl-1.1.1.jar deleted file mode 100644 index 935e2b0..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jackson-core-asl-1.1.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jaxb-api-2.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/jaxb-api-2.1.jar deleted file mode 100644 index be3d6dc..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jaxb-api-2.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jaxb-impl-2.1.12.jar b/target/ForthMaven-1.0/WEB-INF/lib/jaxb-impl-2.1.12.jar deleted file mode 100644 index 392e682..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jaxb-impl-2.1.12.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jersey-client-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/jersey-client-1.3.jar deleted file mode 100644 index 2961b0a..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jersey-client-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jersey-core-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/jersey-core-1.3.jar deleted file mode 100644 index 3c9fdec..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jersey-core-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jersey-json-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/jersey-json-1.3.jar deleted file mode 100644 index eb0a0c4..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jersey-json-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jersey-multipart-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/jersey-multipart-1.3.jar deleted file mode 100644 index 252c474..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jersey-multipart-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jersey-server-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/jersey-server-1.3.jar deleted file mode 100644 index f944ed6..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jersey-server-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jettison-1.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/jettison-1.1.jar deleted file mode 100644 index e4e9c8c..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jettison-1.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/json-simple-1.1.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/json-simple-1.1.1.jar deleted file mode 100644 index dfd5856..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/json-simple-1.1.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/jsr311-api-1.1.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/jsr311-api-1.1.1.jar deleted file mode 100644 index ec8bc81..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/jsr311-api-1.1.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/mimepull-1.4.jar b/target/ForthMaven-1.0/WEB-INF/lib/mimepull-1.4.jar deleted file mode 100644 index 647c932..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/mimepull-1.4.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/oauth-client-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/oauth-client-1.3.jar deleted file mode 100644 index 620e153..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/oauth-client-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/oauth-signature-1.3.jar b/target/ForthMaven-1.0/WEB-INF/lib/oauth-signature-1.3.jar deleted file mode 100644 index 4014e0c..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/oauth-signature-1.3.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0-2.jar b/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0-2.jar deleted file mode 100644 index 015169d..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0-2.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0.1.jar b/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0.1.jar deleted file mode 100644 index d9a1665..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/stax-api-1.0.1.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/lib/validation-repair-1.0.jar b/target/ForthMaven-1.0/WEB-INF/lib/validation-repair-1.0.jar deleted file mode 100644 index 207ae8b..0000000 Binary files a/target/ForthMaven-1.0/WEB-INF/lib/validation-repair-1.0.jar and /dev/null differ diff --git a/target/ForthMaven-1.0/WEB-INF/web.xml b/target/ForthMaven-1.0/WEB-INF/web.xml deleted file mode 100644 index 1659408..0000000 --- a/target/ForthMaven-1.0/WEB-INF/web.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - ServletAdaptor - com.sun.jersey.spi.container.servlet.ServletContainer - 1 - - - ServletAdaptor - /diachron/* - - - - 30 - - - diff --git a/target/ForthMaven-1.0/index.jsp b/target/ForthMaven-1.0/index.jsp deleted file mode 100644 index ab292c3..0000000 --- a/target/ForthMaven-1.0/index.jsp +++ /dev/null @@ -1,13 +0,0 @@ -<%@page contentType="text/html" pageEncoding="UTF-8"%> - - - - - - JSP Page - - -

Hello World!

- - diff --git a/target/classes/.netbeans_automatic_build b/target/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000 diff --git a/target/classes/clients/TestChangeDetection.class b/target/classes/clients/TestChangeDetection.class deleted file mode 100644 index 4024fc1..0000000 Binary files a/target/classes/clients/TestChangeDetection.class and /dev/null differ diff --git a/target/classes/clients/TestDefineCC.class b/target/classes/clients/TestDefineCC.class deleted file mode 100644 index 441d95b..0000000 Binary files a/target/classes/clients/TestDefineCC.class and /dev/null differ diff --git a/target/classes/clients/TestDeleteCC.class b/target/classes/clients/TestDeleteCC.class deleted file mode 100644 index b9ed918..0000000 Binary files a/target/classes/clients/TestDeleteCC.class and /dev/null differ diff --git a/target/classes/clients/TestInfoCC.class b/target/classes/clients/TestInfoCC.class deleted file mode 100644 index f116354..0000000 Binary files a/target/classes/clients/TestInfoCC.class and /dev/null differ diff --git a/target/classes/clients/TestQuery.class b/target/classes/clients/TestQuery.class deleted file mode 100644 index 557a0cc..0000000 Binary files a/target/classes/clients/TestQuery.class and /dev/null differ diff --git a/target/classes/clients/TestRepair.class b/target/classes/clients/TestRepair.class deleted file mode 100644 index bbb60b7..0000000 Binary files a/target/classes/clients/TestRepair.class and /dev/null differ diff --git a/target/classes/clients/TestValidation.class b/target/classes/clients/TestValidation.class deleted file mode 100644 index 7e90bec..0000000 Binary files a/target/classes/clients/TestValidation.class and /dev/null differ diff --git a/target/classes/services/change_detection/ChangeDetectionImpl$1.class b/target/classes/services/change_detection/ChangeDetectionImpl$1.class deleted file mode 100644 index 56c5cd7..0000000 Binary files a/target/classes/services/change_detection/ChangeDetectionImpl$1.class and /dev/null differ diff --git a/target/classes/services/change_detection/ChangeDetectionImpl$2.class b/target/classes/services/change_detection/ChangeDetectionImpl$2.class deleted file mode 100644 index b63eacc..0000000 Binary files a/target/classes/services/change_detection/ChangeDetectionImpl$2.class and /dev/null differ diff --git a/target/classes/services/change_detection/ChangeDetectionImpl.class b/target/classes/services/change_detection/ChangeDetectionImpl.class deleted file mode 100644 index 6b05adb..0000000 Binary files a/target/classes/services/change_detection/ChangeDetectionImpl.class and /dev/null differ diff --git a/target/classes/services/change_detection/ComplexChangeImpl.class b/target/classes/services/change_detection/ComplexChangeImpl.class deleted file mode 100644 index 064c9b5..0000000 Binary files a/target/classes/services/change_detection/ComplexChangeImpl.class and /dev/null differ diff --git a/target/classes/services/repair/RepairImpl.class b/target/classes/services/repair/RepairImpl.class deleted file mode 100644 index 75f1ca7..0000000 Binary files a/target/classes/services/repair/RepairImpl.class and /dev/null differ diff --git a/target/classes/services/repair/ValidationImpl.class b/target/classes/services/repair/ValidationImpl.class deleted file mode 100644 index fc3b24e..0000000 Binary files a/target/classes/services/repair/ValidationImpl.class and /dev/null differ diff --git a/target/classes/utils/Utils.class b/target/classes/utils/Utils.class deleted file mode 100644 index ed8ed15..0000000 Binary files a/target/classes/utils/Utils.class and /dev/null differ diff --git a/target/endorsed/javaee-endorsed-api-6.0.jar b/target/endorsed/javaee-endorsed-api-6.0.jar deleted file mode 100644 index 1bdf096..0000000 Binary files a/target/endorsed/javaee-endorsed-api-6.0.jar and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index d3bf546..0000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Tue Aug 25 10:51:07 EEST 2015 -version=1.0 -groupId=forth.ics -artifactId=ForthMaven diff --git a/target/test-classes/.netbeans_automatic_build b/target/test-classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000