Open jvendetti opened 7 years ago
Looks like the sample code stopped working after this Aug., 2014 commit:
... changed one of the required input parameter names from "terms" to "classes".
On further recent investigation, the exception results not just from a change in parameter names for the /mappings endpoint. The example code is also generating JSON that's not compliant with what the endpoint is expecting. This is an example of the JSON that's currently generated:
{
"creator" : "http://stagedata.bioontology.org/user/vendetti",
"relation" : "http://www.w3.org/2002/07/owl#sameAs",
"source" : "MY_USER",
"source_name" : "MyUsers's Mapping Data",
"comment" : "This mapping creates a same as mapping between melanoma (NCIT) and melanoma (SNOMEDCT)",
"terms" : [ {
"ontology" : "NCIT",
"class" : [ "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C8711" ]
}, {
"ontology" : "SNOMEDCT",
"class" : [ "http://purl.bioontology.org/ontology/SNOMEDCT/372244006" ]
} ]
}
... and this is an example of the JSON structure that the mappings endpoint requires:
{
"creator" : "http://data.bioontology.org/user/vendetti",
"relation" : "http://www.w3.org/2002/07/owl#sameAs",
"source" : "vendetti",
"source_name" : "Jennifer's Test Mapping Data",
"comment" : "Creates a same as mapping between Melanoma (NCIT) and Malignant melanoma (SNOMEDCT)",
"classes" : {
"http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C3224" : "NCIT",
"http://purl.bioontology.org/ontology/SNOMEDCT/2092003":"SNOMEDCT"
}
}
Executing the main method in CreateMapping.java results in the following exception: