# A world as a graph

The [lens profile](https://github.com/OnlyWorlds/schema-dist/blob/main/profiles/lens.md)'s graph section reads a world as nodes and edges, for one reader, with or without a [lens](/docs/lenses).

The elements a reader sees are the nodes, and each link between them is an edge, one per link field and target: a list that names one element twice is one edge, at its first place. A link held on both ends is two edges, and a Relation is a node with an edge to each party. Room elements, hidden and proposed elements, and map space (Maps, Pins and Markers) are left out unless the reader asks for each by name. A Zone is not map space: it is content that gains its place through linked Markers, so it is a node like any other, in a public graph too; the reading aids are left out too, counted `reading_aid`. A graph without a lens brings them back when the reader asks with the fifth flag (`readingAids`, `reading_aids`, since serial 104; never for a public reader), each marked `reading_aid`, and a lens keeps them only when it names their pair, marked the same. `hidden` and `proposed` are a keeper's, the owner's or a co-builder's (since serial 140), and a co-builder's graph without a lens counts the hidden and proposed elements it leaves out as the owner's does; `not_visible` and `anchor_not_visible` stay the owner's alone, and a public reader asks for nothing. With a lens, the nodes are exactly what the lens kept, and no flag adds to them. So a contributor's or a guest's own hidden element is in a lens's graph when the lens keeps it, marked hidden, and out of a graph without a lens, with no count. A link to an element that is not a node is counted by the reason it is not there, never dropped silently. `outside_lens` counts a link from a kept element to one the reader can see but the lens did not reach, so a tool can draw "3 more links" at the lens's edge. The SDKs read it as `worldGraph` and `world_graph`, and count each element's links in it with `degreeOf` and `degree_of`: "most linked" as the reader sees it, for ranking a search. Degree counts every edge, in or out, once at each node it touches, so a link held on both ends counts 2 at each end and a link to itself counts once; `outDegreeOf` and `out_degree_of` count the distinct nodes an element's own link fields point at, a target in two fields once and itself never. Both count only what the graph holds (the lens profile, since serial 103).