The vast majority of scientific knowledge is represented as mathematical and computational models of natural and engineered phenomena, and to create scientific AI, we must build computational systems that can understand these models. Modeling frameworks create embedded Domain Specific Languages for describing models which are machine readable, but cannot be applied retroactively to existing scientific codes. We will discuss a novel approach to modeling frameworks, SemanticModels.jl, that allows novel models to be expressed in terms of transformations on existing models. Algorithmic manipulation of these models to add capabilities and combine existing models is easy within the framework. Code implementing the novel models is generated, compiled, and executed in an interactive modeling environment. We will discuss how knowledge graphs, category theory, abstract algebra, and program analysis can help analyze software implementing scientific models. This analysis leads to practical tools for helping scientists develop novel models. Examples will be provided in interactive Julia notebooks.