Commit b7c2d52b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '341-handling-mesh-identifiers' into 'master'

Resolve "Handling MeSH identifiers"

Closes #341

See merge request !419
parents 149adf66 894b95c0
Pipeline #6545 passed with stage
in 6 minutes and 58 seconds
......@@ -82,17 +82,12 @@ public final class MiriamConnector extends CachableInterface implements IExterna
}
return result;
}
// hard-coded specific treatment for mesh
if (MiriamType.MESH_2012.equals(miriamData.getDataType())) {
result = "http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=" + miriamData.getResource();
} else {
String uri = miriamData.getDataType().getUris().get(0) + ":" + miriamData.getResource();
String[] urls = getLink().getLocations(uri);
if (urls == null) {
result = null;
} else if (urls.length > 0) {
result = urls[0];
}
String uri = miriamData.getDataType().getUris().get(0) + ":" + miriamData.getResource();
String[] urls = getLink().getLocations(uri);
if (urls == null) {
result = null;
} else if (urls.length > 0) {
result = urls[0];
}
if (result != null) {
setCacheValue(query, result);
......
......@@ -728,6 +728,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
public void testGetEmptySuggestedQueryList() throws Exception {
try {
Project project = new Project();
project.setId(-2);
List<String> result = drugBankHTMLParser.getSuggestedQueryList(project, TaxonomyBackend.HUMAN_TAXONOMY);
......
......@@ -22,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.annotation.AnnotationTestFunctions;
import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
import lcsb.mapviewer.annotation.cache.GeneralCacheWithExclusion;
import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
import lcsb.mapviewer.annotation.cache.WebPageDownloader;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
......@@ -66,9 +65,7 @@ public class MiriamConnectorTest extends AnnotationTestFunctions {
try {
MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.MESH_2012, "D004249");
String pageContent = getWebpage(miriamConnector.getUrlString(md));
assertTrue(pageContent.contains("DNA Damage"));
assertNotNull(getWebpage(miriamConnector.getUrlString(md)));
} catch (Exception e) {
e.printStackTrace();
throw e;
......
......@@ -253,9 +253,9 @@ public enum MiriamType {
/**
* MeSH 2012: http://www.nlm.nih.gov/mesh/.
*/
MESH_2012("MeSH 2012", //
MESH_2012("MeSH", //
"http://www.nlm.nih.gov/mesh/", //
new String[] { "urn:miriam:mesh.2012", "urn:miriam:mesh" }, //
new String[] { "urn:miriam:mesh" }, //
new Class<?>[] { Phenotype.class, Compartment.class, Complex.class }, "MIR:00000270"), //
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment