[Library | new-theme]: [NEW] #6915 - Added new fields in datasources/services.

1. dataProviderInfo.ts: Added fields jurisdiction, thematic, contentpolicy, identifiers.
2. dataProvider.service.ts: Parse new fields.
3. dataProvider.component.html: Added label "Thematic" when true | moved "web page" under the labels | Show identifiers, jurisdiction and contentpolicy.
4. dataProvider.module.ts: Import ResultLandingUtilsModule.
5. parsingFunctions.class.ts: In method "parseIdentifiers()" added parsing for classid "re3data".
6. showIdentifiers.component.ts: Show identifier when key is "re3data" too.
7. string-utils.class.ts: In Identifier class added class and check for "re3data".
8. searchDataproviders.service.ts: In method "parseResults()" parse "pid" and set identifiers.
9. newSearchPage.component.ts: In method "createKeywordQuery()" added check for identifiers for entityTypes "datasource" and "service".
This commit is contained in:
Konstantina Galouni 2022-05-16 17:01:35 +03:00
parent 8e0ae78383
commit 4242a65199
9 changed files with 68 additions and 19 deletions

View File

@ -87,16 +87,6 @@
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
</landing-header>
<!-- Web Page -->
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url"
class="uk-margin-bottom uk-text-small">
<span class="uk-text-meta">Web page: </span>
<a [href]="dataProviderInfo.title.url" target="_blank"
class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{dataProviderInfo.title.url}}
</a>
</div>
<!-- Labels -->
<div class="uk-margin-bottom uk-margin-remove-left uk-grid uk-grid-small uk-flex-middle" uk-grid>
<ng-container *ngIf="dataProviderInfo.compatibility">
@ -123,6 +113,24 @@
<span class="uk-label label-country" title="Country">{{country}}</span>&#160;
</ng-container>
</ng-container>
<ng-container *ngIf="dataProviderInfo.thematic">
<span class="uk-label uk-text-truncate">Thematic</span>
</ng-container>
</div>
<!-- Web Page -->
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url"
class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Web page: </span>
<a [href]="dataProviderInfo.title.url" target="_blank"
class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{dataProviderInfo.title.url}}
</a>
</div>
<!-- Identifiers -->
<div *ngIf="dataProviderInfo.identifiers && dataProviderInfo.identifiers.size > 0" class="uk-margin-small-top uk-text-small">
<showIdentifiers [identifiers]="dataProviderInfo.identifiers" [showViewAll]="true"></showIdentifiers>
</div>
</div>
@ -221,6 +229,16 @@
{{dataProviderInfo.countries.join(", ")}}
</div>
<div *ngIf="dataProviderInfo.jurisdiction" class="uk-margin-medium-bottom">
<div class="uk-text-meta uk-margin-small-bottom">Jurisdiction</div>
{{dataProviderInfo.jurisdiction}}
</div>
<div *ngIf="dataProviderInfo.contentpolicy" class="uk-margin-medium-bottom">
<div class="uk-text-meta uk-margin-small-bottom">Content policy</div>
{{dataProviderInfo.contentpolicy}}
</div>
<!-- Subjects -->
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
class="uk-margin-medium-bottom uk-margin-bottom">

View File

@ -33,6 +33,7 @@ import {IconsModule} from "../../utils/icons/icons.module";
import {IconsService} from "../../utils/icons/icons.service";
import {graph} from "../../utils/icons/icons";
import {LoadingModalModule} from "../../utils/modal/loadingModal.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
@NgModule({
imports:
@ -41,7 +42,7 @@ import {LoadingModalModule} from "../../utils/modal/loadingModal.module";
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule,
TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule
TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule, ResultLandingUtilsModule
],
declarations:
[StatisticsTabComponent,

View File

@ -169,6 +169,20 @@ export class DataProviderService {
// this.dataProviderInfo.description = (data[0]['description'][0]) ? String(data[0]['description'][0]) : "";
// }
this.dataProviderInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description?data[0].description:[]);
this.dataProviderInfo.thematic = data[0].thematic;
if(data[0].jurisdiction != null) {
this.dataProviderInfo.jurisdiction = data[0].jurisdiction.classname;
}
if(data[0].contentpolicy != null) {
this.dataProviderInfo.contentpolicy = data[0].contentpolicy.classname;
}
if(data[0].pid != null) {
this.dataProviderInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[0].pid);
}
}
if(data[1] != null) {

View File

@ -551,7 +551,7 @@ export class ParsingFunctions {
let identifiers = new Map<string, string[]>();
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") {
if (!identifiers.has(pid.classid)) {
identifiers.set(pid.classid, new Array<string>());
}
@ -559,7 +559,7 @@ export class ParsingFunctions {
}
} else {
for (let i = 0; i < pid.length; i++) {
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid") {
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data") {
if (!identifiers.has(pid[i].classid)) {
identifiers.set(pid[i].classid, new Array<string>());
}
@ -583,7 +583,6 @@ export class ParsingFunctions {
for (let i = 0; i < length; i++) {
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
console.log(subject);
if (subject.classid != "") {
if (subject.inferred && subject.inferred == true) {
if(subject.classid === "SDG") {
@ -642,7 +641,6 @@ export class ParsingFunctions {
}
}
}
console.log(this.eoscSubjectsFound);
return [subjects, otherSubjects, classifiedSubjects, fos, sdg, this.eoscSubjectsFound];
}

View File

@ -26,7 +26,7 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-meta uk-text-small uk-text-uppercase">{{key}}: </span>
<span [class.uk-margin-small-left]="modal">
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle'"
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data'"
[href]="getUrl(key) + item" target="_blank" class="uk-display-inline-block custom-external">
{{item}}
</a>
@ -115,6 +115,8 @@ export class ShowIdentifiersComponent implements AfterViewInit {
return properties.pmidURL;
} else if(key == "handle") {
return properties.handleURL;
} else if(key == "re3data") {
return properties.r3DataURL;
}
}

View File

@ -957,7 +957,7 @@ export class NewSearchPageComponent {
let params = "";
let doisParams = "";
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result")) {
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "datasource" || entityType == "service")) {
for (let identifier of DOIs) {
// console.log(identifier)
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"

View File

@ -345,7 +345,12 @@ export class SearchDataprovidersService {
result['countries'] = res[0];
result['subjects'] = this.getDataproviderSubjects(resData);
//console.log(result['subjects']);
results.push(result);
if(resData['pid']) {
result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
}
results.push(result);
}
return results;

View File

@ -27,6 +27,10 @@ export class DataProviderInfo {
journal: {"journal": "", "issn": string, "lissn": string, "eissn": string};
description: string[] = [];
subjects: string[];
jurisdiction: string;
thematic: boolean;
contentpolicy: string;
identifiers: Map<string, string[]>; //key is the classname
fundedContent: string; // search query

View File

@ -149,7 +149,7 @@ export class DOI {
}
export class Identifier {
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" = null;
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" = null;
id: string;
public static getDOIsFromString(str: string): string[] {
@ -200,6 +200,8 @@ export class Identifier {
return {"class": "pmid", "id": pid};
} else if (Identifier.isValidHANDLE(pid)) {
return {"class": "handle", "id": pid};
} else if (Identifier.isValidRe3Data(pid)) {
return {"class": "re3data", "id": pid};
}
//set it as a doi, to catch the case that doi has not valid format
return (strict?null:{"class": "doi", "id": pid});
@ -250,6 +252,11 @@ export class Identifier {
let exp = /^[0-9a-zA-Z-]*\/[0-9a-zA-Z-]*$/g;
return str.match(exp) != null;
}
public static isValidRe3Data(str: string): boolean {
let exp = /(r3d[1-9]\d{0,8})/g;
return str.match(exp) != null;
}
}
export class StringUtils {