[Explore | Trunk]: 1. dataProvider.service.ts & project.service.ts & resultLanding.service.ts & searchDataproviders.service.ts & searchOrganizations.service.ts & searchProjects.service.ts & searchResearchResults.service.ts: Removed case sensitivity in parsing relations (rels.rel.to.class). 2. orcid.service.ts: Removed unused imports | Added comment related to KPI metrics calculated by orcid API.

deprecated-master
Konstantina Galouni 3 years ago
parent 3e3379d038
commit aab0341bea

@ -240,7 +240,7 @@ export class DataProviderService {
for(let i=0; i<length; i++) {
mydata = data[5].length!=undefined ? data[5][i] : data[5];
if(mydata.hasOwnProperty("to")) {
if(mydata['to'].class == "isProvidedBy" && mydata['to'].type == "organization") {
if(mydata['to'].class && mydata['to'].class.toLowerCase() == "isprovidedby" && mydata['to'].type == "organization") {
//if(this.dataProviderInfo.organizations == undefined) {
if(this.dataProviderInfo.organizations.length == 0) {
//this.dataProviderInfo.organizations = new Array<{"name": string, "url": string}>();

@ -174,7 +174,7 @@ export class ProjectService {
this.projectInfo.organizations = [];//new Map<string, string>();
if(!Array.isArray(data[2])) {
if(data[2].hasOwnProperty("to") && data[2]['to'].class == "hasParticipant") {
if(data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") {
let acronym: string = "";
let name: string = "";
let id: string = "";
@ -200,7 +200,7 @@ export class ProjectService {
let acronym: string = "";
let name: string = "";
let id: string = "";
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") {
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class && data[2][i]['to'].class.toLowerCase() == "hasparticipant") {
if(data[2][i].hasOwnProperty("legalshortname")) {
acronym = data[2][i].legalshortname;
}

@ -185,22 +185,22 @@ export class ResultLandingService {
for(let i=0; i<length; i++) {
relation = Array.isArray(data[2]) ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
if(relation['to'].class && relation['to'].class.toLowerCase() == "isproducedby") {
this.resultLandingInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.resultLandingInfo.fundedByProjects, relation, provenanceActionVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "isrelatedto") {
let provenanceAction: string = "";
if(provenanceActionVocabulary != null && relation.provenanceaction in provenanceActionVocabulary) {
provenanceAction = provenanceActionVocabulary[relation.provenanceaction];
}
this.resultLandingInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.resultLandingInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "hasamongtopnsimilardocuments") {
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.resultLandingInfo.similarResearchResults, relation);
} else if(relation['to'].class == "hasAuthorInstitution") {
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
} else if(relation['to'].class == "isSupplementedBy") {
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "issupplementedby") {
this.resultLandingInfo.supplementaryResearchResults = this.parsingFunctions.parseSupplementaryResearchResults(this.resultLandingInfo.supplementaryResearchResults, relation);
} else if(relation['to'].class == "isSupplementTo") {
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "issupplementto") {
this.resultLandingInfo.supplementedByResearchResults = this.parsingFunctions.parseSupplementedByResearchResults(this.resultLandingInfo.supplementedByResearchResults, relation);
}
}

@ -4,8 +4,6 @@ import {map} from "rxjs/operators";
import {ResultLandingInfo} from "../utils/entities/resultLandingInfo";
import {CustomOptions} from "../services/servicesUtils/customOptions.class";
import {WorkV3_0} from "./orcidWork";
import {encode, toUnicode} from "punycode";
import {Observable} from "rxjs";
import {properties} from "../../../environments/environment";
import {ConnectHelper} from "../connect/connectHelper";
@ -52,6 +50,7 @@ export class OrcidService {
saveWork(resultLandingInfo: ResultLandingInfo, pids: string) {
let work = WorkV3_0.resultLandingInfoConvert(resultLandingInfo, null);
let portalId: string = ConnectHelper.getCommunityFromDomain(properties.domain);
// if dashboard format changes, check in API the metrics service ("calculateMetrics" method) for orcid KPIs
let dashboard: string = properties.environment + "_" + properties.dashboard + (portalId? "_" + portalId : "");
let result = {
"dashboard": dashboard,
@ -143,4 +142,4 @@ export class OrcidService {
let url: string = properties.orcidAPIURL+"orcid/personal-details";
return this.http.get(url, CustomOptions.registryOptions());
}
}
}

@ -390,7 +390,7 @@ export class SearchDataprovidersService {
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][i] : resData['rels']['rel'];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProvidedBy" && relation['to'].type == "organization") {
if(relation['to'].class && relation['to'].class.toLowerCase() == "isprovidedby" && relation['to'].type == "organization") {
if(getOrganizations) {
let item: {"name":string, "id":string} = {"name": "", "id": ""};
//item['name'] = relation.legalname;

@ -113,7 +113,7 @@ export class SearchOrganizationsService {
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel'];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isParticipant") {
if(relation['to'].class && relation['to'].class.toLowerCase() == "isparticipant") {
if(result['projects'] == undefined) {
result['projects'] = new Array<
{ "id": string, "acronym": string, "title": string,

@ -171,7 +171,7 @@ export class SearchProjectsService {
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel'];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "hasParticipant") {
if(relation['to'].class && relation['to'].class.toLowerCase() == "hasparticipant") {
if(result['organizations'] == undefined) {
result['organizations'] = new Array<
{ "name": string, "id": string}>();

@ -305,7 +305,7 @@ export class SearchResearchResultsService {
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel'];
if (relation.hasOwnProperty("to")) {
if (relation['to'].class == "isProducedBy") {
if (relation['to'].class && relation['to'].class.toLowerCase() == "isproducedby") {
result['projects'] = this.parseProjects(result['projects'], relation);
}
}

Loading…
Cancel
Save