Open in TheBrain

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:

"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:

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]

LeagueTeamYears
[League][Team Thought][Years]

Source: [StatsCrew — [Location]]([StatsCrew Location URL])

Formatting Rules

text(style="...")

Thought-Matching Workflow

For every team franchise in the source list:

  1. Search the Baseball brain for an existing thought with the franchise name.
  2. Prefer an existing franchise-level thought whose name does not include a season or year.
  3. Do not use a year-specific thought as the franchise link when a franchise-level thought exists.
  4. If no franchise-level thought exists, create one using the team franchise name from the source.
  5. Link the franchise thought as a child of the location thought.
  6. Preserve any existing relationships the franchise thought already has.
  7. Do not delete or replace existing year-specific team thoughts.
  8. 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:

  1. Obtain the franchise’s resource URL from the pasted source data.
  2. Attach that URL to the corresponding franchise thought.
  3. Use a descriptive attachment title, such as:

StatsCrew — [Team Name]

  1. Do not place the StatsCrew team URL in the location table.
  2. 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:

If a thought ID cannot be resolved or a valid internal link cannot be generated:

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:

Completion Checklist

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.