Production release December 2024 [EXPLORE] (angular 16) #56
|
@ -599,7 +599,8 @@ export class ParsingFunctions {
|
||||||
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|
||||||
|| pid.classid == "swhid"
|
|| pid.classid == "swhid"
|
||||||
|| pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef"
|
|| pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef"
|
||||||
|| pid.classid == "RRID") {
|
|| pid.classid == "RRID"
|
||||||
|
|| pid.classid == "arXiv") {
|
||||||
if (!identifiers.has(pid.classid)) {
|
if (!identifiers.has(pid.classid)) {
|
||||||
identifiers.set(pid.classid, new Array<string>());
|
identifiers.set(pid.classid, new Array<string>());
|
||||||
}
|
}
|
||||||
|
@ -610,7 +611,8 @@ export class ParsingFunctions {
|
||||||
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|
||||||
|| pid[i].classid == "swhid"
|
|| pid[i].classid == "swhid"
|
||||||
|| pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef"
|
|| pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef"
|
||||||
|| pid[i].classid == "RRID") {
|
|| pid[i].classid == "RRID"
|
||||||
|
|| pid[i].classid == "arXiv") {
|
||||||
if (!identifiers.has(pid[i].classid)) {
|
if (!identifiers.has(pid[i].classid)) {
|
||||||
identifiers.set(pid[i].classid, new Array<string>());
|
identifiers.set(pid[i].classid, new Array<string>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,8 @@ import {properties} from "../../../../environments/environment";
|
||||||
<span [class.uk-margin-small-left]="modal">
|
<span [class.uk-margin-small-left]="modal">
|
||||||
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
||||||
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
|
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
|
||||||
|| key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef' || key == 'RRID'"
|
|| key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef' || key == 'RRID'
|
||||||
|
|| key == 'arXiv'"
|
||||||
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
|
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
|
||||||
{{item}}
|
{{item}}
|
||||||
</a>
|
</a>
|
||||||
|
@ -140,6 +141,8 @@ export class ShowIdentifiersComponent implements AfterViewInit {
|
||||||
return properties.fundRefURL;
|
return properties.fundRefURL;
|
||||||
} else if(key == "RRID") {
|
} else if(key == "RRID") {
|
||||||
return properties.rridURL;
|
return properties.rridURL;
|
||||||
|
} else if(key == "arXiv") {
|
||||||
|
return properties.arxivURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ export interface EnvProperties {
|
||||||
wikiDataURL?: string;
|
wikiDataURL?: string;
|
||||||
fundRefURL?: string;
|
fundRefURL?: string;
|
||||||
rridURL?: string;
|
rridURL?: string;
|
||||||
|
arxivURL?: string;
|
||||||
fairSharingURL?: string,
|
fairSharingURL?: string,
|
||||||
openScienceCloudURL?: string,
|
openScienceCloudURL?: string,
|
||||||
eoscMarketplaceURL?: string,
|
eoscMarketplaceURL?: string,
|
||||||
|
|
|
@ -26,6 +26,7 @@ export let common: EnvProperties = {
|
||||||
wikiDataURL: "https://www.wikidata.org/wiki/",
|
wikiDataURL: "https://www.wikidata.org/wiki/",
|
||||||
fundRefURL: "https://data.crossref.org/fundingdata/funder/",
|
fundRefURL: "https://data.crossref.org/fundingdata/funder/",
|
||||||
rridURL: "https://scicrunch.org/resolver/",
|
rridURL: "https://scicrunch.org/resolver/",
|
||||||
|
arxivURL: "https://arxiv.org/abs/",
|
||||||
fairSharingURL: "https://fairsharing.org/",
|
fairSharingURL: "https://fairsharing.org/",
|
||||||
openScienceCloudURL: "https://open-science-cloud.ec.europa.eu/resources/services/",
|
openScienceCloudURL: "https://open-science-cloud.ec.europa.eu/resources/services/",
|
||||||
sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
|
sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
|
||||||
|
|
|
@ -150,7 +150,7 @@ export class DOI {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Identifier {
|
export class Identifier {
|
||||||
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" | "ror" | "wikidata" | "fundref" | "isni" | "RRID" = null;
|
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" | "ror" | "wikidata" | "fundref" | "isni" | "RRID" | "arXiv" = null;
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
public static getDOIsFromString(str: string): string[] {
|
public static getDOIsFromString(str: string): string[] {
|
||||||
|
@ -215,13 +215,15 @@ export class Identifier {
|
||||||
return {"class": "isni", "id": pid};
|
return {"class": "isni", "id": pid};
|
||||||
} else if(Identifier.isValidRrid(pid)) {
|
} else if(Identifier.isValidRrid(pid)) {
|
||||||
return {"class": "RRID", "id": pid};
|
return {"class": "RRID", "id": pid};
|
||||||
|
} else if(Identifier.isValidArxiv(pid)) {
|
||||||
|
return {"class": "arXiv", "id": pid};
|
||||||
}
|
}
|
||||||
//set it as a doi, to catch the case that doi has not valid format
|
//set it as a doi, to catch the case that doi has not valid format
|
||||||
return (strict?null:{"class": "doi", "id": pid});
|
return (strict?null:{"class": "doi", "id": pid});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier {
|
public static getPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier {
|
||||||
let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid", "ror", "wikidata", "fundref", "isni", "rrid"];
|
let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid", "ror", "wikidata", "fundref", "isni", "rrid", "arXiv"];
|
||||||
if(identifiers && identifiers.size > 0) {
|
if(identifiers && identifiers.size > 0) {
|
||||||
for (let cl of classes) {
|
for (let cl of classes) {
|
||||||
if (identifiers.get(cl)) {
|
if (identifiers.get(cl)) {
|
||||||
|
@ -309,6 +311,14 @@ export class Identifier {
|
||||||
let exp = /^RRID:.*$/g;
|
let exp = /^RRID:.*$/g;
|
||||||
return str.match(exp) != null;
|
return str.match(exp) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static isValidArxiv(str: string): boolean {
|
||||||
|
// YYMM.NNNNN
|
||||||
|
// YYMM.NNNN
|
||||||
|
// arch-ive/YYMMNNN - hep-th/
|
||||||
|
let exp = /^([0-9]{2}(0[1-9]|1[0-2])\.[0-9]{3,4})|hep-th\/([0-9]{2}(0[1-9]|1[0-2])[0-9]{3})\w+$/g;
|
||||||
|
return str.match(exp) != null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class StringUtils {
|
export class StringUtils {
|
||||||
|
|
Loading…
Reference in New Issue