@@ -1200,4 +1202,4 @@
-
\ No newline at end of file
+
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts
index 0638d469..59b3c41e 100644
--- a/landingPages/result/resultLanding.component.ts
+++ b/landingPages/result/resultLanding.component.ts
@@ -515,6 +515,9 @@ export class ResultLandingComponent {
this.resultLandingInfo = data;
this.id = this.resultLandingInfo.objIdentifier;
+ let typeId = this.identifier?.id?'pid':'id';
+ let id = this.identifier?.id?this.identifier.id:this.id;
+ this.resultLandingInfo.setBelongsTo(typeId, id);
//old
// this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","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(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 = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","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&persistent=false';
@@ -592,7 +595,6 @@ export class ResultLandingComponent {
this.setActiveTab();
this.cdr.detectChanges();
-
if (contexts) {
if (this.communityId && this.communityId == "enermaps" && properties.enermapsURL) {
this.enermapsId = ParsingFunctions.getEnermapsConceptId(contexts);
diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts
index 449bcc64..693d08c3 100644
--- a/utils/entities/dataProviderInfo.ts
+++ b/utils/entities/dataProviderInfo.ts
@@ -1,202 +1,205 @@
import {properties} from "../../../../environments/environment";
-import {Measure} from "./resultLandingInfo";
+import {BelongsTo, Measure} from "./resultLandingInfo";
export class DataproviderProvenance {
- provenance: Map
;
+ provenance: Map;
constructor() {
this.provenance = new Map();
this.provenance.set("opendoar____::", {"urlPrefix": properties.openDoarURL, "name": "OpenDOAR"});//, "idRegexPrefix": ""});
this.provenance.set("re3data_____::", {"urlPrefix": properties.r3DataURL, "name": "re3data.org"});
this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"});
- this.provenance.set("eosc________::", {"urlPrefix": properties.eoscMarketplaceURL, "name": "EOSC Service Catalogue"});
+ this.provenance.set("eosc________::", {
+ "urlPrefix": properties.eoscMarketplaceURL,
+ "name": "EOSC Service Catalogue"
+ });
}
}
export class DataProviderInfo {
- relcanId;
- objIdentifier: string;
- record;
- title: { "name": string, "url": string };
- officialName: string;
- type: string;
- registry: boolean;
- compatibility: { "info": string, "name": string, "id": string };
- oaiPmhURL: string;
- openDoarId: string;
- r3DataId: string;
- provenance: Map;
- originalId: string;
- countries: string[];
- journal: {"journal": "", "issn": string, "lissn": string, "eissn": string};
- description: string;
- subjects: string[];
- jurisdiction: string;
- thematic: boolean;
- contentpolicy: string;
- identifiers: Map; //key is the classname
+ relcanId;
+ objIdentifier: string;
+ record;
+ title: { "name": string, "url": string };
+ officialName: string;
+ type: string;
+ registry: boolean;
+ compatibility: { "info": string, "name": string, "id": string };
+ oaiPmhURL: string;
+ openDoarId: string;
+ r3DataId: string;
+ provenance: Map;
+ originalId: string;
+ countries: string[];
+ journal: { "journal": "", "issn": string, "lissn": string, "eissn": string };
+ description: string;
+ subjects: string[];
+ jurisdiction: string;
+ thematic: boolean;
+ contentpolicy: string;
+ identifiers: Map; //key is the classname
fundedContent: string; // search query
measure: Measure;
//collected from datasource api
// aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string};
- aggregationStatus: {"fulltexts": string};
+ aggregationStatus: { "fulltexts": string };
- tabs: {"name": string, "content": string}[];
- tabs2: string[] =[];
- tabsInTypes = {
- "publicationsTab": new Set(
- [ "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "infospace",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "scholarcomminfra",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "orprepository"
- ]),
- "datasetsTab": new Set(
- [ "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "infospace",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "scholarcomminfra",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "orprepository"
- ]),
- "statisticsTab": new Set(
- [ "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "orprepository"
- ]),
- // "organizationsTab": new Set(
- // [ "entityregistry::projects",
- // "entityregistry::repositories"
- // ]),
- "projectsTab": new Set(["entityregistry::projects"]),
- "datasourcesTab": new Set(["entityregistry::repositories"]),
- "relatedDatasourcesTab": new Set(
- [ "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "aggregator::pubsrepository::institutional",
- "aggregator::datarepository"
- ]),
- "softwareTab": new Set(
- [
- "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "infospace",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "scholarcomminfra",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "softwarerepository",
- "aggregator::softwarerepository",
- "orprepository"
- ]),
- "orpsTab": new Set(
- [
- "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "infospace",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "scholarcomminfra",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "softwarerepository",
- "aggregator::softwarerepository",
- "orprepository"
- ]),
- "metricsTab": new Set(
- [ "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "crissystem",
- "datarepository::unknown",
- "infospace",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "websource",
- "pubsrepository::unknown",
- "scholarcomminfra",
- "pubsrepository::thematic",
- "pubscatalogue::unknown",
- "softwarerepository",
- "aggregator::softwarerepository",
- "orprepository"
- ])
+ tabs: { "name": string, "content": string }[];
+ tabs2: string[] = [];
+ tabsInTypes = {
+ "publicationsTab": new Set(
+ ["aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "infospace",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "scholarcomminfra",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "orprepository"
+ ]),
+ "datasetsTab": new Set(
+ ["aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "infospace",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "scholarcomminfra",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "orprepository"
+ ]),
+ "statisticsTab": new Set(
+ ["aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "orprepository"
+ ]),
+ // "organizationsTab": new Set(
+ // [ "entityregistry::projects",
+ // "entityregistry::repositories"
+ // ]),
+ "projectsTab": new Set(["entityregistry::projects"]),
+ "datasourcesTab": new Set(["entityregistry::repositories"]),
+ "relatedDatasourcesTab": new Set(
+ ["aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::datarepository"
+ ]),
+ "softwareTab": new Set(
+ [
+ "aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "infospace",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "scholarcomminfra",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "softwarerepository",
+ "aggregator::softwarerepository",
+ "orprepository"
+ ]),
+ "orpsTab": new Set(
+ [
+ "aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "infospace",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "scholarcomminfra",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "softwarerepository",
+ "aggregator::softwarerepository",
+ "orprepository"
+ ]),
+ "metricsTab": new Set(
+ ["aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "crissystem",
+ "datarepository::unknown",
+ "infospace",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "websource",
+ "pubsrepository::unknown",
+ "scholarcomminfra",
+ "pubsrepository::thematic",
+ "pubscatalogue::unknown",
+ "softwarerepository",
+ "aggregator::softwarerepository",
+ "orprepository"
+ ])
- };
+ };
- resultsBy: string;
- resultTypes = {
- "collectedFrom": new Set(
- [ "aggregator::datarepository",
- "aggregator::pubsrepository::institutional",
- "aggregator::pubsrepository::unknown",
- "aggregator::pubsrepository::journals",
- "entityregistry::projects",
- "entityregistry::repositories",
- "infospace",
- "scholarcomminfra",
- "pubscatalogue::unknown",
- "aggregator::softwarerepository"
- ]),
- "hostedBy": new Set(
- [ "crissystem",
- "datarepository::unknown",
- "pubsrepository::institutional",
- "pubsrepository::journal",
- "pubsrepository::unknown",
- "pubsrepository::thematic",
- "softwarerepository",
- "orprepository"
- ])
- };
+ resultsBy: string;
+ resultTypes = {
+ "collectedFrom": new Set(
+ ["aggregator::datarepository",
+ "aggregator::pubsrepository::institutional",
+ "aggregator::pubsrepository::unknown",
+ "aggregator::pubsrepository::journals",
+ "entityregistry::projects",
+ "entityregistry::repositories",
+ "infospace",
+ "scholarcomminfra",
+ "pubscatalogue::unknown",
+ "aggregator::softwarerepository"
+ ]),
+ "hostedBy": new Set(
+ ["crissystem",
+ "datarepository::unknown",
+ "pubsrepository::institutional",
+ "pubsrepository::journal",
+ "pubsrepository::unknown",
+ "pubsrepository::thematic",
+ "softwarerepository",
+ "orprepository"
+ ])
+ };
- organizations: {"acronym": string, "name": string, "id": string}[] = [];
- //publications: any;
- //datasets: any;
- statistics: any;
- //projects: any;
- datasources: any;
+ organizations: { "acronym": string, "name": string, "id": string }[] = [];
+ //publications: any;
+ //datasets: any;
+ statistics: any;
+ //projects: any;
+ datasources: any;
- //relatedDatasources: Map;
- relatedDatasources: {"id": string, "name": string, "count": number}[] = [];
+ //relatedDatasources: Map;
+ relatedDatasources: { "id": string, "name": string, "count": number }[] = [];
}
diff --git a/utils/entities/organizationInfo.ts b/utils/entities/organizationInfo.ts
index 5194f076..71827c89 100644
--- a/utils/entities/organizationInfo.ts
+++ b/utils/entities/organizationInfo.ts
@@ -1,3 +1,5 @@
+import {BelongsTo} from "./resultLandingInfo";
+
export interface OrganizationProject {
name: string;
id: string;
diff --git a/utils/entities/projectInfo.ts b/utils/entities/projectInfo.ts
index e66736fe..642ba39a 100644
--- a/utils/entities/projectInfo.ts
+++ b/utils/entities/projectInfo.ts
@@ -1,4 +1,5 @@
-import {Measure} from "./resultLandingInfo";
+import {BelongsTo, Measure} from "./resultLandingInfo";
+import {StringUtils} from "../string-utils.class";
export class ProjectInfo {
id:string;
@@ -23,4 +24,14 @@ export class ProjectInfo {
totalDatasets: number;
publicationsStatus: any;
measure: Measure;
+ belongsTo: boolean = true;
+ message: string;
+
+ setBelongsTo(id: string) {
+ this.belongsTo = !BelongsTo.project || BelongsTo.project.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
+ this.message = !this.belongsTo?BelongsTo.project.message:null;
+ if(this.message) {
+ this.message = this.message.replace('((id))', id);
+ }
+ }
}
diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts
index 16eb7ae1..cf170c18 100644
--- a/utils/entities/resultLandingInfo.ts
+++ b/utils/entities/resultLandingInfo.ts
@@ -6,6 +6,9 @@ import {
Project,
RelationResult
} from "../result-preview/result-preview";
+import {isArray} from "rxjs/internal-compatibility";
+import {OpenaireEntities} from "../properties/searchFields";
+import {StringUtils} from "../string-utils.class";
export interface Id {
type: "pmid" | "doi" | "pmc" | "handle" | "openaire" | "swhid";
@@ -30,18 +33,6 @@ export interface Context {
}
export interface Measure {
- // /** @deprecated*/
- // downloads?: string;
- // /** @deprecated*/
- // views?: string;
- // /** @deprecated*/
- // influence?: string;
- // /** @deprecated*/
- // popularity?: string;
- // /** @deprecated*/
- // citations?: string;
- // /** @deprecated*/
- // impulse?: string;
bip?: Metric[]
counts?: Metric[]
countsPerDatasource?: MetricPerDatasource[];
@@ -61,12 +52,46 @@ export interface Metric {
value: any
}
+class Field {
+ path: string[];
+ value: string;
+}
+
+export class BelongsTo {
+ public static result: BelongsTo = null;
+ public static project: BelongsTo = null;
+ public static organization: BelongsTo = null;
+ public static datasource: BelongsTo = null;
+
+ fields: Field[];
+ message: string;
+
+ public static check(element: any, field: Field): boolean {
+ if (field) {
+ field = Object.assign({}, field);
+ let json: any = element;
+ if (field.path.length > 0) {
+ if (Array.isArray(json)) {
+ return json.findIndex(value => BelongsTo.check(value, field)) != -1;
+ } else {
+ json = json[field.path[0]];
+ field.path = field.path.slice(1);
+ return BelongsTo.check(json, field);
+ }
+ }
+ console.log(json, field.value)
+ return json == field.value;
+ }
+ return false;
+ }
+}
+
export class ResultLandingInfo {
relcanId;
objIdentifier: string;
// PUBLICATION, DATASET, SOFTWARE, ORP
record;
- resultType: "publication"|"dataset"|"other"|"software";
+ resultType: "publication" | "dataset" | "other" | "software";
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
title: string;
accessMode: string;
@@ -79,26 +104,26 @@ export class ResultLandingInfo {
languages: string[];
countries: string[];
description: string;
-
+
hostedBy_collectedFrom: HostedByCollectedFrom[];
-
+
// PUBLICATION, DATASET, SOFTWARE, ORP
fundedByProjects: Project[];
-
+
underCurationMessage: boolean;
publisher: string;
journal: Journal;
-
+
subjects: string[];
otherSubjects: Map;
classifiedSubjects: Map; //
- fos: {"id": string, "label": string}[] = [];
+ fos: { "id": string, "label": string }[] = [];
sdg: string[];
eoscSubjects: any[];
oaRoutes: OARoutes;
publiclyFunded: boolean;
-
+
// // percentage is for trust
// relatedResearchResults: RelationResult[];
// // percentage is for similarity
@@ -159,22 +184,35 @@ export class ResultLandingInfo {
relatedClassFilters: Set = new Set();
contexts: Context[];
-
+
deletedByInferenceIds: string[];
-
+
// PUBLICATION, DATASET, ORP
references: Reference[];
-
+
// PUBLICATION
bioentities: Map>; //>
organizations: Organization[];
openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[];
-
+
// DATASET
subtitle: string;
-
+
// SOFTWARE
programmingLanguages: string[];
- measure: Measure;
+ measure: Measure;
+
+ belongsTo: boolean = true;
+ message: string;
+
+ setBelongsTo(typeId: string, id: string) {
+ this.belongsTo = !BelongsTo.result || BelongsTo.result.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
+ this.message = !this.belongsTo ? BelongsTo.result.message : null;
+ if (this.message) {
+ this.message = this.message.replace('((result))', StringUtils.getEntityName(this.resultType));
+ this.message = this.message.replace('((type_id))', typeId);
+ this.message = this.message.replace('((id))', id);
+ }
+ }
}
diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts
index c8a38e1d..0362be0b 100644
--- a/utils/result-preview/result-preview.ts
+++ b/utils/result-preview/result-preview.ts
@@ -43,6 +43,7 @@ export interface Project {
title: string;
funderShortname: string;
funderName: string;
+ funderJurisdiction?: string
funding?: string;
code: string;
validated?: boolean;