{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "@context": [
    "https://schemas.meta-aiml.org/v3.0.0/context.jsonld"
  ],
  "@id": "https://schemas.meta-aiml.org/v3.0.0/archetypes/network_graph.json",
  "@type": [
    "Thing",
    "ArchetypeSchema",
    "NetworkGraph"
  ],
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "NetworkGraph Interaction Archetype",
  "description": "Archetype for peer-centric graph systems where users are the primary value source, user-to-user relationships drive engagement growth, and the platform acts as infrastructure for discovery, communication, and community moderation.",
  "type": "object",
  "properties": {
    "interactionArchetype": {
      "type": "array",
      "description": "NetworkGraph archetype",
      "contains": {
        "const": "NetworkGraph"
      },
      "items": {
        "type": "string",
        "enum": [
          "DirectService",
          "MediatedExchange",
          "NetworkGraph",
          "BroadcastPublisher",
          "ProtocolSystem"
        ]
      },
      "minItems": 1,
      "maxItems": 1
    },
    "structuralMetadata": {
      "type": "object",
      "description": "Structural characteristics of NetworkGraph",
      "required": [
        "topology",
        "roles",
        "valueSource",
        "transactionFlow"
      ],
      "properties": {
        "topology": {
          "type": "string",
          "const": "many_to_many",
          "description": "Many-to-many user network"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "const": "user"
          },
          "description": "Homogeneous roles: all participants are peers",
          "const": [
            "user",
            "user"
          ]
        },
        "valueSource": {
          "type": "string",
          "const": "user_generated",
          "description": "Value comes from users, not platform"
        },
        "transactionFlow": {
          "type": "string",
          "const": "peer_to_peer",
          "description": "User-to-user interactions"
        },
        "networkEffects": {
          "type": "string",
          "const": "same_side",
          "description": "Same-side network effects"
        },
        "contentOwnership": {
          "type": "string",
          "const": "users",
          "description": "Users own their content"
        }
      }
    },
    "socialGraphCharacteristics": {
      "type": "object",
      "description": "Social network characteristics (semantic, not operational flags)",
      "required": [
        "userContentModel",
        "connections",
        "engagement"
      ],
      "properties": {
        "userContentModel": {
          "type": "string",
          "const": "user_generated_content",
          "description": "Core value from user-generated content"
        },
        "graphStructure": {
          "type": "string",
          "const": "social_graph_enabled",
          "description": "Network of user connections exists"
        },
        "networkEffectType": {
          "type": "string",
          "const": "same_side_critical",
          "description": "Network effects are critical to platform value"
        },
        "metricsEmphasis": {
          "type": "string",
          "const": "engagement_over_transactions",
          "description": "Engagement metrics rank higher than transaction counts"
        },
        "platformRole": {
          "type": "string",
          "const": "facilitator_users_create",
          "description": "Platform facilitates, users create value"
        },
        "connections": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "follow",
              "friend",
              "match",
              "subscribe",
              "group_member"
            ]
          },
          "description": "Types of user-to-user connections"
        },
        "engagement": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "posting",
              "commenting",
              "sharing",
              "reacting",
              "messaging"
            ]
          },
          "description": "User engagement mechanisms"
        }
      }
    },
    "requiredCapabilities": {
      "type": "array",
      "description": "Mandatory capability groups for NetworkGraph: interaction, content (for UGC), and community (for groups/structures)",
      "items": {
        "type": "string"
      },
      "uniqueItems": true,
      "minItems": 3,
      "allOf": [
        {
          "contains": {
            "const": "interaction"
          }
        },
        {
          "contains": {
            "const": "content"
          }
        },
        {
          "contains": {
            "const": "community"
          }
        }
      ]
    },
    "interactionRequirements": {
      "type": "object",
      "description": "Social interaction features (semantic, not operational flags)",
      "required": [
        "socialConnectivity",
        "messaging",
        "contentSharing"
      ],
      "properties": {
        "socialConnectivity": {
          "type": "string",
          "const": "social_graph_implementation",
          "description": "Social connections between users"
        },
        "feed": {
          "type": "string",
          "const": "activity_feed_enabled",
          "description": "User activity feed showing network updates"
        },
        "messaging": {
          "type": "string",
          "const": "user_to_user_messaging",
          "description": "Direct messaging between users"
        },
        "contentSharing": {
          "type": "string",
          "const": "share_content_network",
          "description": "Share content with network"
        },
        "notifications": {
          "type": "string",
          "const": "activity_notifications",
          "description": "Notifications of network activity"
        },
        "matching": {
          "type": "string",
          "const": "user_matching_optional",
          "description": "Optional user matching (for dating, etc.)"
        },
        "connectionTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Types of connections users can form"
        }
      }
    },
    "contentRequirements": {
      "type": "object",
      "description": "Content management for user-generated content (semantic, not operational flags)",
      "required": [
        "contentModel",
        "moderation"
      ],
      "properties": {
        "contentModel": {
          "type": "string",
          "const": "user_generated_content_enabled",
          "description": "Supports user-generated content posting"
        },
        "contentTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "examples": [
            "text",
            "image",
            "video",
            "link",
            "poll"
          ],
          "description": "Supported content format types"
        },
        "interactionMechanisms": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "posting",
              "commenting",
              "reactions",
              "sharing"
            ]
          },
          "description": "Ways users can interact with content"
        },
        "moderation": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "community_moderation",
              "ai_assisted",
              "human_moderation",
              "hybrid"
            ]
          },
          "minItems": 1,
          "uniqueItems": true,
          "description": "Content moderation strategies"
        }
      }
    },
    "communityRequirements": {
      "type": "object",
      "description": "Community and group features (semantic, not operational flags)",
      "properties": {
        "grouping": {
          "type": "string",
          "enum": [
            "groups_enabled",
            "channels_enabled",
            "communities_enabled"
          ],
          "description": "User community organization model"
        },
        "discovery": {
          "type": "string",
          "enum": [
            "search_only",
            "with_recommendations",
            "algorithmic_discovery"
          ],
          "description": "How users discover others and communities"
        },
        "privacyModel": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "public",
              "friends_only",
              "private"
            ]
          },
          "description": "Privacy level options available"
        }
      }
    },
    "philosophyAndComparison": {
      "type": "object",
      "description": "Conceptual positioning of NetworkGraph",
      "properties": {
        "definition": {
          "type": "string",
          "const": "NetworkGraph is the archetype where users form direct peer-to-peer connections and interact. Platform acts as social infrastructure enabling user-to-user communication. Unlike DirectService (platform delivers), NetworkGraph empowers users to create value."
        },
        "vs_DirectService": {
          "type": "string",
          "const": "DirectService: platform→consumer (one direction). NetworkGraph: user↔user (many directions, peer-driven)."
        },
        "vs_MediatedExchange": {
          "type": "string",
          "const": "MediatedExchange: platform controls transactions (escrow, payments). NetworkGraph: users own interactions; platform only facilitates."
        },
        "vs_BroadcastPublisher": {
          "type": "string",
          "const": "BroadcastPublisher: one publisher, many passive consumers. NetworkGraph: many users, active connections, peer participation."
        }
      }
    },
    "examples": {
      "type": "array",
      "description": "Example platforms using NetworkGraph",
      "items": {
        "type": "string"
      },
      "examples": [
        "Facebook (social connections)",
        "LinkedIn (professional network)",
        "Dating apps (user matching)",
        "Reddit (community discussions)",
        "Discord (user communities)",
        "Nextdoor (neighborhood network)"
      ]
    }
  },
  "required": [
    "interactionArchetype",
    "structuralMetadata"
  ],
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "phase_1",
    "status": "draft",
    "lastValidated": "2026-02-19",
    "validator": "META-AIML QA"
  },
  "$id": "https://schemas.meta-aiml.org/v3.0.0/archetypes/network_graph.json",
  "allOf": [
    {
      "if": {
        "properties": {
          "interactionArchetype": {
            "contains": {
              "const": "NetworkGraph"
            }
          }
        }
      },
      "then": {
        "required": [
          "capabilities"
        ],
        "properties": {
          "capabilities": {
            "type": "object",
            "required": [
              "interaction",
              "content",
              "community"
            ],
            "properties": {
              "interaction": {
                "$ref": "../components/capability_groups.json#/$defs/InteractionCapabilities"
              },
              "content": {
                "$ref": "../components/capability_groups.json#/$defs/ContentCapabilities"
              },
              "community": {
                "$ref": "../components/capability_groups.json#/$defs/CommunityCapabilities"
              }
            }
          }
        }
      }
    }
  ],
  "semanticAnnotations": {
    "classificationRationale": "NetworkGraph archetype schema aligned with META-AIML v3 structural completeness rules.",
    "disambiguationNotes": "Ontology and archetype constraints are encoded for machine-verifiable validation."
  },
  "governanceMetadata": {
    "schemaVersion": "3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-AR-NETWOR-001: interactionArchetype MUST contain NetworkGraph",
      "RULE-AR-NETWOR-002: structuralMetadata const fields MUST match archetype definition",
      "RULE-AR-NETWOR-003: capabilities MUST include interaction, content, community"
    ]
  },
  "examples": [
    {
      "scenario": "NetworkGraph archetype reference usage #1",
      "note": "Demonstrates canonical structure and required constraints."
    },
    {
      "scenario": "NetworkGraph archetype reference usage #2",
      "note": "Demonstrates compliant alternative while preserving ontology/archetype semantics."
    }
  ]
}
