Skip to content

Knowledge Graph Architecture โ€‹

The knowledge graph (KG) is a graph of SAP developer learning objects โ€” tutorials, concepts, products, tags, missions, and groups โ€” enriched with external resources from curated corpora. Concept pages at /concepts/<slug>/ surface related resources from all corpora, ordered by phase-assigned priority.

Graph structure โ€‹

Nodes include: tutorial, concept, mission, group, product, category, tag, and external-resource types (see corpora below).

Predicates include: teaches, requires, relatedTo, taggedWith, aboutProduct, inCategory, coCompletedWith, partOf, covers.

External resource corpora (Phase 4 series) โ€‹

Each sub-phase adds one corpus with:

  • A fetch-* cron job that fills rows in CommunityEvents (or LearningJourneys, etc.) and links rows to concepts via *ConceptLinks join tables.
  • A type entry in srv/lib/kg-resource-type-config.js with icon, labels, priority, and renderMeta.
  • A union extension in hugo-apps/src/related-graph/types.ts (NodeType + OtherResource.type).
  • A <section data-kg-section="โ€ฆ"> block in the concept detail template srv/lib/templates/concept-detail.ejs, rendered server-side by CAP (srv/lib/concept-detail-render.js) into the concept-<slug> BLOB. (The legacy Hugo concept path โ€” hugo/layouts/concepts/single.html + scripts/fetch-concepts.ts โ€” was retired in #1327.)

Phase 4.1 โ€” Learning journeys (#447) โ€‹

SAP Learning Journeys from learning.sap.com. Weekly cron. Priority 10.

Phase 4.2 โ€” Blog posts (#447 ยง9) โ€‹

SAP Community blog posts. Daily cron. Priority 20.

Phase 4.3 โ€” Discovery missions (#447 ยง8) โ€‹

SAP Discovery Center missions. Weekly cron. Priority 30.

Phase 4.4 โ€” Videos (#447 ยง9) โ€‹

SAP Developers YouTube videos. Daily cron. Priority 40.

Phase 4.5 โ€” API docs (#746) โ€‹

api.sap.com authority documentation. Monthly cron. Priority 50.

Phase 4.6 โ€” Code samples (#747) โ€‹

SAP-samples GitHub repositories. Weekly cron. Priority 60.

Phase 4.7 โ€” Help docs (#748, extended by #860) โ€‹

Documentation from help.sap.com, cap.cloud.sap, ui5.sap.com, and architecture.learning.sap.com (SAP Architecture Center). Weekly cron. Priority 70.

Phase 4.8 โ€” SAP community events (#765) โ€‹

SAP CodeJams, Devtoberfest, TechEd, and user-group events surfaced as community-event graph nodes. Predicate: covers. TTL: date-aware via endDate + 30 days (first live consumer of the reserved grace-period branch introduced in Phase 4.3 for trials).

Sources: Khoros community-groups REST API (CodeJams) and RSS (Devtoberfest). Native fetch โ€” no MCP transport. Vendored JS ports live under srv/lib/events/.

Cron: fetch-community-events, twice-weekly on Mon+Thu 04:31 UTC.

Seed CLI: node scripts/seed-community-events.cjs --commit (also available as AdminService.seedCommunityEvents(commit=true) in the admin UI).

Fields: eventType, source, title, description (synthesized when upstream omits), url, location, scope (local/regional/virtual/ global), virtualOrInPerson, startDate, endDate.

Explicit non-goals: capacity/seat modelling (not in upstream payload), geographic personalization (deferred to a future Users.region field).

Spec: docs/superpowers/specs/2026-07-03-765-phase4.8-community-events.md

SidebarPanel.vue and ExpandedPanel.vue are data-driven since #850. Adding a new corpus requires:

  1. One RESOURCE_TYPE_CONFIG entry in srv/lib/kg-resource-type-config.js
  2. TS union widening in hugo-apps/src/related-graph/types.ts

No per-type v-if / v-else-if branches are needed โ€” the sidebar reads typeConfig from the wire and renders all types generically.

Concept-page layout sections โ€‹

Sections in hugo/layouts/concepts/single.html append in priority order:

#Sectiondata-kg-sectionPhase
1Learning journeyslearning-journeys4.1
2Help docshelp-docs4.7
3Blog postsblog-posts4.2
4Discovery missionsdiscovery-missions4.3
5Videosvideos4.4
6API docsapi-docs4.5
7Code samplessamples4.6
9Code samples (alias)samples4.6
10Upcoming hands-on eventscommunity-events4.8

Resource type config reference โ€‹

See srv/lib/kg-resource-type-config.js โ€” single source of truth for icon, labels, priority, and renderMeta per type. Tests: test/unit/kg-resource-type-config.test.js.