2020-06-09 15:37:46 +02:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.oa.graph.dump;
|
|
|
|
|
|
|
|
import eu.dnetlib.dhp.utils.ISLookupClientFactory;
|
|
|
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
|
|
|
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2020-06-09 15:39:03 +02:00
|
|
|
public class QueryInformationSystem {
|
2020-06-09 15:37:46 +02:00
|
|
|
private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') " +
|
|
|
|
" where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] " +
|
|
|
|
" return " +
|
|
|
|
"<community> " +
|
|
|
|
"{$x//CONFIGURATION/context/@id}" +
|
|
|
|
"{$x//CONFIGURATION/context/@label}" +
|
|
|
|
"</community>";
|
|
|
|
|
2020-06-09 15:39:03 +02:00
|
|
|
|
|
|
|
|
2020-06-11 10:49:01 +02:00
|
|
|
public List<String> getCommunityMap(final String isLookupUrl)
|
|
|
|
throws ISLookUpException {
|
2020-06-09 15:37:46 +02:00
|
|
|
ISLookUpService isLookUp = ISLookupClientFactory.getLookUpService(isLookupUrl);
|
2020-06-11 10:49:01 +02:00
|
|
|
return isLookUp.quickSearchProfile(XQUERY);
|
2020-06-09 15:37:46 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-06-09 15:39:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-09 15:37:46 +02:00
|
|
|
}
|