Updating landing page of publication : parse context field (shown as related to) | linkify authors | linkify identifiers | change downloadFrom type | show additional classifications in subjects | add badges in tabs | view all in References tab
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43244 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
e12d5d0c14
commit
a4a54ccdb8
|
@ -1,6 +1,6 @@
|
||||||
export class PublicationInfo {
|
export class PublicationInfo {
|
||||||
title: string;
|
title: string;
|
||||||
authors: string[];
|
authors: { [key: string]: string }[];
|
||||||
date: string;
|
date: string;
|
||||||
types: string[];
|
types: string[];
|
||||||
downloadFrom: Map<string, string[]>;
|
downloadFrom: Map<string, string[]>;
|
||||||
|
@ -18,4 +18,5 @@ export class PublicationInfo {
|
||||||
relatedResearchData: Map<string, string[]>;//{ [key: string]: string }[];
|
relatedResearchData: Map<string, string[]>;//{ [key: string]: string }[];
|
||||||
similarPublications: Map<string, string[]>;//{ [key: string]: string }[];
|
similarPublications: Map<string, string[]>;//{ [key: string]: string }[];
|
||||||
references: { [key: string]: string }[];
|
references: { [key: string]: string }[];
|
||||||
|
contexts: { [key: string]: string }[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,10 @@ import {PublicationInfo} from '../../entities/publicationInfo';
|
||||||
import { RouteParams} from '@angular/router-deprecated';
|
import { RouteParams} from '@angular/router-deprecated';
|
||||||
import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component';
|
import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component';
|
||||||
import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component';
|
import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component';
|
||||||
|
//import {NgSwitch, ngSwitchCase, NgSwitchDefault} from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'publication',
|
selector: 'publication',
|
||||||
//directives: [...ROUTER_DIRECTIVES],
|
|
||||||
template: `
|
template: `
|
||||||
|
|
||||||
<div >
|
<div >
|
||||||
|
@ -23,9 +24,36 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
<div class="row row-offcanvas row-offcanvas-right" >
|
<div class="row row-offcanvas row-offcanvas-right" >
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="publicationInfo != null">
|
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="publicationInfo != null">
|
||||||
<p>
|
<div>
|
||||||
{{publicationInfo.authors}} ({{publicationInfo.date}})
|
<div *ngIf="publicationInfo.authors != undefined">
|
||||||
</p>
|
<div *ngIf="showAllAuthors">
|
||||||
|
<a class="text-muted" (click)="showAllAuthors = !showAllAuthors;">View less authors</a>
|
||||||
|
</div>
|
||||||
|
<span *ngFor="let item of publicationInfo.authors.slice(0,30)">
|
||||||
|
<a class="custom-external" href="{{item['url']}}" target="_blank">
|
||||||
|
{{item['name']}};
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<span *ngIf="!showAllAuthors && publicationInfo.authors.length > 30"> ... </span>
|
||||||
|
<span *ngIf="showAllAuthors">
|
||||||
|
<span *ngFor="let item of publicationInfo.authors.slice(30)">
|
||||||
|
<a class="custom-external" href="{{item['url']}}" target="_blank">
|
||||||
|
{{item['name']}};
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span *ngIf="!showAllAuthors && publicationInfo.authors.length > 30">
|
||||||
|
<a class="text-muted" (click)="showAllAuthors = !showAllAuthors;">
|
||||||
|
view all {{publicationInfo.authors.length}} authors
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<span *ngIf="showAllAuthors">
|
||||||
|
<a class="text-muted" (click)="showAllAuthors = !showAllAuthors;">View less authors</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">Publisher: </dt>
|
<dt *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">Publisher: </dt>
|
||||||
|
@ -34,41 +62,141 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
<dd *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''">{{publicationInfo.journal}}</dd>
|
<dd *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''">{{publicationInfo.journal}}</dd>
|
||||||
<dt *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''"> Languages: </dt>
|
<dt *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''"> Languages: </dt>
|
||||||
<dd *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''">{{publicationInfo.languages}}</dd>
|
<dd *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''">{{publicationInfo.languages}}</dd>
|
||||||
<dt *ngIf="publicationInfo.types != undefined"> Types: </dt>
|
<dt *ngIf="publicationInfo.types != undefined && publicationInfo.types.length > 0"> Types: </dt>
|
||||||
<dd *ngIf="publicationInfo.types != undefined">{{publicationInfo.types}}</dd>
|
<dd *ngIf="publicationInfo.types != undefined && publicationInfo.types.length > 0">{{publicationInfo.types}}</dd>
|
||||||
|
|
||||||
<dt *ngIf="publicationInfo.subjects != undefined"> Subjects: </dt>
|
|
||||||
<dd *ngIf="publicationInfo.subjects != undefined"> {{publicationInfo.subjects}} </dd>
|
<div *ngIf="publicationInfo.identifiers != undefined && publicationInfo.identifiers.size > 0">
|
||||||
<dt *ngIf="publicationInfo.identifiers != undefined">Identifiers:</dt>
|
<dt>Identifiers:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li *ngFor="let key of publicationInfo.identifiers.keys()">
|
<li *ngFor="let key of publicationInfo.identifiers.keys()">
|
||||||
{{key}}: {{publicationInfo.identifiers.get(key)}} </li>
|
<!--a *ngIf="key == 'doi'" class="custom-external" href="http://dx.doi.org/{{key}}" target="_blank">
|
||||||
|
{{key}}: {{publicationInfo.identifiers.get(key)}}
|
||||||
|
</a>
|
||||||
|
<a *ngIf="key == 'pmc'" class="custom-external" href="http://europepmc.org/articles/{{key}}" target="_blank">
|
||||||
|
{{key}}: {{publicationInfo.identifiers.get(key)}}
|
||||||
|
</a>
|
||||||
|
<a *ngIf="key != 'pmc' && key != 'doi'" class="custom-external" href="http://europepmc.org/articles/{{key}}" target="_blank">
|
||||||
|
{{key}}: {{publicationInfo.identifiers.get(key)}}
|
||||||
|
</a-->
|
||||||
|
|
||||||
|
<div [ngSwitch]="key">
|
||||||
|
<template [ngSwitchWhen]="'doi'">
|
||||||
|
<a class="custom-external" href="http://dx.doi.org/{{publicationInfo.identifiers.get(key)}}" target="_blank">
|
||||||
|
{{key}}: {{publicationInfo.identifiers.get(key)}}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
<template [ngSwitchWhen]="'pmc'">
|
||||||
|
<a class="custom-external" href="http://europepmc.org/articles/{{publicationInfo.identifiers.get(key)}}" target="_blank">
|
||||||
|
{{key}}: {{publicationInfo.identifiers.get(key)}}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
<template ngSwitchDefault>{{key}}: {{publicationInfo.identifiers.get(key)}}</template>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="publicationInfo.subjects != undefined">
|
||||||
|
<dt *ngIf="publicationInfo.subjects.length > 0 || publicationInfo.classifiedSubjects.size > 0">
|
||||||
|
Subjects:
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<div *ngIf="publicationInfo.subjects.length > 0"> {{publicationInfo.subjects}} </div>
|
||||||
|
<div *ngIf="publicationInfo.subjects.length == 0 && publicationInfo.classifiedSubjects.size > 0"> - </div>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd class="col-md-offset-1" *ngIf="publicationInfo.classifiedSubjects.size > 0">
|
||||||
|
<a (click)="showClassifiedSbj = !showClassifiedSbj;">
|
||||||
|
<div *ngIf="!showClassifiedSbj">
|
||||||
|
Show additional classifications
|
||||||
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="showClassifiedSbj">
|
||||||
|
Hide additional classifications
|
||||||
|
<span class="glyphicon glyphicon-minus" aria-hidden="true"></span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="well" *ngIf="showClassifiedSbj">
|
||||||
|
<div *ngFor="let key of publicationInfo.classifiedSubjects.keys()">
|
||||||
|
Classified by OpenAIRE into
|
||||||
|
<div>
|
||||||
|
{{key}}: {{publicationInfo.classifiedSubjects.get(key)}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<blockquote>
|
|
||||||
|
<blockquote *ngIf="publicationInfo.description != ''">
|
||||||
{{publicationInfo.description}}
|
{{publicationInfo.description}}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active"><a data-toggle="tab" href="#citationsTab">References</a></li>
|
<li class="active">
|
||||||
<li role="presentation"><a data-toggle="tab" href="#dataTab">Related Research Data</a></li>
|
<a data-toggle="tab" href="#citationsTab">
|
||||||
<li role="presentation"><a data-toggle="tab" href="#similarTab">Similar Publications</a></li>
|
References
|
||||||
<li role="presentation" *ngIf="publicationInfo.bioentities != undefined"><a data-toggle="tab" href="#bioentitiesTab">Bioentities</a></li>
|
<span *ngIf="publicationInfo.references == undefined" class="badge">0</span>
|
||||||
|
<span *ngIf="publicationInfo.references != undefined" class="badge">
|
||||||
|
{{publicationInfo.references.length}}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!--span [ngSwitch]="publicationInfo.references || undefined" class="badge">
|
||||||
|
<template [ngSwitchWhen]="undefined">0</template>
|
||||||
|
<template ngSwitchDefault>{{publicationInfo.references.length}}</template>
|
||||||
|
</span-->
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation">
|
||||||
|
<a data-toggle="tab" href="#dataTab">
|
||||||
|
Related Research Data
|
||||||
|
<span *ngIf="publicationInfo.relatedResearchData == undefined" class="badge">0</span>
|
||||||
|
<span *ngIf="publicationInfo.relatedResearchData != undefined" class="badge">{{publicationInfo.relatedResearchData.size}}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation">
|
||||||
|
<a data-toggle="tab" href="#similarTab">
|
||||||
|
Similar Publications
|
||||||
|
<span *ngIf="publicationInfo.similarPublications == undefined" class="badge">0</span>
|
||||||
|
<span *ngIf="publicationInfo.similarPublications != undefined" class="badge">{{publicationInfo.similarPublications.size}}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation" *ngIf="publicationInfo.bioentities != undefined">
|
||||||
|
<a data-toggle="tab" href="#bioentitiesTab">
|
||||||
|
Bioentities
|
||||||
|
<span class="badge">{{bioentitiesNum}}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
|
||||||
<div id="citationsTab" class="tab-pane fade in active panel-body">
|
<div id="citationsTab" class="tab-pane fade in active panel-body">
|
||||||
|
|
||||||
<div *ngIf="publicationInfo.references == undefined" class = "alert alert-info " >
|
<div *ngIf="publicationInfo.references == undefined" class = "alert alert-info " >
|
||||||
There are no references
|
There are no references
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="publicationInfo.references != undefined" >
|
<div *ngIf="publicationInfo.references != undefined">
|
||||||
<div *ngFor="let item of publicationInfo.references">
|
|
||||||
<p *ngIf=" item != undefined &&item['url'] != undefined">
|
<div class="panel panel-default" *ngIf="!showAllReferences && publicationInfo.references.length > 10">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<a (click)="showAllReferences = true;">
|
||||||
|
<div class="text-right">view all {{publicationInfo.references.length}}</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!showAllReferences">
|
||||||
|
<div *ngFor="let item of publicationInfo.references.slice(0,10)">
|
||||||
|
<p *ngIf=" item != undefined && item['url'] != undefined">
|
||||||
<a class="custom-external" href="{{item['url']}}" target="_blank">
|
<a class="custom-external" href="{{item['url']}}" target="_blank">
|
||||||
{{item['text']}}
|
{{item['text']}}
|
||||||
</a>
|
</a>
|
||||||
|
@ -79,7 +207,29 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="showAllReferences">
|
||||||
|
<div *ngFor="let item of publicationInfo.references.slice(10)">
|
||||||
|
<p *ngIf=" item != undefined && item['url'] != undefined">
|
||||||
|
<a class="custom-external" href="{{item['url']}}" target="_blank">
|
||||||
|
{{item['text']}}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p *ngIf="item['url'] == undefined">
|
||||||
|
{{item['text']}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default" *ngIf="!showAllReferences && publicationInfo.references.length > 10">
|
||||||
|
<div class="text-right" class="panel-heading">
|
||||||
|
<a (click)="showAllReferences = true;">
|
||||||
|
<div class="text-right" >view all {{publicationInfo.references.length}}</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="dataTab" class="tab-pane fade panel-body">
|
<div id="dataTab" class="tab-pane fade panel-body">
|
||||||
<div *ngIf="publicationInfo.relatedResearchData == undefined" class = "alert alert-info " >
|
<div *ngIf="publicationInfo.relatedResearchData == undefined" class = "alert alert-info " >
|
||||||
There are no related research data
|
There are no related research data
|
||||||
|
@ -97,7 +247,9 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
<a class="custom-external" href="{{key}}" target="_blank">
|
<a class="custom-external" href="{{key}}" target="_blank">
|
||||||
{{publicationInfo.relatedResearchData.get(key)[0]}}
|
{{publicationInfo.relatedResearchData.get(key)[0]}}
|
||||||
</a>
|
</a>
|
||||||
|
<span *ngIf="publicationInfo.relatedResearchData.get(key)[1] != ''">
|
||||||
({{publicationInfo.relatedResearchData.get(key)[1]}})
|
({{publicationInfo.relatedResearchData.get(key)[1]}})
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
@ -130,7 +282,9 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
<a class="custom-external" href="{{key}}" target="_blank">
|
<a class="custom-external" href="{{key}}" target="_blank">
|
||||||
{{publicationInfo.similarPublications.get(key)[0]}}
|
{{publicationInfo.similarPublications.get(key)[0]}}
|
||||||
</a>
|
</a>
|
||||||
|
<span *ngIf="publicationInfo.similarPublications.get(key)[1] != ''">
|
||||||
({{publicationInfo.similarPublications.get(key)[1]}})
|
({{publicationInfo.similarPublications.get(key)[1]}})
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
@ -189,11 +343,11 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<dl class="functionsSection" *ngIf="publicationInfo.collectedFrom != undefined">
|
<dl class="functionsSection" *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0">
|
||||||
<dt class="title">Download from</dt>
|
<dt class="title">Download from</dt>
|
||||||
<dd class="line" *ngFor="let key of publicationInfo.collectedFrom.keys()">
|
<dd class="line" *ngFor="let key of publicationInfo.downloadFrom.keys()">
|
||||||
<a href="{{publicationInfo.collectedFrom.get(key)}}">
|
<a href="{{key}}">
|
||||||
{{key}}
|
{{publicationInfo.downloadFrom.get(key)[1]}}
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -223,8 +377,10 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<dl class="functionsSection" *ngIf="publicationInfo.contexts != undefined">
|
<dl class="functionsSection" *ngIf="publicationInfo.contexts != undefined">
|
||||||
<dt class="title">Related to </dt>
|
<dt class="title">Related to </dt>
|
||||||
<dd class="line" >
|
<dd class="line" *ngFor="let item of publicationInfo.contexts">
|
||||||
<!-- TODO add contexts here -->
|
<span>{{item['labelContext']}}</span>
|
||||||
|
<span *ngIf="item['labelCategory'] != null">-> {{item['labelCategory']}}</span>
|
||||||
|
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="functionsSection" *ngIf="publicationInfo.contexts == undefined">
|
<dl class="functionsSection" *ngIf="publicationInfo.contexts == undefined">
|
||||||
|
@ -259,9 +415,17 @@ export class PublicationComponent {
|
||||||
this.getPublicationInfo();
|
this.getPublicationInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private publicationInfo: PublicationInfo;
|
||||||
|
private params: RouteParams;
|
||||||
|
|
||||||
publicationInfo: PublicationInfo;
|
private showAllAuthors: boolean = false;
|
||||||
params: RouteParams;
|
private showStyle: boolean = false;
|
||||||
|
private showAllReferences: boolean = false;
|
||||||
|
private showAllRelResData: boolean = false;
|
||||||
|
private showAllSimilPubl: boolean = false;
|
||||||
|
private showAllBioentities: boolean = false;
|
||||||
|
|
||||||
|
private bioentitiesNum: number = 0;
|
||||||
|
|
||||||
private result ;
|
private result ;
|
||||||
private claimInline:string = "none" ;
|
private claimInline:string = "none" ;
|
||||||
|
@ -283,6 +447,15 @@ console.info("do request");
|
||||||
this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe(
|
this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.publicationInfo = data;
|
this.publicationInfo = data;
|
||||||
|
|
||||||
|
let bioentitiesNum = 0;
|
||||||
|
if(this.publicationInfo.bioentities != undefined) {
|
||||||
|
this.publicationInfo.bioentities.forEach(function (value, key, map) {
|
||||||
|
bioentitiesNum += value.size;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.bioentitiesNum = bioentitiesNum;
|
||||||
|
|
||||||
this.result = []
|
this.result = []
|
||||||
let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
|
let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
|
||||||
this.result.push(result_);
|
this.result.push(result_);
|
||||||
|
|
|
@ -30,7 +30,8 @@ export class PublicationService {
|
||||||
res['result']['metadata']['oaf:entity']['oaf:result']['subject'],
|
res['result']['metadata']['oaf:entity']['oaf:result']['subject'],
|
||||||
res['result']['metadata']['oaf:entity']['oaf:result']['bestlicense'],
|
res['result']['metadata']['oaf:entity']['oaf:result']['bestlicense'],
|
||||||
res['result']['metadata']['oaf:entity']['oaf:result']['collectedfrom'],
|
res['result']['metadata']['oaf:entity']['oaf:result']['collectedfrom'],
|
||||||
(res['result']['metadata']['oaf:entity']['extraInfo']!= undefined && res['result']['metadata']['oaf:entity']['extraInfo']['citations']!= undefined)? res['result']['metadata']['oaf:entity']['extraInfo']['citations']['citation']:null
|
(res['result']['metadata']['oaf:entity']['extraInfo']!= undefined && res['result']['metadata']['oaf:entity']['extraInfo']['citations']!= undefined)? res['result']['metadata']['oaf:entity']['extraInfo']['citations']['citation']:null,
|
||||||
|
res['result']['metadata']['oaf:entity']['oaf:result']['context']
|
||||||
])
|
])
|
||||||
.map(res => this.parsePublicationInfo(res));
|
.map(res => this.parsePublicationInfo(res));
|
||||||
|
|
||||||
|
@ -67,9 +68,12 @@ export class PublicationService {
|
||||||
if(mydata.hasOwnProperty("to")) {
|
if(mydata.hasOwnProperty("to")) {
|
||||||
if(mydata['to'].class == "hasAuthor") {
|
if(mydata['to'].class == "hasAuthor") {
|
||||||
if(this.publicationInfo.authors == undefined) {
|
if(this.publicationInfo.authors == undefined) {
|
||||||
this.publicationInfo.authors = new Array<string>();
|
this.publicationInfo.authors = new Array<{[key: string]: string}>();
|
||||||
}
|
}
|
||||||
this.publicationInfo.authors[mydata.ranking-1] = mydata.fullname;
|
|
||||||
|
this.publicationInfo.authors[mydata.ranking-1] = {};
|
||||||
|
this.publicationInfo.authors[mydata.ranking-1]['name'] = mydata.fullname;
|
||||||
|
this.publicationInfo.authors[mydata.ranking-1]['url'] = "https://beta.openaire.eu/search/person?personId="+mydata['to'].content;
|
||||||
} else if(mydata['to'].class == "isProducedBy") {
|
} else if(mydata['to'].class == "isProducedBy") {
|
||||||
if(this.publicationInfo.fundedByProjects == undefined) {
|
if(this.publicationInfo.fundedByProjects == undefined) {
|
||||||
this.publicationInfo.fundedByProjects = new Map<string, string[]>();
|
this.publicationInfo.fundedByProjects = new Map<string, string[]>();
|
||||||
|
@ -106,7 +110,7 @@ export class PublicationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(mydata['to'].class == "isRelatedTo") {
|
} else if(mydata['to'].class == "iscontexts") {
|
||||||
if(this.publicationInfo.relatedResearchData == undefined) {
|
if(this.publicationInfo.relatedResearchData == undefined) {
|
||||||
this.publicationInfo.relatedResearchData = new Map<string, string[]>();//Array<{}>();
|
this.publicationInfo.relatedResearchData = new Map<string, string[]>();//Array<{}>();
|
||||||
}
|
}
|
||||||
|
@ -130,6 +134,10 @@ export class PublicationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.publicationInfo.authors = this.publicationInfo.authors.filter(function (item) {
|
||||||
|
return (item != undefined);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data[3] != null) {
|
if(data[3] != null) {
|
||||||
|
@ -152,18 +160,25 @@ export class PublicationService {
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!this.publicationInfo.downloadFrom.has(mydata.id)) {
|
|
||||||
this.publicationInfo.downloadFrom.set(mydata.id, new Array<string>());
|
if(mydata.hasOwnProperty("webresource")) {
|
||||||
|
let url;
|
||||||
|
if(mydata['webresource'].length == undefined) {
|
||||||
|
url = mydata['webresource'].url;
|
||||||
|
} else{
|
||||||
|
url = mydata['webresource'][0].url;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!this.publicationInfo.downloadFrom.has(url)) {
|
||||||
|
this.publicationInfo.downloadFrom.set(url, new Array<string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mydata.hasOwnProperty("licence")) {
|
if(mydata.hasOwnProperty("licence")) {
|
||||||
this.publicationInfo.downloadFrom.get(mydata.id)[0] = mydata['licence'].classid;
|
this.publicationInfo.downloadFrom.get(url)[0] = mydata['licence'].classid;
|
||||||
}
|
}
|
||||||
if(mydata.hasOwnProperty("hostedby")) {
|
if(mydata.hasOwnProperty("hostedby")) {
|
||||||
this.publicationInfo.downloadFrom.get(mydata.id)[1] = mydata['hostedby'].name;
|
this.publicationInfo.downloadFrom.get(url)[1] = mydata['hostedby'].name;
|
||||||
}
|
}
|
||||||
if(mydata.hasOwnProperty("webresource")) {
|
|
||||||
this.publicationInfo.downloadFrom.get(mydata.id)[2] = mydata['webresource'].url;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +203,7 @@ export class PublicationService {
|
||||||
if(data[4] != null) {
|
if(data[4] != null) {
|
||||||
this.publicationInfo.identifiers = new Map<string, string>();
|
this.publicationInfo.identifiers = new Map<string, string>();
|
||||||
|
|
||||||
if(data[4].hasOwnProperty("classname")) {
|
if(data[4].hasOwnProperty("classname") && data[4]['classname'] != "") {
|
||||||
this.publicationInfo.identifiers.set(data[4].classname, data[4].content);
|
this.publicationInfo.identifiers.set(data[4].classname, data[4].content);
|
||||||
} else {
|
} else {
|
||||||
for(let i=0; i<data[4].length; i++) {
|
for(let i=0; i<data[4].length; i++) {
|
||||||
|
@ -223,6 +238,7 @@ export class PublicationService {
|
||||||
for(let i=0; i<length; i++) {
|
for(let i=0; i<length; i++) {
|
||||||
mydata = length > 1 ? data[7][i] : data[7];
|
mydata = length > 1 ? data[7][i] : data[7];
|
||||||
|
|
||||||
|
if(mydata.classid != "") {
|
||||||
if(mydata.inferred == true) {
|
if(mydata.inferred == true) {
|
||||||
if(!this.publicationInfo.classifiedSubjects.has(mydata.classid)) {
|
if(!this.publicationInfo.classifiedSubjects.has(mydata.classid)) {
|
||||||
this.publicationInfo.classifiedSubjects.set(mydata.classid, new Array<string>());
|
this.publicationInfo.classifiedSubjects.set(mydata.classid, new Array<string>());
|
||||||
|
@ -234,7 +250,7 @@ export class PublicationService {
|
||||||
let counter = this.publicationInfo.subjects.length;
|
let counter = this.publicationInfo.subjects.length;
|
||||||
this.publicationInfo.subjects[counter] = mydata.content;
|
this.publicationInfo.subjects[counter] = mydata.content;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,14 +278,13 @@ export class PublicationService {
|
||||||
this.publicationInfo.downloadFrom = new Map<string, string[]>();
|
this.publicationInfo.downloadFrom = new Map<string, string[]>();
|
||||||
}
|
}
|
||||||
|
|
||||||
let doi = this.publicationInfo.identifiers.get("doi");
|
let url = "http://dx.doi.org/"+this.publicationInfo.identifiers.get("doi");
|
||||||
if(!this.publicationInfo.downloadFrom.has(doi)) {
|
if(!this.publicationInfo.downloadFrom.has(url)) {
|
||||||
this.publicationInfo.downloadFrom.set(doi, new Array<string>());
|
this.publicationInfo.downloadFrom.set(url, new Array<string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.publicationInfo.downloadFrom.get(doi)[0] = "";
|
this.publicationInfo.downloadFrom.get(url)[0] = "";
|
||||||
this.publicationInfo.downloadFrom.get(doi)[1] = this.publicationInfo.publisher+"/ "+this.publicationInfo.journal;
|
this.publicationInfo.downloadFrom.get(url)[1] = this.publicationInfo.publisher+"/ "+this.publicationInfo.journal;
|
||||||
this.publicationInfo.downloadFrom.get(doi)[2] = "http://dx.doi.org/"+doi;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data[10] != null) {
|
if(data[10] != null) {
|
||||||
|
@ -299,6 +314,45 @@ export class PublicationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data[11] != null) {
|
||||||
|
this.publicationInfo.contexts = new Array<{ [key: string]: string }>();
|
||||||
|
|
||||||
|
let position = 0;
|
||||||
|
let labels = "";
|
||||||
|
let mydata;
|
||||||
|
let length = data[11].length!=undefined ? data[11].length : 1;
|
||||||
|
for(let i=0; i<length; i++) {
|
||||||
|
mydata = length > 1 ? data[11][i] : data[11];
|
||||||
|
|
||||||
|
if(mydata.hasOwnProperty("category")) {
|
||||||
|
if(mydata['category'].hasOwnProperty("concept")) {
|
||||||
|
let mydata1;
|
||||||
|
let length1 = mydata['category']['concept'].length!=undefined ? mydata['category']['concept'].length : 1;
|
||||||
|
for(let j=0; j<length1; j++) {
|
||||||
|
mydata1 = length1 > 1 ? mydata['category']['concept'][j] : mydata['category']['concept'];
|
||||||
|
|
||||||
|
this.publicationInfo.contexts[position] = {};
|
||||||
|
this.publicationInfo.contexts[position]['labelContext'] = mydata.label;
|
||||||
|
this.publicationInfo.contexts[position]['labelCategory'] = mydata['category'].label;;
|
||||||
|
this.publicationInfo.contexts[position]['labelConcept'] = mydata1.label;
|
||||||
|
|
||||||
|
position++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.publicationInfo.contexts[position] = {};
|
||||||
|
this.publicationInfo.contexts[position]['labelContext'] = mydata.label;
|
||||||
|
this.publicationInfo.contexts[position]['labelCategory'] = mydata['category'].label;;
|
||||||
|
this.publicationInfo.contexts[position]['labelConcept'] = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.publicationInfo.contexts[position] = {};
|
||||||
|
this.publicationInfo.contexts[position]['labelContext'] = mydata.label;
|
||||||
|
this.publicationInfo.contexts[position]['labelCategory'] = null;
|
||||||
|
this.publicationInfo.contexts[position]['labelConcept'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//this.printPublicationInfo();
|
//this.printPublicationInfo();
|
||||||
return this.publicationInfo;
|
return this.publicationInfo;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue