Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
b7c2d52b
Commit
b7c2d52b
authored
Sep 24, 2018
by
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
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
annotation/src/main/java/lcsb/mapviewer/annotation/services/MiriamConnector.java
View file @
b7c2d52b
...
...
@@ -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
);
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParserTest.java
View file @
b7c2d52b
...
...
@@ -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
);
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java
View file @
b7c2d52b
...
...
@@ -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
;
...
...
model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java
View file @
b7c2d52b
...
...
@@ -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"
),
//
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment