Change OpenAIRE Research Graph to OpenAIRE Graph.

This commit is contained in:
Konstantinos Triantafyllou 2023-06-28 14:40:11 +03:00
parent 006671722c
commit c93523a178
4 changed files with 179 additions and 145 deletions

View File

@ -61,7 +61,7 @@
</div> </div>
</div> </div>
<div class="uk-position-relative"> <div class="uk-position-relative">
<img class="uk-visible@m uk-height-1-1 uk-position-center-right" src="assets/common-assets/common/graph-nodes.svg" alt="OpenAIRE Research Graph" loading="lazy"> <img class="uk-visible@m uk-height-1-1 uk-position-center-right" src="assets/common-assets/common/graph-nodes.svg" alt="OpenAIRE Graph" loading="lazy">
</div> </div>
</div> </div>
</div> </div>
@ -78,7 +78,7 @@
<div class="uk-margin-top uk-margin-bottom title">{{funder.name}}</div> <div class="uk-margin-top uk-margin-bottom title">{{funder.name}}</div>
<div class="outcomes"> <div class="outcomes">
<h5 class="uk-margin-remove">{{funder.publications | number}}</h5> <h5 class="uk-margin-remove">{{funder.publications | number}}</h5>
<span>Research Outcomes Found</span> <span class="uk-text-capitalize">{{entities.RESULTS}} Found</span>
</div> </div>
<div class="uk-margin-top percentage"> <div class="uk-margin-top percentage">
<h5 class="uk-margin-remove">{{(funder.openAccessPublications / funder.publications) * 100 | number : '1.0-0'}}%</h5> <h5 class="uk-margin-remove">{{(funder.openAccessPublications / funder.publications) * 100 | number : '1.0-0'}}%</h5>
@ -120,4 +120,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -23,18 +23,18 @@ import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/num
@Component({ @Component({
selector: 'home', selector: 'home',
templateUrl: 'home.component.html', templateUrl: 'home.component.html',
styleUrls: ['home.component.less'] styleUrls: ['home.component.less']
}) })
export class HomeComponent { export class HomeComponent {
public keyword:string = ""; public keyword: string = "";
public searchFields:SearchFields = new SearchFields(); public searchFields: SearchFields = new SearchFields();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public numbers: Numbers = {}; public numbers: Numbers = {};
properties: EnvProperties = properties; properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public readMore: boolean = false; public readMore: boolean = false;
public funders = []; public funders = [];
subs: Subscription[] = []; subs: Subscription[] = [];
resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
filter: null, filter: null,
@ -46,30 +46,40 @@ export class HomeComponent {
disableSelect; disableSelect;
selectedEntitySimpleUrl; selectedEntitySimpleUrl;
selectedEntityAdvancedUrl; selectedEntityAdvancedUrl;
resultTypes:Filter = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Result Types",filterOperator:"or"}; resultTypes: Filter = {
values: [],
filterId: "type",
countSelectedValues: 0,
filterType: 'checkbox',
originalFilterId: "",
valueIsExact: true,
title: "Result Types",
filterOperator: "or"
};
public pageContents = null; public pageContents = null;
customFilter:SearchCustomFilter= null; customFilter: SearchCustomFilter = null;
aggregatorId; aggregatorId;
aggregator:AggregatorInfo; aggregator: AggregatorInfo;
@ViewChild('numbersComponent', { static: true }) numbersComponent: NumbersComponent; entities = OpenaireEntities;
@ViewChild('numbersComponent', {static: true}) numbersComponent: NumbersComponent;
constructor (
private _router: Router, constructor(
private _refineFieldResultsService:RefineFieldResultsService, private _router: Router,
private _piwikService:PiwikService, private _refineFieldResultsService: RefineFieldResultsService,
private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService, private _piwikService: PiwikService,
private helper: HelperService, private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService,
private cdr: ChangeDetectorRef private helper: HelperService,
private cdr: ChangeDetectorRef
) { ) {
this.aggregatorId = ConnectHelper.getCommunityFromDomain(properties.domain); this.aggregatorId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.aggregator = PortalAggregators.getFilterInfoByMenuId(this.aggregatorId); this.aggregator = PortalAggregators.getFilterInfoByMenuId(this.aggregatorId);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(this.aggregator); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(this.aggregator);
let description = "OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."; let description = "OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide.";
let title = "OpenAIRE - Explore | " +this.aggregator.title; let title = "OpenAIRE - Explore | " + this.aggregator.title;
this._title.setTitle(title); this._title.setTitle(title);
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
this._meta.updateTag({content:title},"property='og:title'"); this._meta.updateTag({content: title}, "property='og:title'");
} }
private getPageContents() { private getPageContents() {
@ -83,64 +93,85 @@ export class HomeComponent {
} }
public ngOnInit() { public ngOnInit() {
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink+this._router.url, false); this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this._router.url, false);
this.getPageContents(); this.getPageContents();
if(this.properties!=null){ if (this.properties != null) {
var url = this.properties.domain + this.properties.baseLink+this._router.url; var url = this.properties.domain + this.properties.baseLink + this._router.url;
this._meta.updateTag({content:url},"property='og:url'"); this._meta.updateTag({content: url}, "property='og:url'");
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, "OpenAIRE").subscribe()); this.subs.push(this._piwikService.trackView(this.properties, "OpenAIRE").subscribe());
} }
if(this.numbersComponent) { if (this.numbersComponent) {
this.numbersComponent.showPublications = portalProperties.entities.publication.isEnabled; this.numbersComponent.showPublications = portalProperties.entities.publication.isEnabled;
this.numbersComponent.showDatasets = portalProperties.entities.dataset.isEnabled; this.numbersComponent.showDatasets = portalProperties.entities.dataset.isEnabled;
this.numbersComponent.showSoftware = portalProperties.entities.software.isEnabled; this.numbersComponent.showSoftware = portalProperties.entities.software.isEnabled;
this.numbersComponent.showOrp = portalProperties.entities.other.isEnabled; this.numbersComponent.showOrp = portalProperties.entities.other.isEnabled;
this.numbersComponent.showOrganizations = portalProperties.entities.organization.isEnabled; this.numbersComponent.showOrganizations = portalProperties.entities.organization.isEnabled;
this.numbersComponent.showProjects = portalProperties.entities.project.isEnabled; this.numbersComponent.showProjects = portalProperties.entities.project.isEnabled;
this.numbersComponent.showDataProviders = portalProperties.entities.datasource.isEnabled; this.numbersComponent.showDataProviders = portalProperties.entities.datasource.isEnabled;
} }
this.subs.push(this.config.communityInformationState.subscribe(data => { this.subs.push(this.config.communityInformationState.subscribe(data => {
if(data) { if (data) {
var showEntity = {}; var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) { for (var i = 0; i < data['entities'].length; i++) {
showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"]; showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
}
if (this.numbersComponent) {
this.numbersComponent.showPublications = !!showEntity["publication"];
this.numbersComponent.showDatasets = !!showEntity["dataset"];
this.numbersComponent.showSoftware = !!showEntity["software"];
this.numbersComponent.showOrp = !!showEntity["orp"];
this.numbersComponent.showProjects = !!showEntity["project"];
this.numbersComponent.showDataProviders = !!showEntity["datasource"];
this.numbersComponent.showOrganizations = !!showEntity["organization"];
}
if (this.numbersComponent && this.numbersComponent.showPublications) {
this.resultTypes.values.push({
name: this.openaireEntities.PUBLICATIONS,
id: "publications",
selected: false,
number: 0
});
}
if (this.numbersComponent && this.numbersComponent.showDatasets) {
this.resultTypes.values.push({
name: this.openaireEntities.DATASETS,
id: "datasets",
selected: false,
number: 0
});
}
if (this.numbersComponent && this.numbersComponent.showSoftware) {
this.resultTypes.values.push({
name: this.openaireEntities.SOFTWARE,
id: "software",
selected: false,
number: 0
});
}
if (this.numbersComponent && this.numbersComponent.showOrp) {
this.resultTypes.values.push({
name: this.openaireEntities.OTHER,
id: "other",
selected: false,
number: 0
});
}
if (this.numbersComponent) {
this.numbersComponent.init(false, false, this.numbersComponent.showPublications, this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showOrp, this.numbersComponent.showProjects, this.numbersComponent.showDataProviders, this.numbersComponent.showOrganizations,
this.customFilter ? StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId))) : '');
}
this.getFunders();
} }
if(this.numbersComponent) { },
this.numbersComponent.showPublications = !!showEntity["publication"]; error => {
this.numbersComponent.showDatasets = !!showEntity["dataset"]; this.handleError("Error getting community information", error);
this.numbersComponent.showSoftware = !!showEntity["software"];
this.numbersComponent.showOrp = !!showEntity["orp"];
this.numbersComponent.showProjects = !!showEntity["project"];
this.numbersComponent.showDataProviders = !!showEntity["datasource"];
this.numbersComponent.showOrganizations = !!showEntity["organization"];
}
if(this.numbersComponent && this.numbersComponent.showPublications){
this.resultTypes.values.push({name: this.openaireEntities.PUBLICATIONS , id:"publications",selected:false, number:0});
}
if(this.numbersComponent && this.numbersComponent.showDatasets){
this.resultTypes.values.push({name: this.openaireEntities.DATASETS , id:"datasets",selected:false, number:0});
}
if(this.numbersComponent && this.numbersComponent.showSoftware){
this.resultTypes.values.push({name: this.openaireEntities.SOFTWARE , id:"software",selected:false, number:0});
}
if(this.numbersComponent && this.numbersComponent.showOrp){
this.resultTypes.values.push({name: this.openaireEntities.OTHER , id:"other",selected:false, number:0});
}
if(this.numbersComponent) {
this.numbersComponent.init(false, false, this.numbersComponent.showPublications, this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showOrp, this.numbersComponent.showProjects, this.numbersComponent.showDataProviders, this.numbersComponent.showOrganizations,
this.customFilter ? StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId))) : '');
}
this.getFunders();
} }
},
error => {
this.handleError("Error getting community information", error);
}
)); ));
} }
} }
public ngOnDestroy() { public ngOnDestroy() {
for (let sub of this.subs) { for (let sub of this.subs) {
sub.unsubscribe(); sub.unsubscribe();
@ -148,26 +179,28 @@ export class HomeComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Home Page: "+message, error); console.error("Home Page: " + message, error);
} }
entityChanged($event){
entityChanged($event) {
this.selectedEntity = $event.entity; this.selectedEntity = $event.entity;
this.selectedEntitySimpleUrl = $event.simpleUrl; this.selectedEntitySimpleUrl = $event.simpleUrl;
this.selectedEntityAdvancedUrl = $event.advancedUrl; this.selectedEntityAdvancedUrl = $event.advancedUrl;
} }
goTo(simple:boolean){
let url = (simple)?this.selectedEntitySimpleUrl:this.selectedEntityAdvancedUrl; goTo(simple: boolean) {
let url = (simple) ? this.selectedEntitySimpleUrl : this.selectedEntityAdvancedUrl;
let parameterNames = []; let parameterNames = [];
let parameterValues = []; let parameterValues = [];
if (this.selectedEntity == "result") { if (this.selectedEntity == "result") {
if (this.resultTypes) { if (this.resultTypes) {
let values = []; let values = [];
for(let value of this.resultTypes.values){ for (let value of this.resultTypes.values) {
if (value.selected) { if (value.selected) {
values.push(value.id); values.push(value.id);
} }
} }
if (values.length > 0 && values.length !=4) { if (values.length > 0 && values.length != 4) {
parameterNames.push("type"); parameterNames.push("type");
parameterValues.push(values.join(",")); parameterValues.push(values.join(","));
} }
@ -176,19 +209,19 @@ export class HomeComponent {
parameterValues.push("" + this.resultsQuickFilter.selected); parameterValues.push("" + this.resultsQuickFilter.selected);
} }
} }
}else if(this.selectedEntity == "all"){ } else if (this.selectedEntity == "all") {
if (this.resultsQuickFilter) { if (this.resultsQuickFilter) {
parameterNames.push("qf"); parameterNames.push("qf");
parameterValues.push("true"); parameterValues.push("true");
} }
} }
if(this.keyword.length > 0) { if (this.keyword.length > 0) {
parameterNames.push("fv0"); parameterNames.push("fv0");
parameterValues.push(this.keyword); parameterValues.push(this.keyword);
parameterNames.push("f0"); parameterNames.push("f0");
parameterValues.push("q"); parameterValues.push("q");
} }
if(this.customFilter){ if (this.customFilter) {
parameterNames.push(this.customFilter.queryFieldName); parameterNames.push(this.customFilter.queryFieldName);
parameterValues.push(this.customFilter.valueId); parameterValues.push(this.customFilter.valueId);
parameterNames.push("cf"); parameterNames.push("cf");
@ -196,77 +229,78 @@ export class HomeComponent {
} }
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)}); this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
} }
getQueryParamsForAdvancedSearch(entity){
getQueryParamsForAdvancedSearch(entity) {
let params = {}; let params = {};
if (entity == "result") { if (entity == "result") {
if (this.resultsQuickFilter) { if (this.resultsQuickFilter) {
params["qf"] = "" + this.resultsQuickFilter.selected; params["qf"] = "" + this.resultsQuickFilter.selected;
} }
} }
if(this.keyword.length > 0) { if (this.keyword.length > 0) {
params["fv0"] = "" + this.keyword; params["fv0"] = "" + this.keyword;
params["f0"] = "q"; params["f0"] = "q";
} }
if(this.customFilter){ if (this.customFilter) {
params = this.customFilter.getParameters(params); params = this.customFilter.getParameters(params);
} }
return params; return params;
} }
getFunders() { getFunders() {
let refineParams1 = '&fq=country%20exact%20%22CA%22'; let refineParams1 = '&fq=country%20exact%20%22CA%22';
let refineParams2 = '&fq=resultbestaccessright%20exact%20%22Open%20Access%22&fq=country%20exact%20%22CA%22%20'; let refineParams2 = '&fq=resultbestaccessright%20exact%20%22Open%20Access%22&fq=country%20exact%20%22CA%22%20';
this.subs.push(zip( this.subs.push(zip(
this._refineFieldResultsService.getRefineFieldsResultsByEntityName(['relfunder'], 'result', this.properties, refineParams1), this._refineFieldResultsService.getRefineFieldsResultsByEntityName(['relfunder'], 'result', this.properties, refineParams1),
this._refineFieldResultsService.getRefineFieldsResultsByEntityName(['relfunder'], 'result', this.properties, refineParams2) this._refineFieldResultsService.getRefineFieldsResultsByEntityName(['relfunder'], 'result', this.properties, refineParams2)
).subscribe((data: any[]) => { ).subscribe((data: any[]) => {
let queriedFunders1 = data[0][1][0].values; let queriedFunders1 = data[0][1][0].values;
queriedFunders1.forEach(queriedFunder => { queriedFunders1.forEach(queriedFunder => {
if(queriedFunder.id.includes('nserc')) { if (queriedFunder.id.includes('nserc')) {
this.funders.push({ this.funders.push({
"id": queriedFunder.id, "id": queriedFunder.id,
"name": queriedFunder.name, "name": queriedFunder.name,
"publications": queriedFunder.number, "publications": queriedFunder.number,
"openAccessPublications": null, "openAccessPublications": null,
"logo": 'assets/nserc_logo.png', "logo": 'assets/nserc_logo.png',
"params": { "params": {
relfunder: '"'+encodeURIComponent(queriedFunder.id)+'"' relfunder: '"' + encodeURIComponent(queriedFunder.id) + '"'
} }
}); });
} else if(queriedFunder.id.includes('cihr')) { } else if (queriedFunder.id.includes('cihr')) {
this.funders.push({ this.funders.push({
"id": queriedFunder.id, "id": queriedFunder.id,
"name": queriedFunder.name, "name": queriedFunder.name,
"publications": queriedFunder.number, "publications": queriedFunder.number,
"openAccessPublications": null, "openAccessPublications": null,
"logo": 'assets/cihr_logo.png', "logo": 'assets/cihr_logo.png',
"params": { "params": {
relfunder: '"'+encodeURIComponent(queriedFunder.id)+'"' relfunder: '"' + encodeURIComponent(queriedFunder.id) + '"'
} }
}); });
} else if(queriedFunder.id.includes('sshrc')) { } else if (queriedFunder.id.includes('sshrc')) {
this.funders.push({ this.funders.push({
"id": queriedFunder.id, "id": queriedFunder.id,
"name": queriedFunder.name, "name": queriedFunder.name,
"publications": queriedFunder.number, "publications": queriedFunder.number,
"openAccessPublications": null, "openAccessPublications": null,
"logo": 'assets/sshrc_logo.png', "logo": 'assets/sshrc_logo.png',
"params": { "params": {
relfunder: '"'+encodeURIComponent(queriedFunder.id)+'"' relfunder: '"' + encodeURIComponent(queriedFunder.id) + '"'
} }
}); });
} }
}); });
let queriedFunders2 = data[1][1][0].values; let queriedFunders2 = data[1][1][0].values;
queriedFunders2.forEach(queriedFunder => { queriedFunders2.forEach(queriedFunder => {
for(let funder of this.funders) { for (let funder of this.funders) {
if(queriedFunder.id == funder.id) { if (queriedFunder.id == funder.id) {
funder.openAccessPublications = queriedFunder.number; funder.openAccessPublications = queriedFunder.number;
} }
} }
}); });
})); }));
} }
isRouteAvailable(routeToCheck: string) { isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this._router.config.length; i++) { for (let i = 0; i < this._router.config.length; i++) {

@ -1 +1 @@
Subproject commit 2ef5d069dd55b3ae366fbf8723975c98e6a8c140 Subproject commit 1ec84770535c7f691d6eb7d2b0a99c6aec4bcd65

View File

@ -42,7 +42,7 @@ export class PortalAggregators {
Welcome to the Portal of Canadian Research Outputs. This has been developed as part of a collaboration between Welcome to the Portal of Canadian Research Outputs. This has been developed as part of a collaboration between
Canadian Association of Research Libraries (CARL) and OpenAIRE. The portal presents research results collected Canadian Association of Research Libraries (CARL) and OpenAIRE. The portal presents research results collected
from Canadian institutional repositories compliant to <a from Canadian institutional repositories compliant to <a
href="https://guidelines.openaire.eu/" target="_blank">OpenAIRE guidelines</a> and from the OpenAIRE Research Graph. href="https://guidelines.openaire.eu/" target="_blank">OpenAIRE guidelines</a> and from the OpenAIRE Graph.
It links them to three Canadian funders, Natural Sciences and Engineering Research Council of Canada, Canadian Institutes of Health Research and It links them to three Canadian funders, Natural Sciences and Engineering Research Council of Canada, Canadian Institutes of Health Research and
Social Sciences and Humanities Research Council. For more information, visit the <a Social Sciences and Humanities Research Council. For more information, visit the <a
Social Sciences and Humanities Research Council. For more information, visit the <a Social Sciences and Humanities Research Council. For more information, visit the <a