Skip to content
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

Open
wants to merge 1 commit into
base: #253-developers-affiliation-on-hover
Choose a base branch
from

Conversation

guillermau
Copy link
Collaborator

@guillermau guillermau commented Jan 16, 2025

closes #258

@guillermau guillermau force-pushed the #253-developers-affiliation-on-hover branch 2 times, most recently from a4b6116 to c508bcb Compare January 17, 2025 13:31
@guillermau guillermau force-pushed the #258-get-referencedPublications branch from e3705fd to 40f686a Compare January 17, 2025 13:36
@guillermau guillermau marked this pull request as ready for review January 17, 2025 13:36
@guillermau guillermau force-pushed the #253-developers-affiliation-on-hover branch from c508bcb to 46afa24 Compare January 17, 2025 14:01
@guillermau guillermau force-pushed the #258-get-referencedPublications branch from 40f686a to 4fae180 Compare January 23, 2025 09:30
@@ -1,4 +1,5 @@
import { Generated, JSONColumnType } from "kysely";
import { ScholarlyArticle } from "../../../../types/codemeta";
Copy link
Collaborator

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).

Copy link
Collaborator

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;

Comment on lines +447 to +449
applicationCategories: JSON.stringify(softExtData.applicationCategories),
programmingLanguages: JSON.stringify(softExtData.programmingLanguages),
referencePublication: JSON.stringify(softExtData.referencePublication)
Copy link
Collaborator

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 => {
Copy link
Collaborator

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 :

Suggested change
return arrayValue.map((halThing): ScholarlyArticle => {
return arrayValue.map((halThing): CodeMeta.ScholarlyArticle => {

Comment on lines +50 to +64

// 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;
};
Copy link
Collaborator

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;
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Récupérer les données referencedPublications des software de HAL
2 participants