Lingua:Graphs: Difference between revisions

From OODA WIKI
Jump to navigation Jump to search
AdminIsidore (talk | contribs)
AdminIsidore (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 59: Line 59:
# Edit a glossary term page (e.g., [[Lingua:TestTerm]]).
# Edit a glossary term page (e.g., [[Lingua:TestTerm]]).
# In the `Definition` parameter of `{{GlossaryEntry}}`, mention another term (e.g., "This term relates to Dictum and Scriptum").
# In the `Definition` parameter of `{{GlossaryEntry}}`, mention another term (e.g., "This term relates to Dictum and Scriptum").
<syntaxhighlight lang="wikitext">
{{GlossaryEntry
|Term=TestTerm
|Definition=This is a test term mentioning Dictum and Scriptum.
}}
</syntaxhighlight>
# Save and purge the page by appending `?action=purge` to the URL (e.g., [[Lingua:TestTerm?action=purge]]).
# Save and purge the page by appending `?action=purge` to the URL (e.g., [[Lingua:TestTerm?action=purge]]).
# The graph will update to show an edge to the mentioned term (e.g., from [[Lingua:TestTerm]] to [[Lingua:Dictum]]).
# The graph will update to show an edge to the mentioned term (e.g., from [[Lingua:TestTerm]] to [[Lingua:Dictum]]).
# To make connections bidirectional, ensure terms mention each other (e.g., add "TestTerm" to [[Lingua:Dictum]]’s definition).
# To make connections bidirectional, ensure terms mention each other (e.g., add "TestTerm" to [[Lingua:Dictum]]’s definition).
<syntaxhighlight lang="wikitext">
{{GlossaryEntry
|Term=Dictum
|Definition=Dictum is the smallest unit of Actus within a Scriptum, enabling Fabricatio by an Artifex in AetherOS’s flux. Mentions TestTerm.
}}
</syntaxhighlight>


== Interpreting the Graphs ==
== Interpreting the Graphs ==
Line 74: Line 86:
   * Check the browser console (F12 > Console) for "SMW API error details."
   * Check the browser console (F12 > Console) for "SMW API error details."
   * Verify the SMW API is working by running:
   * Verify the SMW API is working by running:
     ```
     <syntaxhighlight lang="bash">
     curl "https://www.ooda.wiki/api.php?action=askargs&conditions=Category:Glossary%20Entries&printouts=Glossary-Term|Glossary-Definition&parameters=limit=50&format=json&formatversion=2"
     curl "https://www.ooda.wiki/api.php?action=askargs&conditions=Category:Glossary%20Entries&printouts=Glossary-Term|Glossary-Definition&parameters=limit=50&format=json&formatversion=2"
     ```
     </syntaxhighlight>
   * Ensure the gadgets are enabled in [[Special:Preferences#mw-prefsection-gadgets]].
   * Ensure the gadgets are enabled in [[Special:Preferences#mw-prefsection-gadgets]].
* '''Graph Shows "No connections found"''':
* '''Graph Shows "No connections found"''':
Line 83: Line 95:
* '''Labels Missing or Styling Incorrect''':
* '''Labels Missing or Styling Incorrect''':
   * Ensure [[MediaWiki:Common.css]] includes:
   * Ensure [[MediaWiki:Common.css]] includes:
     ```css
     <syntaxhighlight lang="css">
     @font-face {
     @font-face {
         font-family: "IBMPlexMono";
         font-family: "IBMPlexMono";
Line 101: Line 113:
         font-family: "IBMPlexMono", "Courier New", monospace;
         font-family: "IBMPlexMono", "Courier New", monospace;
     }
     }
     ```
     </syntaxhighlight>
   * Purge [[MediaWiki:Common.css]] (`?action=purge`).
   * Purge [[MediaWiki:Common.css]] by appending `?action=purge` to the URL.
* '''Graph Not Updating''':
* '''Graph Not Updating''':
   * Purge the affected page (e.g., [[Lingua:Dictum?action=purge]]).
   * Purge the affected page (e.g., [[Lingua:Dictum?action=purge]]).
   * Run maintenance scripts (as admin):
   * Run maintenance scripts (as admin):
     ```
     <syntaxhighlight lang="bash">
     php maintenance/run.php runJobs
     php maintenance/run.php runJobs
     php maintenance/run.php refreshLinks
     php maintenance/run.php refreshLinks
     php extensions/SemanticMediaWiki/maintenance/rebuildData.php
     php extensions/SemanticMediaWiki/maintenance/rebuildData.php
     ```
     </syntaxhighlight>
* If issues persist, contact an admin with console errors and debug logs:
* If issues persist, contact an admin with console errors and debug logs:
   ```
   <syntaxhighlight lang="bash">
   cat /var/www/mediawiki/debug.log | tail -n 50
   cat /var/www/mediawiki/debug.log | tail -n 50
   ```
   </syntaxhighlight>


== Enhancing the Glossary ==
== Enhancing the Glossary ==
Line 122: Line 134:
# Edit those terms’ pages to add mentions of other terms in their `Glossary-Definition`.
# Edit those terms’ pages to add mentions of other terms in their `Glossary-Definition`.
# Example: To connect [[Lingua:TestTerm]], edit its definition:
# Example: To connect [[Lingua:TestTerm]], edit its definition:
 
  <syntaxhighlight lang="wikitext">
<nowiki>
   {{GlossaryEntry
   {{GlossaryEntry
   |Term=TestTerm
   |Term=TestTerm
   |Definition=This is a test term mentioning Dictum and Scriptum.
   |Definition=This is a test term mentioning Dictum and Scriptum.
   }}
   }}
</nowiki>
  </syntaxhighlight>
 
# Purge the page and check [[Lingua:Global Glossary Graph]] for updated connections.
# Purge the page and check [[Lingua:Global Glossary Graph]] for updated connections.


<includeonly>[[Category:Documentation]]</includeonly>
<includeonly>[[Category:Documentation]]</includeonly>

Latest revision as of 17:06, 30 August 2025

Glossary Graphs Manual[edit]

This page provides instructions for using and interpreting the glossary graphs on the OODA.wiki, which visualize connections between terms in using the SemanticMediaWiki properties `Glossary-Term` and `Glossary-Definition`. The graphs are powered by two gadgets: `GlossaryGraph` for individual term graphs and `GlobalGlossaryGraph` for a comprehensive graph of all glossary terms. Both are rendered in a retro IBM terminal aesthetic (green-on-black, monospaced font).

Overview[edit]

Glossary graphs display relationships between terms based on mentions in their `Glossary-Definition` properties. Each term in is a node, and an edge is drawn when one term's definition mentions another term. For example, if Lingua:TestTerm's definition mentions "Dictum," an edge connects Lingua:TestTerm to Lingua:Dictum.

  • Individual Graphs: Appear on each glossary term page (e.g., Lingua:Dictum) under the "Semantic Graph" section, showing connections to terms that mention the current term in their definitions.
  • Global Graph: Displayed at Lingua:Global Glossary Graph, showing all glossary terms and their connections.

Both graphs use the D3.js library for interactivity (draggable nodes) and are styled with green nodes (#00CC00), green lines (#00FF00), green labels (#00FF00), and a black background (#000000).

Setup[edit]

The graphs rely on the following components, which are already configured:

  • SemanticMediaWiki (SMW): Stores `Glossary-Term` and `Glossary-Definition` properties for pages in .
  • Template:GlossaryEntry: Defines glossary terms with `Term` and `Definition` parameters, setting SMW properties.
  • Gadgets: `GlossaryGraph` and `GlobalGlossaryGraph` are enabled in MediaWiki:Gadgets-definition.
  • CSS: MediaWiki:Common.css defines the `IBMPlexMono` font for the IBM aesthetic, with `Courier New` as a fallback.
  • D3.js: Loaded from `/var/www/mediawiki/resources/d3.min.js` for graph rendering.

To enable the gadgets:

  1. Go to Special:Preferences#mw-prefsection-gadgets.
  2. Check `GlossaryGraph` and `GlobalGlossaryGraph` under the Gadgets section.
  3. Save preferences.

Usage[edit]

Individual Term Graphs[edit]

  1. Navigate to a glossary term page (e.g., Lingua:Dictum).
  2. Find the "Semantic Graph" section, which contains a `
    `.
  3. The graph shows:
 * A node for the current term (e.g., "Dictum").
 * Nodes for terms whose `Glossary-Definition` mentions the current term (e.g., "TestTerm", "Scriptum").
 * Green lines (#00FF00) connecting related terms.
 * Green node circles (#00CC00) with green labels (#00FF00) in `IBMPlexMono` or `Courier New`.
  1. Interact with the graph:
 * Hover over a node to see its full page title (e.g., "Lingua:Dictum") in a tooltip.
 * Click and drag nodes to reposition them.
  1. If the graph shows "No connections found," no other terms mention the current term in their `Glossary-Definition`.

Global Glossary Graph[edit]

  1. Navigate to Lingua:Global Glossary Graph.
  2. The graph shows:
 * Nodes for all terms in  (e.g., "Dictum", "Scriptum", "Artifex").
 * Edges where one term’s `Glossary-Definition` mentions another term.
 * Same styling as individual graphs (green nodes, lines, labels, black background).
  1. Interact with the graph:
 * Drag nodes to explore connections.
 * Hover for tooltips with full page titles.
 * Isolated nodes (no edges) indicate terms not mentioned in any `Glossary-Definition`, highlighting areas needing additional definitions.

Adding Connections[edit]

To create connections in the graphs:

  1. Edit a glossary term page (e.g., Lingua:TestTerm).
  2. In the `Definition` parameter of `Graphs

Semantic Graph[edit]

Loading graph...

`, mention another term (e.g., "This term relates to Dictum and Scriptum").

{{GlossaryEntry
|Term=TestTerm
|Definition=This is a test term mentioning Dictum and Scriptum.
}}
  1. Save and purge the page by appending `?action=purge` to the URL (e.g., Lingua:TestTerm?action=purge).
  2. The graph will update to show an edge to the mentioned term (e.g., from Lingua:TestTerm to Lingua:Dictum).
  3. To make connections bidirectional, ensure terms mention each other (e.g., add "TestTerm" to Lingua:Dictum’s definition).
{{GlossaryEntry
|Term=Dictum
|Definition=Dictum is the smallest unit of Actus within a Scriptum, enabling Fabricatio by an Artifex in AetherOS’s flux. Mentions TestTerm.
}}

Interpreting the Graphs[edit]

  • Nodes: Represent glossary terms (e.g., "Dictum", "Scriptum"). Labels show the short term name; tooltips show the full page title (e.g., "Lingua:Dictum").
  • Edges: Indicate that one term’s `Glossary-Definition` mentions another term. For example, if Lingua:TestTerm’s definition includes "Dictum," an edge connects "TestTerm" to "Dictum."
  • Isolated Nodes: Terms with no incoming or outgoing edges are not mentioned in any `Glossary-Definition`. These are gaps where definitions can be added to enhance connectivity.
  • Dense Clusters: Indicate highly interconnected terms, suggesting a well-defined concept group.
  • Use the Lingua:Global Glossary Graph to identify isolated nodes or sparse areas needing more definitions.

Troubleshooting[edit]

  • Graph Shows "Error: API request failed":
 * Check the browser console (F12 > Console) for "SMW API error details."
 * Verify the SMW API is working by running:
    curl "https://www.ooda.wiki/api.php?action=askargs&conditions=Category:Glossary%20Entries&printouts=Glossary-Term|Glossary-Definition&parameters=limit=50&format=json&formatversion=2"
 * Ensure the gadgets are enabled in Special:Preferences#mw-prefsection-gadgets.
  • Graph Shows "No connections found":
 * Check if other terms mention the current term in their `Glossary-Definition` at .
 * Verify SMW properties at Special:Browse/:Lingua:Dictum (replace with the term’s page title).
  • Labels Missing or Styling Incorrect:
 * Ensure MediaWiki:Common.css includes:
    @font-face {
        font-family: "IBMPlexMono";
        src: url("https://www.ooda.wiki/resources/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
        font-weight: normal;
        font-style: normal;
    }
    .global-glossary-graph,
    .glossary-graph,
    .documentation,
    .documentation-metadata,
    .documentation-heading,
    .documentation-toolbar,
    .documentation h2,
    .documentation h3,
    .documentation h4 {
        font-family: "IBMPlexMono", "Courier New", monospace;
    }
 * Purge MediaWiki:Common.css by appending `?action=purge` to the URL.
  • Graph Not Updating:
 * Purge the affected page (e.g., Lingua:Dictum?action=purge).
 * Run maintenance scripts (as admin):
    php maintenance/run.php runJobs
    php maintenance/run.php refreshLinks
    php extensions/SemanticMediaWiki/maintenance/rebuildData.php
  • If issues persist, contact an admin with console errors and debug logs:
  cat /var/www/mediawiki/debug.log | tail -n 50

Enhancing the Glossary[edit]

To improve the graphs and address gaps:

  1. Visit Lingua:Global Glossary Graph.
  2. Identify isolated nodes (terms with no edges).
  3. Edit those terms’ pages to add mentions of other terms in their `Glossary-Definition`.
  4. Example: To connect Lingua:TestTerm, edit its definition:
  {{GlossaryEntry
  |Term=TestTerm
  |Definition=This is a test term mentioning Dictum and Scriptum.
  }}
  1. Purge the page and check Lingua:Global Glossary Graph for updated connections.