1. #3662: For 'Similar Research Results' use 'similarity' field instead of 'trust' used in 'Related Research Results' (publication, dataset, software landing).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52103 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-05-18 15:56:15 +00:00
parent 16406f04d4
commit acdb1cc6c7
8 changed files with 36 additions and 36 deletions

View File

@ -156,7 +156,7 @@
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -166,7 +166,7 @@
No similar research results available No similar research results available
</div> </div>
<div *ngIf="datasetInfo.similarResearchResults"> <div *ngIf="datasetInfo.similarResearchResults">
<tabTable [info]="datasetInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults" [(properties)]=properties></tabTable>
</div> </div>
</div> </div>
<div *ngIf="activeTab=='Metrics'" class="uk-animation-fade"> <div *ngIf="activeTab=='Metrics'" class="uk-animation-fade">

View File

@ -347,43 +347,42 @@ export class ParsingFunctions {
return false; return false;
} }
// publication & dataset landing : for relatedResearchResults // publication & dataset & software landing : for relatedResearchResults
parseRelatedResearchResults(relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, parseRelatedResearchResults(relatedResearchResults: Map<string, { "name": string, "id": string, "date": string,
"trust": number, "class": string}[]>, relation: any, provenanceAction: string) : "percentage": number, "class": string}[]>, relation: any, provenanceAction: string) :
Map<string, { "name": string, "id": string, "date": string, Map<string, { "name": string, "id": string, "date": string,
"trust": number, "class": string}[]> { "percentage": number, "class": string}[]> {
if(relatedResearchResults == undefined) { if(relatedResearchResults == undefined) {
relatedResearchResults = new Map<string, {"name": string, "id": string, "date": string, relatedResearchResults = new Map<string, {"name": string, "id": string, "date": string,
"trust": number, "class": string }[]>(); "percentage": number, "class": string }[]>();
} }
if(!relatedResearchResults.has(provenanceAction)) { if(!relatedResearchResults.has(provenanceAction)) {
relatedResearchResults.set(provenanceAction, relatedResearchResults.set(provenanceAction,
new Array<{ "name": string, "id": string, "date": string, new Array<{ "name": string, "id": string, "date": string,
"trust": number, "class": string }>()); "percentage": number, "class": string }>());
} }
relatedResearchResults.get(provenanceAction).push(this.parseRelatedOrSimilarResearchResult(relation)); relatedResearchResults.get(provenanceAction).push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
return relatedResearchResults; return relatedResearchResults;
} }
// publication & dataset landing : for similarResearchResults // publication & dataset & software landing : for similarResearchResults
parseSimilarResearchResults(similarResearchResults: { "name": string, "id": string, "date": string, parseSimilarResearchResults(similarResearchResults: { "name": string, "id": string, "date": string,
"trust": number, "class": string}[], relation: any) : "percentage": number, "class": string}[], relation: any) :
{ "name": string, "id": string, "date": string, "trust": number, "class": string }[] { { "name": string, "id": string, "date": string, "percentage": number, "class": string }[] {
if(similarResearchResults == undefined) { if(similarResearchResults == undefined) {
similarResearchResults = new Array<{"name": string, "id": string, "date": string, similarResearchResults = new Array<{"name": string, "id": string, "date": string,
"trust": number, "class": string}>(); "percentage": number, "class": string}>();
} }
similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation)); similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "similarity"));
return similarResearchResults; return similarResearchResults;
} }
// publication & dataset landing : for relatedResearchResults and similarResearchResults // publication & dataset & software landing : for relatedResearchResults and similarResearchResults
parseRelatedOrSimilarResearchResult(relation: any): {"name": string, "id": string, "date": string, "trust": number, "class": string} { parseRelatedOrSimilarResearchResult(relation: any, percentageName: string): {"name": string, "id": string, "date": string, "percentage": number, "class": string} {
let researchResult: {"name": string, "id": string, "date": string, "trust": number, "class": string} let researchResult: {"name": string, "id": string, "date": string, "percentage": number, "class": string}
= {"name": "", "id": "", "date": "", "trust": null, "class": ""} = {"name": "", "id": "", "date": "", "percentage": null, "class": ""}
if(relation['resulttype'].classname == "publication") { if(relation['resulttype'].classname == "publication") {
researchResult['class'] = "publication"; researchResult['class'] = "publication";
} else if(relation['resulttype'].classname == "dataset") { } else if(relation['resulttype'].classname == "dataset") {
@ -398,7 +397,7 @@ export class ParsingFunctions {
var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date; researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
//researchResult['date'] = relation.dateofacceptance.substring(0,4);; //researchResult['date'] = relation.dateofacceptance.substring(0,4);;
researchResult['trust'] = Math.round(relation.trust*100); researchResult['percentage'] = Math.round(relation[percentageName]*100);
return researchResult; return researchResult;
} }

View File

@ -15,7 +15,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
<!--thead> <!--thead>
<tr> <tr>
<th>Title</th> <th>Title</th>
<th width="20%">Trust</th> <th width="20%">{{percentageName}}</th>
</tr> </tr>
</thead--> </thead-->
<tbody> <tbody>
@ -54,12 +54,12 @@ import{EnvProperties} from '../../utils/properties/env-properties';
</span> </span>
</td> </td>
<td> <td>
<div *ngIf="item['trust'] != ''" title="{{item['trust']}}%" > <div *ngIf="item['percentage'] != ''" title="{{item['percentage']}}%" >
<div class="uk-text-center">{{item['trust']}}%</div> <div class="uk-text-center">{{item['percentage']}}%</div>
<progress class="uk-progress uk-margin-remove" value="{{item['trust']}}" max="100"></progress> <progress class="uk-progress uk-margin-remove" value="{{item['percentage']}}" max="100"></progress>
</div> </div>
<div *ngIf="item['trust'] == ''"> <div *ngIf="item['percentage'] == ''">
<p>No trust available</p> <p>No {{percentageName}} available</p>
</div> </div>
</td> </td>
</tr> </tr>
@ -70,7 +70,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
}) })
export class TabTableComponent { export class TabTableComponent {
@Input() info: { "name": string, "url": string, "date": string, "trust": number}[];//Map<string, string[]>; @Input() percentageName: string = "Trust";
@Input() info: { "name": string, "url": string, "date": string, "percentage": number}[];//Map<string, string[]>;
@Input() properties:EnvProperties; @Input() properties:EnvProperties;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
public searchLinkToPublication: string; public searchLinkToPublication: string;

View File

@ -295,7 +295,7 @@
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large uk-margin-bottom">{{provenanceaction}}</div> <div class="uk-text-large uk-margin-bottom">{{provenanceaction}}</div>
<tabTable [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -307,7 +307,7 @@
</div> </div>
<div *ngIf="publicationInfo.similarResearchResults"> <div *ngIf="publicationInfo.similarResearchResults">
<tabTable [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable>
</div> </div>
</div> </div>

View File

@ -157,7 +157,7 @@
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust" [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -167,7 +167,7 @@
No similar research results available No similar research results available
</div> </div>
<div *ngIf="softwareInfo.similarResearchResults"> <div *ngIf="softwareInfo.similarResearchResults">
<tabTable [info]="softwareInfo.similarResearchResults"></tabTable> <tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults"></tabTable>
</div> </div>
</div> </div>
<div *ngIf="activeTab=='Metrics'" class="uk-animation-fade"> <div *ngIf="activeTab=='Metrics'" class="uk-animation-fade">

View File

@ -39,8 +39,8 @@ export class DatasetInfo {
"funderShortname": string, "funderName": string, "funderShortname": string, "funderName": string,
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[]; "funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "trust": number, "class": string}[]>; relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]>; // percentage is for trust
similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
record; record;
} }

View File

@ -50,8 +50,8 @@ export class PublicationInfo {
//similarPublications: {"name": string, "url": string, "date": string, "trust": number}[]; //similarPublications: {"name": string, "url": string, "date": string, "trust": number}[];
//similarDatasets: {"name": string, "url": string, "date": string, "trust": number}[]; //similarDatasets: {"name": string, "url": string, "date": string, "trust": number}[];
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "trust": number, "class": string}[]>; relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]>; // percentage is for trust
similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity
references: { "name": string, "url": string}[]; references: { "name": string, "url": string}[];
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[]; organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[];

View File

@ -39,8 +39,8 @@ export class SoftwareInfo {
"funderShortname": string, "funderName": string, "funderShortname": string, "funderName": string,
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[]; "funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "trust": number, "class": string}[]>; relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]>; // percentage is for trust
similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
record; record;
} }