Publication/Dataset Landing Pages: Categorize results in related research results tab by provenanceaction | Publication/DAtaset Landing Pages: small fix in query for Views Chart in metrics tab

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46251 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-03-14 11:11:03 +00:00
parent 2fa9275de9
commit fb466c2fbb
10 changed files with 168 additions and 105 deletions

View File

@ -42,9 +42,8 @@
<li class="uk-active">
<a href="#relatedTab">
Related Research Results
<span *ngIf="datasetInfo.relatedResearchResults == undefined" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.relatedResearchResults != undefined" class="uk-badge uk-badge-notification">
{{datasetInfo.relatedResearchResults.length}}
<span class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum}}
</span>
</a>
</li>
@ -72,11 +71,16 @@
There are no related research results
</div>
<div *ngIf="datasetInfo.relatedResearchResults != undefined">
<div *ngFor="let provenanceaction of datasetInfo.relatedResearchResults.keys()">
<h4>{{provenanceaction}}</h4>
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p>
<tabTable from="dataset" [info]="datasetInfo.relatedResearchResults"></tabTable>
<tabTable from="dataset" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
</div>
</div>
</li>

View File

@ -27,6 +27,8 @@ export class DatasetComponent {
private totalViews: number;
private totalDownloads: number;
public relatedResearchResultsNum: number = 0;
public warningMessage = "";
public errorMessage = "";
public routerHelper:RouterHelper = new RouterHelper();
@ -45,7 +47,8 @@ export class DatasetComponent {
});
this.metricsClicked = false;
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
//this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
}
@ -64,6 +67,13 @@ export class DatasetComponent {
this.result = []
this.result = {id: id, type :"dataset", source : "openaire", title: this.datasetInfo.title,url: '', result: '', accessRights: this.datasetInfo.bestlicense, embargoEndDate: ''};
let relatedResearchResultsNum = 0;
if(this.datasetInfo.relatedResearchResults != undefined) {
this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
},
err => {
console.log(err)
@ -72,7 +82,6 @@ export class DatasetComponent {
this.errorMessage = 'No dataset found';
}
);
}
showChange($event) {

View File

@ -148,6 +148,51 @@ export class DatasetService {
}
}
}
} else if(mydata['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(mydata.provenanceaction in this.datasetInfo.provenanceVocabulary) {
provenanceAction = this.datasetInfo.provenanceVocabulary[mydata.provenanceaction];
} else {
provenanceAction = "Other"
}
/*
if(this.datasetInfo.relatedResearchResults == undefined) {
this.datasetInfo.relatedResearchResults = new Array<{
"name": string, "id": string, "date": string,
"trust": string, "class": string}>();
}
*/
if(this.datasetInfo.relatedResearchResults == undefined) {
this.datasetInfo.relatedResearchResults =
new Map<string, { "name": string, "id": string, "date": string,
"trust": string, "class": string}[]>();
}
if(!this.datasetInfo.relatedResearchResults.has(provenanceAction)) {
this.datasetInfo.relatedResearchResults.set(provenanceAction,
new Array<{ "name": string, "id": string, "date": string,
"trust": string, "class": string}>());
}
counter = this.datasetInfo.relatedResearchResults.get(provenanceAction).length;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter] = {"name": "", "id": "", "date": "", "trust": "", "class": ""}
//let url;
if(mydata['resulttype'].classname == "publication") {
//url = OpenaireProperties.getsearchLinkToPublication()+mydata['to'].content;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['class'] = "publication";
} else {
//url = OpenaireProperties.getsearchLinkToDataset()+mydata['to'].content;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['class'] = "dataset";
}
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['id'] = mydata['to'].content;
//this.datasetInfo.relatedResearchResults[counter]['url'] = url;
let titleName = Array.isArray(mydata['title']) ? mydata['title'][0].content : mydata['title'].content;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['name'] = titleName;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['date'] = mydata.dateofacceptance.substring(0,4);;
this.datasetInfo.relatedResearchResults.get(provenanceAction)[counter]['trust'] = Math.round(mydata.trust*100)+"%";
} else if(mydata['to'].class == "hasAmongTopNSimilarDocuments") {
if(this.datasetInfo.similarResearchResults == undefined) {
this.datasetInfo.similarResearchResults = new Array<{
@ -175,32 +220,6 @@ export class DatasetService {
this.datasetInfo.similarResearchResults[counter]['trust'] = Math.round(mydata.trust*100)+"%";
} else if(mydata['to'].class == "isRelatedTo") {
if(this.datasetInfo.relatedResearchResults == undefined) {
this.datasetInfo.relatedResearchResults = new Array<{
"name": string, "id": string, "date": string,
"trust": string, "class": string}>();
}
counter = this.datasetInfo.relatedResearchResults.length;
this.datasetInfo.relatedResearchResults[counter] = {"name": "", "id": "", "date": "", "trust": "", "class": ""}
//let url;
if(mydata['resulttype'].classname == "publication") {
//url = OpenaireProperties.getsearchLinkToPublication()+mydata['to'].content;
this.datasetInfo.relatedResearchResults[counter]['class'] = "publication";
} else {
//url = OpenaireProperties.getsearchLinkToDataset()+mydata['to'].content;
this.datasetInfo.relatedResearchResults[counter]['class'] = "dataset";
}
this.datasetInfo.relatedResearchResults[counter]['id'] = mydata['to'].content;
//this.datasetInfo.relatedResearchResults[counter]['url'] = url;
let titleName = Array.isArray(mydata['title']) ? mydata['title'][0].content : mydata['title'].content;
this.datasetInfo.relatedResearchResults[counter]['name'] = titleName;
this.datasetInfo.relatedResearchResults[counter]['date'] = mydata.dateofacceptance.substring(0,4);;
this.datasetInfo.relatedResearchResults[counter]['trust'] = Math.round(mydata.trust*100)+"%";
}
}
}

View File

@ -195,9 +195,9 @@ export class OrganizationComponent {
let url: string;
if(index == 0) {
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv&size="+data;
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special&size="+data;
} else {
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-notitle&size="+data;
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special-notitle&size="+data;
}
this._reportsService.getCSVResponse(url).subscribe(

View File

@ -73,9 +73,8 @@
<li>
<a href="#relatedTab">
Related Research Results
<span *ngIf="publicationInfo.relatedResearchResults == undefined" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.relatedResearchResults != undefined" class="uk-badge uk-badge-notification">
{{publicationInfo.relatedResearchResults.length}}
<span class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum}}
</span>
</a>
</li>
@ -157,12 +156,16 @@
There are no related research results
</div>
<div *ngIf="publicationInfo.relatedResearchResults != undefined">
<div *ngFor="let provenanceaction of publicationInfo.relatedResearchResults.keys()">
<h4>{{provenanceaction}}</h4>
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p>
<tabTable from="publication" [info]="publicationInfo.relatedResearchResults"></tabTable>
<tabTable from="publication" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
</div>
</div>
</li>

View File

@ -37,6 +37,7 @@ export class PublicationComponent {
public showFundingDetails: boolean = false;
public bioentitiesNum: number = 0;
public relatedResearchResultsNum: number = 0;
private doi: string;
@ -63,9 +64,11 @@ export class PublicationComponent {
// }
}else{
console.info("Article id not found");
this.warningMessage="No valid publication id";
}
this.metricsClicked = false;
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
//this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
});
}
@ -77,9 +80,7 @@ export class PublicationComponent {
getPublicationInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
if(this.articleId==null || this.articleId==''){
this.warningMessage="No valid publication id";
}else{
this._publicationService.getPublicationInfo(this.articleId).subscribe(
data => {
this.publicationInfo = data;
@ -94,14 +95,20 @@ export class PublicationComponent {
}
this.bioentitiesNum = bioentitiesNum;
let relatedResearchResultsNum = 0;
if(this.publicationInfo.relatedResearchResults != undefined) {
this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.result = {id: this.articleId, type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
// this.result.push(result_);
if(this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) {
this.doi = this.publicationInfo.identifiers.get('doi')[0];
}
},
err => {
console.log(err);
@ -111,7 +118,6 @@ export class PublicationComponent {
}
);
}
}
showChange($event) {
this.showAllReferences=$event.value;

View File

@ -152,30 +152,50 @@ export class PublicationService {
}
}
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.publicationInfo.provenanceVocabulary) {
provenanceAction = this.publicationInfo.provenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other";
}
if(this.publicationInfo.relatedResearchResults == undefined) {
this.publicationInfo.relatedResearchResults =
new Map<string, { "name": string, "id": string, "date": string,
"trust": string, "class": string}[]>();
}
if(!this.publicationInfo.relatedResearchResults.has(provenanceAction)) {
this.publicationInfo.relatedResearchResults.set(provenanceAction,
new Array<{ "name": string, "id": string, "date": string,
"trust": string, "class": string}>());
}
/*
if(this.publicationInfo.relatedResearchResults == undefined) {
this.publicationInfo.relatedResearchResults = new Array<{
"name": string, "id": string, "date": string,
"trust": string, "class": string}>();
}
*/
counter = this.publicationInfo.relatedResearchResults.length;
this.publicationInfo.relatedResearchResults[counter] = {"name": "", "id": "", "date": "", "trust": "", "class": ""}
counter = this.publicationInfo.relatedResearchResults.get(provenanceAction).length;
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter] = {"name": "", "id": "", "date": "", "trust": "", "class": ""}
//let url;
if(relation['resulttype'].classname == "publication") {
//url = OpenaireProperties.getsearchLinkToPublication() + relation['to'].content;
this.publicationInfo.relatedResearchResults[counter]['class'] = "publication";
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['class'] = "publication";
} else {
//url = OpenaireProperties.getsearchLinkToDataset() + relation['to'].content;
this.publicationInfo.relatedResearchResults[counter]['class'] = "dataset";
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['class'] = "dataset";
}
this.publicationInfo.relatedResearchResults[counter]['id'] = relation['to'].content;
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['id'] = relation['to'].content;
//this.publicationInfo.relatedResearchResults[counter]['url'] = url;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content;
this.publicationInfo.relatedResearchResults[counter]['name'] = titleName;
this.publicationInfo.relatedResearchResults[counter]['date'] = relation.dateofacceptance.substring(0,4);;
this.publicationInfo.relatedResearchResults[counter]['trust'] = Math.round(relation.trust*100)+"%";
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['name'] = titleName;
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['date'] = relation.dateofacceptance.substring(0,4);;
this.publicationInfo.relatedResearchResults.get(provenanceAction)[counter]['trust'] = Math.round(relation.trust*100)+"%";
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
if(this.publicationInfo.similarResearchResults == undefined) {

View File

@ -17,7 +17,8 @@ export class DatasetInfo {
fundedByProjects: { "id": string, "acronym": string, "title": string,
"funderShortname": string, "funderName": string,
"funding": string, "inline": boolean}[];
relatedResearchResults: { "name": string, "id": string, "date": string, "trust": string, "class": string}[];
provenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "trust": string, "class": string}[]>;
similarResearchResults: { "name": string, "id": string, "date": string, "trust": string, "class": string}[];
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
}

View File

@ -25,7 +25,8 @@ export class PublicationInfo {
//relatedResearchData: { "name": string, "url": string, "date": string, "trust": string}[];
//similarPublications: {"name": string, "url": string, "date": string, "trust": string}[];
//similarDatasets: {"name": string, "url": string, "date": string, "trust": string}[];
relatedResearchResults: { "name": string, "id": string, "date": string, "trust": string, "class": string}[];
provenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "trust": string, "class": string}[]>;
similarResearchResults: { "name": string, "id": string, "date": string, "trust": string, "class": string}[];
references: { "name": string, "url": string}[];
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];