Skip to content

Mots-clefs

Les mots-clefs peuvent s'associer à une base de données, à un projet ou à une nuée et servent pour indexer et retrouver les données dans le réseau Constellation.

Général

Actions générales pour gérer vos mot-clefs.

client.motsClefs.suivreMotsClefs({ f })

Recherche les mots-clefs appartenant au compte présent. Pour rechercher des mots-clefs d'autres utilisateurs sur le réseau Constellation, voir la section réseau.

Paramètres

NomTypeDescription
f(motsClefs: string[]) => voidCette fonction sera appelée avec la liste des identifiants des mot-clefs chaque fois que celle-ci est modifiée.

Retour

TypeDescription
Promise<() => Promise<void>>Fonction à appeler pour arrêter le suivi.

Exemple

ts
import { ref } from "vue";

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const motsClefs = ref<string[]>();
await client.motsClefs.suivreMotsClefs({ f: x => motsClefs.value = x });

client.motsClefs.créerMotClef({ épingler })

Crée un nouveau mot-clef.

Paramètres

NomTypeDescription
épinglerbooleanSi nous épinglons le nouveau mot-clef. Vrai par défaut.

Retour

TypeDescription
Promise<string>L'identifiant du nouveau mot-clef.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();

client.motsClefs.copierMotClef({ idMotClef })

Crée une copie d'un mot-clef.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef à copier.

Retour

TypeDescription
Promise<string>L'identifiant du nouveau mot-clef.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
const idCopie = await client.motsClefs.copierMotClef({ idMotClef });

client.motsClefs.inviterAuteur({ idMotClef, idCompteAuteur, rôle })

Inviter une autre utilisatrice à modifier un mot-clef vous appartenant. Attention ! Une fois invitée, une personne ne peut pas être désinvitée.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
idCompteAuteurstringL'identifiant du compte de la personne à inviter.
rôle`"MODÉRATEUR""MEMBRE"`

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.inviterAuteur({ 
    idMotClef, 
    idCompteAuteur: "idDuCompteDeMonAmiÀQuiJeFaisConfiance",
    rôle: "MODÉRATEUR" 
});

client.motsClefs.effacerMotClef({ idMotClef })

Effacer un mot-clef. Étant donné la structure distribuée de Constellation, cette action effacera le mot-clef de votre dispositif, mais ne pourra pas forcer les autres membres du réseau à l'effacer également.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef à effacer.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.effacerMotClef({ idMotClef });

client.motsClefs.suivreQualitéMotClef({ idMotClef })

Suivre une mesure (subjective, de 0 à 1) de la qualité d'un mot-clef. 1 indique la meilleure qualité.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
f(qualité: number) => voidUne fonction qui sera appelée avec la qualité du mot-clef chaque fois que celle-ci change.

Retour

TypeDescription
Promise<() => Promise<void>>Fonction à appeler pour arrêter le suivi.

Exemple

ts
import { ref } from "vue";

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();

const qualité = ref<number>();
const fOublierSuivi = await client.motsClefs.suivreQualitéMotClef({ 
    idMotClef,
    f: x => qualité.value = x
});

Noms

Dans Constellation, chaque mot-clef est défini par un code identifiant et peut ensuite être nommé dans autant de langues que vous le souhaitez.

client.motsClefs.sauvegarderNomMotClef({ idMotClef, langue, nom })

Sauvegarde le nom du mot-clef dans une langue donnée.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
nomstringLe nom du mot-clef.
languestringLa langue du nom.

Exemple

ts

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.sauvegarderNomMotClef({
    idMotClef, 
    langue: "fr", 
    nom: "Hydrologie" 
});

client.motsClefs.sauvegarderNomsMotClef({ idMotClef, noms })

Sauvegarde le nom du mot-clef dans plusieurs langues en même temps.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
noms{ [langue: string]: string }Les noms du mot-clef, indexés par langue.

Exemple

ts

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.sauvegarderNomsMotClef({ 
    idMotClef, 
    noms: { fr: "Hydrologie", த: "நீரியல்"}
});

client.motsClefs.effacerNomMotClef({ idMotClef, langue })

Efface la traduction du nom du mot-clef dans une langue donnée.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
languestringLa langue dont ont doit effacer le nom.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.effacerNomMotClef({ idMotClef, langue: "fr" });

client.motsClefs.suivreNomsMotClef({ idMotClef, f })

Suit les noms (traduits en différentes langues) du mot-clef.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
f(noms: { [langue: string]: string }) => voidUne fonction qui sera appelée avec les noms du mot-clef chaque fois qu'ils changent

Retour

TypeDescription
Promise<() => Promise<void>>Fonction à appeler pour arrêter le suivi.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();

const fOublierNoms = await client.motsClefs.suivreNomsMotClef({ 
    idMotClef,
    f: async noms => {
        console.log(noms);
        await fOublierNoms();
    }
});

await client.motsClefs.sauvegarderNomsMotClef({ 
    idMotClef, 
    noms: { fr: "Hydrologie", த: "நீரியல்"}
});

Descriptions

Dans Constellation, chaque mot-clef peut aussi être accompagné d'une description plus informative.

client.motsClefs.sauvegarderDescriptionMotClef({ idMotClef, langue, nom })

Sauvegarde la description du mot-clef dans une langue donnée.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
descriptionstringLa description du mot-clef.
languestringLa langue de la description.

Exemple

ts

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.sauvegarderDescriptionMotClef({
    idMotClef, 
    langue: "fr", 
    description: "Données hydrologiques, telles les données fluviales, météorologiques, et autres." 
});

client.motsClefs.sauvegarderDescriptionsMotClef({ idMotClef, descriptions })

Sauvegarde la description d'un mot-clef dans plusieurs langues en même temps.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
descriptions{ [langue: string]: string }Les descriptions du mot-clef, indexées par langue.

Exemple

ts

import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.sauvegarderDescriptionsMotClef({ 
    idMotClef, 
    descriptions: { 
        fr: "Données hydrologiques ou météorologiques", 
        த: "நீரியல் மற்றும் வானிலையியல் தகவல்கள்"
    }
});

client.motsClefs.effacerDescriptionMotClef({ idMotClef, langue })

Efface la traduction d'une description du mot-clef dans une langue donnée.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
languestringLa langue dont ont doit effacer la description.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();
await client.motsClefs.effacerDescriptionMotClef({ idMotClef, langue: "fr" });

client.motsClefs.suivreDescriptionsMotClef({ idMotClef, f })

Suit les descriptions (traduites en différentes langues) du mot-clef.

Paramètres

NomTypeDescription
idMotClefstringL'identifiant du mot-clef.
f(descriptions: { [langue: string]: string }) => voidUne fonction qui sera appelée avec les descriptions du mot-clef chaque fois qu'elles changent

Retour

TypeDescription
Promise<() => Promise<void>>Fonction à appeler pour arrêter le suivi.

Exemple

ts
import { créerConstellation } from "@constl/ipa";
const client = créerConstellation();

const idMotClef = await client.motsClefs.créerMotClef();

const fOublierDescriptions = await client.motsClefs.suivreDescriptionsMotClef({ 
    idMotClef,
    f: async descrs => {
        console.log(descrs);
        await fOublierDescriptions();
    }
});

await client.motsClefs.sauvegarderDescriptionMotClef({ 
    idMotClef, 
    langue: "fr",
    description: "Données hydrologiques"
});

నక్షత్రరాశి సాధారణ ప్రజల జీయెన్యూ ఆఫెరో ౩.౦ అనుజ్ఞలో అందుబాటులో ఉంది.