Skip to content

Commit

Permalink
term parsing, termType -> concept, old term is glossaryTerm
Browse files Browse the repository at this point in the history
  • Loading branch information
brianorwhatever committed Oct 29, 2023
1 parent d804b16 commit c447f24
Show file tree
Hide file tree
Showing 29 changed files with 91 additions and 54 deletions.
Binary file modified bun.lockb
Binary file not shown.
5 changes: 3 additions & 2 deletions curated-texts/Home.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Home
termType: term
glossaryTerm: Home
term: home
termType: concept
---
Welcome to the [Human Experience Working Group](https://wiki.trustoverip.org/x/_RIB) (HXWG) [terms wiki](https://github.com/trustoverip/hxwg/wiki/terms-wiki)! This is where the HXWG [terms community](https://github.com/trustoverip/ctwg/wiki/terms-community) manages the "bootstrap" terminology needed for its own documentation and tools.

Expand Down
5 changes: 3 additions & 2 deletions curated-texts/Minimum-Virtuous-Product-(MVirP).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Minimum Virtuous Product (MVirP)
termType: term
glossaryTerm: Minimum Virtuous Product (MVirP)
term: minimum-virtuous-product
termType: concept
glossaryText: >-
A method of product development that tests for the effects on stakeholders and
builds in guards against potential harms. Defined by Hemant Taneja,[ The Era
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/P2P-Decision-Context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: P2P Decision Context
termType: term
glossaryTerm: P2P Decision Context
term: p2p-decision-context
termType: concept
glossaryText: >-
Single or chained peer-to-peer interactions or
[transactions](https://essif-lab.github.io/framework/docs/essifLab-glossary#transaction)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/PESTEL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: PESTEL
termType: term
glossaryTerm: PESTEL
term: pestel
termType: concept
glossaryText: >-
Political, Economic, Sociocultural, Technological, Environmental and Legal - a
method of business analysis, see [PESTEL
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/balance-of-power.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Balance Of Power
termType: term
glossaryTerm: Balance Of Power
term: balance-of-power
termType: concept
glossaryText: >-
A balance of power in a [digital identity
ecosystem](https://trustoverip.github.io/hxwg/glossary.html#digital-identity-ecosystem)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/collective-resiliency.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Collective Resiliency
termType: term
glossaryTerm: Collective Resiliency
term: collective-resiliency
termType: concept
glossaryText: >-
Collective resiliency is the ability of the [digital identity
ecosystem](https://trustoverip.github.io/hxwg/glossary.html#digital-identity-ecosystem)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/complex-adaptive-system-(CAS).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Complex Adaptive System (CAS)
termType: term
glossaryTerm: Complex Adaptive System (CAS)
term: complex-adaptive-system
termType: concept
glossaryText: >-
A group of semi-autonomous agents who interact in interdependent ways to
produce system-wide patterns, such that those patterns then influence
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/contingent-harm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Contingent Harm
termType: term
glossaryTerm: Contingent Harm
term: contingent-harm
termType: concept
glossaryText: >-
Contingent harms arise in the [digital identity
ecosystem](https://trustoverip.github.io/hxwg/glossary.html#digital-identity-ecosystem)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/digital-identity-ecosystem-(DIE).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Digital Identity Ecosystem (DIE)
termType: term
glossaryTerm: Digital Identity Ecosystem (DIE)
term: digital-identity-ecosystem
termType: concept
glossaryText: >-
A set of at least two (autonomous)
[parties](https://essif-lab.github.io/framework/docs/essifLab-glossary#party)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/digital-identity.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Digital Identity
termType: term
glossaryTerm: Digital Identity
term: digital-identity
termType: concept
glossaryText: >-
[Digital
data](https://essif-lab.github.io/framework/docs/essifLab-glossary#data) that
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/digital-trust-ecosystem-(DTE).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Digital Trust Ecosystem (DTE)
termType: term
glossaryTerm: Digital Trust Ecosystem (DTE)
term: digital-trust-ecosystem
termType: concept
glossaryText: >-
See ToIP core terms [digital trust ecosystem
(DTE)](https://trustoverip.github.io/toip/glossary.html#digital-trust-ecosystem)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/direct-harm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Direct Harm
termType: term
glossaryTerm: Direct Harm
term: direct-harm
termType: concept
glossaryText: >-
Direct harm is the intentional or unintentional harm that is inflicted by one
[peer
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/edge-agency.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Edge Agency
termType: term
glossaryTerm: Edge Agency
term: edge-agency
termType: concept
glossaryText: >-
Edge agency is the ability of all
[parties](https://essif-lab.github.io/framework/docs/essifLab-glossary#party)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/external-life-context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: External Life Context
termType: term
glossaryTerm: External Life Context
term: external-life-context
termType: concept
glossaryText: >-
Other: The world outside the [digital identity
ecosystem](https://trustoverip.github.io/hxwg/glossary.html#digital-identity-ecosystem)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/felt-harm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Felt Harm
termType: term
glossaryTerm: Felt Harm
term: felt-harm
termType: concept
glossaryText: >-
Felt harms affect the physical and mental health and wellbeing of the harmed
[party]([https://essif-lab.github.io/framework/docs/essifLab-glossary#](https://essif-lab.github.io/framework/docs/essifLab-glossary#party)party)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/harms-work.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Harms Work
termType: term
glossaryTerm: Harms Work
term: harms-work
termType: concept
glossaryText: >-
Efforts to characterize, detect, prevent, intervene in, remediate, and learn
from human harms rising from ToIP-related technologies.
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/indirect-harm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Indirect Harm
termType: term
glossaryTerm: Indirect Harm
term: indirect-harm
termType: concept
glossaryText: >-
Indirect harm is the intentional or unintentional harm that is experienced by
one or more members of the [digital identity
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/internal-life-context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Internal Life Context
termType: term
glossaryTerm: Internal Life Context
term: internal-life-context
termType: concept
glossaryText: >-
Self: The world inside human beings as individuals and as social groups. The
physiological, psychological and spiritual world, of thoughts, stories,
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/man-made-thing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Man Made Thing
termType: term
glossaryTerm: Man Made Thing
term: man-made-thing
termType: concept
glossaryText: >-
From [Sovrin Foundation Glossary
V3](https://docs.google.com/document/d/1gfIz5TT0cNp2kxGMLFXr19x1uoZsruUe_0glHst2fZ8/edit).
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/natural-thing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Natural Thing
termType: term
glossaryTerm: Natural Thing
term: natural-thing
termType: concept
glossaryText: >-
From [Sovrin Foundation Glossary
V3](https://docs.google.com/document/d/1gfIz5TT0cNp2kxGMLFXr19x1uoZsruUe_0glHst2fZ8/edit).
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/peer-to-peer-(P2P).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Peer To Peer (P2P)
termType: term
glossaryTerm: Peer To Peer (P2P)
term: peer-to-peer
termType: concept
glossaryText: >-
Peer to Peer originally used to describe computer networks where each
participant acts as both a client and server. Can also refer to any 1:1
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/self-sovereign-identity-(SSI).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Self Sovereign Identity (SSI)
termType: term
glossaryTerm: Self Sovereign Identity (SSI)
term: self-sovereign-identity
termType: concept
glossaryText: >-
See Trust over IP [self-sovereign
identity](https://trustoverip.github.io/toip/glossary.html#self-sovereign-identity)
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/socio-technical-system-(STS).md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Socio Technical System (STS)
termType: term
glossaryTerm: Socio Technical System (STS)
term: socio-technical-system
termType: concept
glossaryText: >-
An approach to complex organizational work design that recognizes the
interaction between people and technology in workplaces. The term also refers
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/thing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Thing
termType: term
glossaryTerm: Thing
term: thing
termType: concept
glossaryText: >-
From [Sovrin Foundation Glossary
V3](https://docs.google.com/document/d/1gfIz5TT0cNp2kxGMLFXr19x1uoZsruUe_0glHst2fZ8/edit).
Expand Down
5 changes: 3 additions & 2 deletions curated-texts/vulnerability-recognition.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
term: Vulnerability Recognition
termType: term
glossaryTerm: Vulnerability Recognition
term: vulnerability-recognition
termType: concept
glossaryText: >-
Vulnerability recognition is one of four harms mitigation strategies in the
human harms framework. It is
Expand Down
1 change: 1 addition & 0 deletions src/CuratedText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface CuratedTextOptions {
term: string;
termType: string;
isa?: string;
glossaryTerm?: string;
glossaryText?: string;
synonymOf?: string;
groupTags?: string[];
Expand Down
12 changes: 8 additions & 4 deletions src/Run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CuratedTextParser } from "./CuratedText.js";
import { fileURLToPath } from "url";
import {
filenameToTitle,
filenameToTerm,
getFileContents,
removeNullValues,
saveToFile,
Expand All @@ -22,7 +23,7 @@ import figlet from "figlet";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const packageJson = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "package.json"), "utf8")
fs.readFileSync(path.resolve(__dirname, "../package.json"), "utf8")
);
const version = packageJson.version;
const program = new Command();
Expand Down Expand Up @@ -79,6 +80,9 @@ const main = async (): Promise<void> => {
console.log(
chalk.red(figlet.textSync("TEv2 Ingress", { horizontalLayout: "full" }))
);
console.log(
chalk.yellow(figlet.textSync(version, { horizontalLayout: "full" }))
);

if (options.config) {
try {
Expand Down Expand Up @@ -129,10 +133,10 @@ const main = async (): Promise<void> => {
}
files.forEach((file) => {
const newFile = file.replace("wiki", "curated-texts");
console.log("-------------------------------------");
const curatedText = new CuratedTextParser(getFileContents(file), {
term: filenameToTitle(file),
termType: "term",
glossaryTerm: filenameToTitle(file),
term: filenameToTerm(file),
termType: "concept",
});
curatedText.toYAML();
console.log(file, "->", newFile);
Expand Down
7 changes: 7 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const extractTokens = (text: string): MarkdownData => {

export function filenameToTitle(filename: string): string {
// Remove the directory path and file extension
console.log(filename)
const baseFilename = filename.replace(/^.*\//, '').replace(/\.md$/, '');

// Split the filename into words using '-' as a delimiter
Expand All @@ -73,5 +74,11 @@ export function filenameToTitle(filename: string): string {
return title;
}

export function filenameToTerm(filename: string): string {
return filename
.replace(/\(.*?\)/g, "").replace(/^.*\//, '')
.replace(/\.md$/, '').replace(/-$/, "")
.toLowerCase();
}

export const getFileContents = (filePath: string): string => fs.readFileSync(filePath, 'utf-8');

0 comments on commit c447f24

Please sign in to comment.