Member Junction
    Preparing search index...

    Engine that computes and queries tag co-occurrence data.

    Co-occurrence measures how often two tags appear together on the same item. This data powers tag relationship analysis, "related tags" suggestions, and word-cloud / network-graph visualizations.

    Pairs are stored in canonical order (TagAID < TagBID by normalized UUID) so each pair is recorded exactly once.

    const engine = TagCoOccurrenceEngine.Instance;

    // Full recompute
    const result = await engine.RecomputeCoOccurrence(contextUser);
    console.log(`Updated ${result.PairsUpdated}, deleted ${result.PairsDeleted}`);

    // Get top co-occurring pairs
    const topPairs = await engine.GetTopPairs(10, contextUser);

    // Get tags that co-occur with a specific tag
    const related = await engine.GetCoOccurrencesForTag(tagID, contextUser);

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get GlobalKey(): string

      Returns string

    • get Provider(): IMetadataProvider

      Optional metadata provider override. Callers should set instance.Provider = providerToUse before invoking engine methods in multi-provider contexts. Falls back to the global default provider when unset.

      Returns IMetadataProvider

    • set Provider(value: IMetadataProvider): void

      Parameters

      Returns void

    Methods

    • Get all tags that co-occur with a specific tag, sorted by count descending.

      This looks up all co-occurrence pairs where the given tag appears as either TagA or TagB, and returns the "other" tag in each pair along with the co-occurrence count.

      Parameters

      • tagID: string

        The tag ID to find co-occurrences for

      • contextUser: UserInfo

        The user context for server-side data operations

      Returns Promise<CoOccurrenceForTag[]>

      Array of co-occurring tags sorted by count descending

    • The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.

      Returns GlobalObjectStore

    • Get the top N co-occurring tag pairs by count, with resolved tag names.

      Parameters

      • limit: number

        Maximum number of pairs to return

      • contextUser: UserInfo

        The user context for server-side data operations

      Returns Promise<CoOccurrencePairDisplay[]>

      Array of pairs sorted by co-occurrence count descending

    • Recompute all tag co-occurrence counts from scratch.

      This method scans both ContentItemTag records (where TagID is not null) and TaggedItem records to build a complete picture of which tags appear together on the same item/record. It then upserts co-occurrence counts and removes stale pairs.

      Parameters

      • contextUser: UserInfo

        The user context for server-side data operations

      Returns Promise<CoOccurrenceComputeResult>

      A summary of how many pairs were updated and how many were deleted

    • Returns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.

      Type Parameters

      Parameters

      • this: new () => T
      • OptionalclassName: string

      Returns T