So far, most of the literature on (quantum) contextuality and the Kochen-Specker theorem seems either to concern particular examples of contextuality, or be considered as quantum logic. Here, we develop a general formalism for contextuality scenarios based on the combinatorics of hypergraphs, which significantly refines a similar recent approach by Cabello, Severini and Winter (CSW). In contrast to CSW, we explicitly include the normalization of probabilities, which gives us a much finer control over the various sets of probabilistic models like classical, quantum and generalized probabilistic. In particular, our framework specializes to (quantum) nonlocality in the case of Bell scenarios, which arise very naturally from a certain product of contextuality scenarios due to Foulis and Randall. In the spirit of CSW, we find close relationships to several graph invariants. The recently proposed Local Orthogonality principle turns out to be a special case of a general principle for contextuality scenarios related to the Shannon capacity of graphs. Our results imply that it is strictly dominated by a low level of the Navascués-Pironio-Acín hierarchy of semidefinite programs, which we also apply to contextuality scenarios. We derive a wealth of results in our framework, many of these relating to quantum and supraquantum contextuality and nonlocality, and state numerous open problems. For example, we show that the set of quantum models on a contextuality scenario can in general not be characterized in terms of a graph invariant. In terms of graph theory, our main result is this: there exist two graphs $${G_1}$$ and $${G_2}$$ with the properties [ABSTRACT FROM AUTHOR]
Copyright of Communications in Mathematical Physics is the property of Springer Nature and its content may not be copied or emailed to multiple sites or posted to a listserv without the copyright holder's express written permission. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)