2017-12-19 13:53:46 +01:00
|
|
|
import {Injectable} from '@angular/core';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {HttpClient} from "@angular/common/http";
|
|
|
|
import {SearchResult} from '../utils/entities/searchResult';
|
2017-12-19 13:53:46 +01:00
|
|
|
import {RefineResultsUtils} from './servicesUtils/refineResults.class';
|
2019-06-03 15:20:36 +02:00
|
|
|
|
|
|
|
|
2019-04-02 17:33:01 +02:00
|
|
|
import {DOI, StringUtils} from '../utils/string-utils.class';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {ParsingFunctions} from '../landingPages/landing-utils/parsingFunctions.class';
|
|
|
|
import {EnvProperties} from '../utils/properties/env-properties';
|
|
|
|
import {map} from "rxjs/operators";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class SearchDatasetsService {
|
|
|
|
private sizeOfDescription: number = 270;
|
|
|
|
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
|
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
constructor(private http: HttpClient ) {}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-11-21 16:28:38 +01:00
|
|
|
searchDatasets (params: string, refineParams:string, page: number, size: number, sortBy: string, refineFields:string[], properties:EnvProperties ):any {
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
let link = properties.searchAPIURLLAst+"datasets";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
let url = link+"?";
|
|
|
|
if(params!= null && params != '' ) {
|
|
|
|
url += params;
|
|
|
|
}
|
|
|
|
if(refineParams!= null && refineParams != '' ) {
|
|
|
|
url += refineParams;
|
|
|
|
}
|
2018-11-21 16:28:38 +01:00
|
|
|
if(sortBy) {
|
|
|
|
url += "&sortBy=" + sortBy;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
url += "&page="+ (page-1) +"&size="+size+"&format=json";
|
|
|
|
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
2017-12-19 13:53:46 +01:00
|
|
|
//.do(res => console.info(res))
|
2019-06-03 15:20:36 +02:00
|
|
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]));
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-02-05 14:14:59 +01:00
|
|
|
searchDatasetById (id: string , properties:EnvProperties):any {
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
let url = properties.searchAPIURLLAst+"datasets/"+id+"?format=json";
|
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
|
|
|
.pipe(map(res => this.parseResults(res, properties)));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number, properties:EnvProperties ):any {
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
let link = properties.searchAPIURLLAst+"datasets";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
let url = link+"?"+"&format=json";
|
|
|
|
if(params!= null && params != '' ) {
|
|
|
|
url += params;
|
|
|
|
}
|
|
|
|
if(refineParams!= null && refineParams != '' ) {
|
|
|
|
url += refineParams;
|
|
|
|
}
|
|
|
|
url += "&page="+(page-1)+"&size="+size;
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
|
|
|
.pipe(map(res => this.parseRefineResults(id, res['refineResults'])))
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties ):any {
|
|
|
|
let link = properties.searchAPIURLLAst+"datasets";
|
2017-12-19 13:53:46 +01:00
|
|
|
let url = link+"?";
|
|
|
|
var doisParams = "";
|
|
|
|
|
|
|
|
for(var i =0 ;i < DOIs.length; i++){
|
|
|
|
doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
|
|
|
|
}
|
|
|
|
if(doisParams.length > 0){
|
|
|
|
url += "&"+doisParams;
|
|
|
|
|
|
|
|
}
|
|
|
|
if(refineParams!= null && refineParams != '' ) {
|
|
|
|
url += refineParams;
|
|
|
|
}
|
|
|
|
url += "&page="+ (page-1) +"&size="+size+"&format=json";
|
|
|
|
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
2017-12-19 13:53:46 +01:00
|
|
|
//.do(res => console.info(res))
|
2019-06-03 15:20:36 +02:00
|
|
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]));
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
}
|
2018-11-23 13:32:28 +01:00
|
|
|
advancedSearchDatasets (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any {
|
2018-02-05 14:14:59 +01:00
|
|
|
let url = properties.searchResourcesAPIURL;
|
2017-12-19 13:53:46 +01:00
|
|
|
var basicQuery = "(oaftype exact result) and (resulttypeid exact dataset) "
|
|
|
|
url += "?query=";
|
|
|
|
if(params!= null && params != '' ) {
|
|
|
|
url +=" ( "+basicQuery+ " ) " +" and (" + params + ")";
|
|
|
|
}else{
|
|
|
|
url +=" ( "+basicQuery+ " ) ";
|
|
|
|
}
|
|
|
|
|
2018-11-23 13:32:28 +01:00
|
|
|
if(sortBy) {
|
|
|
|
let sortOptions = sortBy.split(",");
|
|
|
|
url += "sortBy "+sortOptions[0]+"/sort."+sortOptions[1]+" ";
|
|
|
|
}
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
url += "&page="+(page-1)+"&size="+size;
|
|
|
|
url += "&format=json";
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
2017-12-19 13:53:46 +01:00
|
|
|
//.do(res => console.info(res))
|
2019-06-03 15:20:36 +02:00
|
|
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'], properties)]));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-02-05 14:14:59 +01:00
|
|
|
searchDatasetsForEntity (params: string, page: number, size: number, properties:EnvProperties):any {
|
|
|
|
let link = properties.searchAPIURLLAst;
|
2017-12-19 13:53:46 +01:00
|
|
|
let url = link+params+"/datasets"+"?format=json";
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
|
|
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'], properties)]));
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
searchDatasetsForDataproviders(params: string, page: number, size: number, properties:EnvProperties):any {
|
|
|
|
let link = properties.searchAPIURLLAst;
|
2017-12-19 13:53:46 +01:00
|
|
|
let url = link+params+ "&page="+(page-1)+"&size="+size + "&format=json";
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
|
|
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'], properties)]));
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2019-05-29 14:24:43 +02:00
|
|
|
parseResults(data: any, properties: EnvProperties): SearchResult[] {
|
2017-12-19 13:53:46 +01:00
|
|
|
let results: SearchResult[] = [];
|
|
|
|
|
|
|
|
let length = Array.isArray(data) ? data.length : 1;
|
|
|
|
|
|
|
|
for(let i=0; i<length; i++) {
|
|
|
|
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result'];
|
|
|
|
|
|
|
|
var result: SearchResult = new SearchResult();
|
|
|
|
result.entityType = "dataset";
|
|
|
|
|
2018-06-28 16:52:45 +02:00
|
|
|
result.types = new Array<string>();
|
|
|
|
let types = new Set<string>();
|
|
|
|
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-06-28 16:52:45 +02:00
|
|
|
let instance;
|
|
|
|
for(let i=0; i<length; i++) {
|
|
|
|
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
|
|
|
|
this.parsingFunctions.parseTypes(result.types, types, instance);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(resData['language'] && resData['language'] != null) {
|
|
|
|
result.languages = new Array<string>();
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
if(!Array.isArray(resData['language'])) {
|
|
|
|
if(resData['language'].classname != "Undetermined" && resData['language'].classname) {
|
|
|
|
result.languages.push(resData['language'].classname);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for(let i=0; i<resData['language'].length; i++) {
|
|
|
|
if(resData['language'][i].classname != "Undetermined" && resData['language'][i].classname) {
|
|
|
|
result.languages.push(resData['language'][i].classname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-28 16:52:45 +02:00
|
|
|
if(resData['country'] && resData['country'] != null) {
|
|
|
|
result.countriesForResults = new Array<string>();
|
|
|
|
|
|
|
|
if(!Array.isArray(resData['country'])) {
|
|
|
|
if(resData['country'].classname != "Undetermined" && resData['country'].classname) {
|
|
|
|
result.countriesForResults.push(resData['country'].classname);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for(let i=0; i<resData['country'].length; i++) {
|
|
|
|
if(resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
|
|
|
|
result.countriesForResults.push(resData['country'][i].classname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
|
|
|
|
|
|
|
if(Array.isArray(resData['title'])) {
|
2019-06-03 11:52:26 +02:00
|
|
|
result['title'].name = String(resData['title'][0].content);
|
2017-12-19 13:53:46 +01:00
|
|
|
} else {
|
2019-06-03 11:52:26 +02:00
|
|
|
result['title'].name = String(resData['title'].content);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//result['title'].url = OpenaireProperties.getsearchLinkToDataset();
|
|
|
|
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
|
|
|
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
2018-02-13 15:52:23 +01:00
|
|
|
if(resData['bestaccessright'] && resData['bestaccessright'].hasOwnProperty("classid")) {
|
2017-12-19 13:53:46 +01:00
|
|
|
result['title'].accessMode = resData['bestaccessright'].classid;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(resData['rels'].hasOwnProperty("rel")) {
|
|
|
|
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
|
|
|
|
|
|
|
|
for(let j=0; j<relLength; j++) {
|
|
|
|
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel'];
|
|
|
|
|
|
|
|
if(relation.hasOwnProperty("to")) {
|
|
|
|
/*if(relation['to'].class == "hasAuthor") {
|
|
|
|
if(result['authors'] == undefined) {
|
|
|
|
result['authors'] = new Array<{"name": string, "id": string}>();
|
|
|
|
}
|
|
|
|
|
|
|
|
result['authors'].push({"name": relation.fullname, "id": relation['to'].content});
|
|
|
|
} else */if(relation['to'].class == "isProducedBy") {
|
|
|
|
result['projects'] = this.parseProjects(result['projects'], relation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(resData.hasOwnProperty("creator") && resData['creator'] != null) {
|
|
|
|
if(result['authors'] == undefined) {
|
2019-05-29 14:24:43 +02:00
|
|
|
result['authors'] = new Array<{"fullName": string, "orcid": string}>();
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
let authors = resData['creator'];
|
|
|
|
let length = Array.isArray(authors) ? authors.length : 1;
|
|
|
|
|
|
|
|
for(let i=0; i<length; i++) {
|
|
|
|
let author = Array.isArray(authors) ? authors[i] : authors;
|
2019-05-29 14:24:43 +02:00
|
|
|
if(author) {
|
2019-05-29 15:25:51 +02:00
|
|
|
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
|
2019-05-29 14:24:43 +02:00
|
|
|
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
|
2019-05-29 15:25:51 +02:00
|
|
|
}*/
|
2019-05-29 14:24:43 +02:00
|
|
|
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
result.authors = result.authors.filter(function (item) {
|
2019-05-29 14:24:43 +02:00
|
|
|
return (item != undefined && item.fullName != undefined);
|
2017-12-19 13:53:46 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var date:string = (resData.dateofacceptance)+""; // transform to string in case it is an integer
|
|
|
|
result.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
|
|
|
|
if(!Array.isArray(resData.description)) {
|
2019-05-17 14:10:13 +02:00
|
|
|
result.description = String(resData.description);
|
2017-12-19 13:53:46 +01:00
|
|
|
} else {
|
2019-05-17 14:10:13 +02:00
|
|
|
result.description = String(resData.description[0]);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-06-28 16:52:45 +02:00
|
|
|
if(result.description && result.description.length > this.sizeOfDescription) {
|
2017-12-19 13:53:46 +01:00
|
|
|
result.description = result.description.substring(0, this.sizeOfDescription)+"...";
|
|
|
|
}
|
|
|
|
|
|
|
|
result.embargoEndDate = resData.embargoenddate;
|
|
|
|
|
|
|
|
if(!Array.isArray(resData.publisher)) {
|
|
|
|
result.publisher = resData.publisher;
|
|
|
|
} else {
|
|
|
|
for(let i=0; i<resData.publisher.length; i++) {
|
|
|
|
if(result.publisher != undefined){
|
|
|
|
result.publisher += ', '+resData['publisher'][i];
|
|
|
|
} else {
|
|
|
|
result.publisher = resData['publisher'][i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
results.push(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
|
|
|
|
parseProjects(projects: { "id": string, "acronym": string, "title": string,
|
|
|
|
"funderShortname": string, "funderName": string,
|
|
|
|
"code": string }[], relation: any ) : {
|
|
|
|
"id": string, "acronym": string, "title": string,
|
|
|
|
"funderShortname": string, "funderName": string,
|
|
|
|
"code": string }[] {
|
|
|
|
if(projects == undefined) {
|
|
|
|
projects = new Array<
|
|
|
|
{ "id": string, "acronym": string, "title": string,
|
|
|
|
"funderShortname": string, "funderName": string,
|
|
|
|
"code": string
|
|
|
|
}>();
|
|
|
|
}
|
|
|
|
|
|
|
|
let countProjects = projects.length;
|
|
|
|
|
|
|
|
projects[countProjects] = {
|
|
|
|
"id": "", "acronym": "", "title": "",
|
|
|
|
"funderShortname": "", "funderName": "",
|
|
|
|
"code": ""
|
|
|
|
}
|
|
|
|
|
|
|
|
if(relation.title != 'unidentified') {
|
|
|
|
projects[countProjects]['id'] =
|
|
|
|
/*OpenaireProperties.getsearchLinkToProject() + */relation['to'].content;
|
|
|
|
projects[countProjects]['acronym'] = relation.acronym;
|
|
|
|
projects[countProjects]['title'] = relation.title;
|
|
|
|
projects[countProjects]['code'] = relation.code;
|
|
|
|
} else {
|
|
|
|
projects[countProjects]['id'] = "";
|
|
|
|
projects[countProjects]['acronym'] = "";
|
|
|
|
projects[countProjects]['title'] = "";
|
|
|
|
projects[countProjects]['code'] = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(relation.hasOwnProperty("funding")) {
|
|
|
|
let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1;
|
|
|
|
|
|
|
|
for(let z=0; z<fundingLength; z++) {
|
|
|
|
let fundingData = Array.isArray(relation['funding']) ? relation['funding'][z] : relation['funding'];
|
|
|
|
|
|
|
|
if(fundingData.hasOwnProperty("funder")) {
|
|
|
|
projects[countProjects]['funderShortname'] = fundingData['funder'].shortname;
|
|
|
|
projects[countProjects]['funderName'] = fundingData['funder'].name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return projects;
|
|
|
|
}
|
|
|
|
|
|
|
|
parseRefineResults(id: string, data: any): any {
|
|
|
|
var results:any = [];
|
|
|
|
if(data.hasOwnProperty("resulthostingdatasource")) {
|
|
|
|
let length = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'].length : 1;
|
|
|
|
|
|
|
|
for(let i=0; i<length; i++) {
|
|
|
|
let datasource = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'][i] : data['resulthostingdatasource'];
|
|
|
|
|
|
|
|
let result: {"name": string, "id": string, "count": number} = {"name": "", "id": "", "count": 0};
|
|
|
|
result['name'] = datasource.name;
|
|
|
|
result['id'] = datasource.id.split("||")[0];
|
|
|
|
//result['url'] = OpenaireProperties.getsearchLinkToDataProvider()+result['id'];
|
|
|
|
result['count'] = datasource.count;
|
|
|
|
|
|
|
|
if(result['id'] != id && result['name'] != "Unknown Repository") {
|
|
|
|
results.push(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
numOfDatasets(url: string, properties:EnvProperties):any {
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
2019-06-03 15:20:36 +02:00
|
|
|
//.map(res => <any> res.json())
|
|
|
|
.pipe(map(res => res['total']));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
numOfEntityDatasets(id: string, entity: string, properties:EnvProperties):any {
|
2017-12-19 13:53:46 +01:00
|
|
|
var parameters = "";
|
|
|
|
|
|
|
|
if(entity == "project") {
|
|
|
|
parameters = "projects/"+id+"/datasets/count";
|
2018-08-02 12:02:31 +02:00
|
|
|
} else if(entity == "organization") {
|
|
|
|
parameters = "organizations/"+id+"/datasets/count";
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
let url = properties.searchAPIURLLAst+parameters+"?format=json";
|
|
|
|
return this.numOfDatasets(url, properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2018-11-19 11:15:13 +01:00
|
|
|
numOfSearchDatasets(params: string, properties:EnvProperties, refineParams:string=null):any {
|
2018-02-05 14:14:59 +01:00
|
|
|
let url = properties.searchAPIURLLAst+"datasets/count?format=json";
|
2019-04-02 17:33:01 +02:00
|
|
|
|
|
|
|
if(params.length > 0){
|
|
|
|
var DOIs:string[] = DOI.getDOIsFromString(params);
|
|
|
|
var doisParams = "";
|
|
|
|
|
|
|
|
for(var i =0 ;i < DOIs.length; i++){
|
|
|
|
doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
|
|
|
|
}
|
|
|
|
if(doisParams.length > 0){
|
|
|
|
url += "&"+doisParams;
|
|
|
|
}else{
|
|
|
|
url += "&q=" + StringUtils.URIEncode(params);
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-04-02 17:33:01 +02:00
|
|
|
// if(params != "") {
|
|
|
|
// url += "&q=" + StringUtils.URIEncode(params);
|
|
|
|
// }
|
2018-11-19 11:15:13 +01:00
|
|
|
if(refineParams!= null && refineParams != '' ) {
|
|
|
|
url += refineParams;
|
|
|
|
}
|
2018-02-05 14:14:59 +01:00
|
|
|
return this.numOfDatasets(url, properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|