-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#258 : add referencePublication to externalDataSoftware #269
base: #253-developers-affiliation-on-hover
Are you sure you want to change the base?
#258 : add referencePublication to externalDataSoftware #269
Conversation
a4b6116
to
c508bcb
Compare
e3705fd
to
40f686a
Compare
c508bcb
to
46afa24
Compare
40f686a
to
4fae180
Compare
@@ -1,4 +1,5 @@ | |||
import { Generated, JSONColumnType } from "kysely"; | |||
import { ScholarlyArticle } from "../../../../types/codemeta"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas d'import dans ce fichier, on fait du copié coller au besoin (c'est l'exception, avec les fichiers de migration).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
à la reflexion pour ce qui concern code meta ça peut avoir du sens, car c'est sensé être figé.
Qu'est-ce que tu pense d'exporter CodeMeta
sous forme de name space, pour clarifier d'où vient ce ScholaryArticle
(ça ne m'a pas sauté au yeux au premier abort) ?
Voilà ce que ça pourrait donner :
import { CodeMeta } from "../../../../types/codemeta";
// ...
referencePublication: JSONColumnType<CodeMeta.ScholarlyArticle[]> | null;
applicationCategories: JSON.stringify(softExtData.applicationCategories), | ||
programmingLanguages: JSON.stringify(softExtData.programmingLanguages), | ||
referencePublication: JSON.stringify(softExtData.referencePublication) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bien vu 👍
const arrayValue = typeof value === "string" ? value.split(",") : value; | ||
switch (key) { | ||
case "hal": | ||
return arrayValue.map((halThing): ScholarlyArticle => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem, proposition d'explicité ce qui vient de codeMeta :
return arrayValue.map((halThing): ScholarlyArticle => { | |
return arrayValue.map((halThing): CodeMeta.ScholarlyArticle => { |
|
||
// from https://schema.org/ScholarlyArticle | ||
export type ScholarlyArticle = { | ||
"@id": string; | ||
"@type": "ScholarlyArticle"; | ||
identifier?: PropertyValue; | ||
}; | ||
|
||
// from https://schema.org/PropertyValue | ||
export type PropertyValue = { | ||
"@type"?: "PropertyValue"; | ||
value?: string; | ||
propertyID?: string; | ||
url?: URL | null; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on pourrait donc faire ça :
export namespace CodeMeta {
export type Identifier = {
"@type": string;
propertyID: string;
value: string;
};
// from https://schema.org/ScholarlyArticle
export type ScholarlyArticle = {
"@id": string;
"@type": "ScholarlyArticle";
identifier?: PropertyValue;
};
// from https://schema.org/PropertyValue
export type PropertyValue = {
"@type"?: "PropertyValue";
value?: string;
propertyID?: string;
url?: URL | null;
};
}
closes #258