Location Franchise Table Template
This is best called a template rather than a script.
A template defines the repeatable structure, formatting rules, and workflow.
A script would automate the process—searching for thoughts, creating missing thoughts, adding links, attaching URLs, and updating notes.
For your current setup, I recommend creating a reusable Location Franchise Table Template note. Here is a complete draft:
Location Franchise Table Template
Purpose
Create a standardized table showing baseball team franchises that played in a specific location.
The table should:
- List every team franchise associated with the location.
- Include the league or leagues in which each franchise played.
- Include the years the franchise played at that location.
- Link each team name to its corresponding thought inside the Baseball brain.
- Keep external StatsCrew URLs on the individual team thoughts as URL attachments.
- Preserve the StatsCrew location source link in the location thought.
"Location": is a TYPE
Currently there is only one location type. Location . We may consider Location: Foreign
For the location thought for each city and surrounding areas we list all the Major League and Minor League Franchises and under the franchises are the team name - YEAR for each season.
Required Source Data
Use a reliable location source, preferably a StatsCrew “sports places” page.
The source should provide:
- League name or names.
- Team or franchise name.
- Years of operation at the location.
- A resource link for each team franchise.
If the source data has been pasted into the location thought’s notes, read that pasted content directly. Do not rely only on the source page title or a manually summarized list.
Standard Table Format
Teams that played in [Location]
| League | Team | Years |
|---|---|---|
| [League] | [Team Thought] | [Years] |
Source: [StatsCrew — [Location]]([StatsCrew Location URL])
Formatting Rules
- Use a standard Markdown table.
- Use three columns:
- League
- Team
- Years
- Use an en dash (–) for year ranges.
- Preserve multiple leagues in the same cell, separated by commas.
- Use plain text and standard Markdown links.
- Do not use TheBrain inline color wrappers such as:
text(style="...")
- Do not use external StatsCrew URLs as the table’s team links.
- The team name in the table should link to an internal thought in the Baseball brain.
Thought-Matching Workflow
For every team franchise in the source list:
- Search the Baseball brain for an existing thought with the franchise name.
- Prefer an existing franchise-level thought whose name does not include a season or year.
- Do not use a year-specific thought as the franchise link when a franchise-level thought exists.
- If no franchise-level thought exists, create one using the team franchise name from the source.
- Link the franchise thought as a child of the location thought.
- Preserve any existing relationships the franchise thought already has.
- Do not delete or replace existing year-specific team thoughts.
- If an existing franchise thought is already a child of the location thought, do not create a duplicate link.
Franchise Thought Naming
Use the franchise name as listed by the source, without adding unnecessary years.
Examples:
Pawtucket Red Sox
Pawtucket Indians
Pawtucket Rovers
Pawtucket Tigers
Use a year in the thought name only when the source or existing brain structure clearly treats the year as part of the thought’s identity.
StatsCrew URL Workflow
For each franchise:
- Obtain the franchise’s resource URL from the pasted source data.
- Attach that URL to the corresponding franchise thought.
- Use a descriptive attachment title, such as:
StatsCrew — [Team Name]
- Do not place the StatsCrew team URL in the location table.
- Keep the StatsCrew location/source URL in the location thought.
Internal Thought Links
Use TheBrain’s generated internal thought URL format:
brain://api.thebrain.com/[brain-id]/[thought-id]/[thought-name]
Do not manually construct internal URLs.
Generate each internal link with the system’s thought-link generator and use the returned Markdown link exactly as provided.
Example:
Pawtucket Red Sox
Link Validation
Before finalizing the table:
- Confirm that every team name has an internal thought link.
- Confirm that each linked thought exists in the Baseball brain.
- Confirm that each franchise thought is a child of the location thought.
- Confirm that each StatsCrew team URL is attached to the corresponding thought.
- Confirm that the table contains no invalid or guessed brain:// URLs.
- Confirm that external StatsCrew team URLs are not used as table links.
If a thought ID cannot be resolved or a valid internal link cannot be generated:
- Do not guess the URL.
- Do not create a manually constructed brain:// link.
- Report the unresolved team clearly.
- Leave the team as plain text temporarily, or ask for clarification.
Location Source Link
Retain the source link at the bottom of the location note:
Source: [StatsCrew — [Location]]([StatsCrew Location URL])
The source link may remain external because it identifies the location source, not a team thought.
Preservation Rules
When updating a location thought:
- Replace or update only the location franchise table and its related instructions.
- Preserve unrelated notes already present on the location thought unless the user asks for a complete rewrite.
- Do not delete existing team thoughts.
- Do not delete existing links.
- Do not remove existing attachments unless specifically requested.
- Do not overwrite useful team information stored on individual franchise thoughts.
Completion Checklist
- Source list identified
- All teams extracted
- League names preserved
- Years normalized with
endashes - Existing franchise thoughts searched
- Missing franchise thoughts created
- Franchise thoughts linked as children of the location thought
- StatsCrew URLs attached to franchise thoughts
- Internal thought links generated
- Table updated
- External team URLs removed from the table
- Location source URL retained
- Links and attachments validated
A true automation would be a Location Franchise Table Script, but the notes above are a reusable template and operating procedure rather than an executable script.