Skip to content
Snippets Groups Projects
Commit f79f7872 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

new implementation of miriam resolver

parent 83ec09a7
No related branches found
No related tags found
1 merge request!773Resolve "move from log4j to log4j2"
......@@ -94,25 +94,6 @@ public final class MiriamConnector extends CachableInterface implements IExterna
} catch (Exception e) {
throw new AnnotationException("Problem with accessing identifiers.org", e);
}
// Document document = XmlParser.getXmlDocumentFromString(page);
// Node uri = XmlParser.getNode("uri", document.getChildNodes());
// return XmlParser.getNodeValue(uri);
// String[] urls = getLink().getLocations(uri);
// if (urls == null) {
// result = null;
// } else if (urls.length > 0) {
// result = urls[0];
// }
// if (result != null) {
// setCacheValue(query, result);
// return result;
// } else {
// logger.warn("Cannot find url for miriam: " + miriamData);
// // if url cannot be found then mark miriam data as invalid for one day
// setCacheValue(query, INVALID_LINK, 1);
// return null;
// }
}
@Override
......
......@@ -313,4 +313,5 @@ public class MiriamConnectorTest extends AnnotationTestFunctions {
throw e;
}
}
}
......@@ -3,6 +3,9 @@ package lcsb.mapviewer.model.map;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.reaction.Reaction;
......@@ -359,8 +362,8 @@ public enum MiriamType {
*/
MESH_2012("MeSH",
"http://www.nlm.nih.gov/mesh/",
new String[] { "urn:miriam:mesh" },
new Class<?>[] { Phenotype.class, Compartment.class, Complex.class }, "MIR:00000560",
new String[] { "urn:miriam:mesh", "urn:miriam:mesh.2012" },
new Class<?>[] { Phenotype.class, Compartment.class, Complex.class }, "MIR:00000560",
new Class<?>[] {},
"mesh",
"D010300"),
......@@ -718,6 +721,7 @@ public enum MiriamType {
"wb",
"WBGene00000001");
private static Logger logger = LogManager.getLogger(MiriamType.class);
/**
* User friendly name.
*/
......@@ -801,8 +805,10 @@ public enum MiriamType {
* @param classes
* {@link #validClass}
*/
MiriamType(String commonName, String dbHomePage, String uri, Class<?>[] classes, String registryIdentifier, Class<?>[] requiredClasses, String namespace, String exampleIdentifier) {
this(commonName, dbHomePage, new String[] { uri }, classes, registryIdentifier, requiredClasses, namespace, exampleIdentifier);
MiriamType(String commonName, String dbHomePage, String uri, Class<?>[] classes, String registryIdentifier,
Class<?>[] requiredClasses, String namespace, String exampleIdentifier) {
this(commonName, dbHomePage, new String[] { uri }, classes, registryIdentifier, requiredClasses, namespace,
exampleIdentifier);
}
/**
......@@ -844,6 +850,7 @@ public enum MiriamType {
}
}
}
logger.warn("Unknown miriam type: " + uri);
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment