A central paradigm of polymer physics states that chains in melts behave like random walks as intra- and interchain interactions effectively cancel each other out. Likewise, θ-chains, i.e., chains at the transition from a swollen coil to a globular phase, are also thought to behave like ideal chains, as attractive forces are counterbalanced by repulsive entropic contributions. While the simple mapping to an equivalent Kuhn chain works rather well in most scenarios with corrections to scaling, random walks do not accurately capture the topology and knots, particularly for flexible chains. In this paper, we demonstrate with Monte Carlo and molecular dynamics simulations that chains in polymer melts and θ-chains not only agree on a structural level for a range of stiffnesses but also topologically. They exhibit similar knotting probabilities and knot sizes, both of which are not captured by ideal chain representations. This discrepancy comes from the suppression of small knots in real chains, which is strongest for very flexible chains because excluded volume effects are still active locally and become weaker with increasing semiflexibility. Our findings suggest that corrections to ideal behavior are indeed similar for the two scenarios of real chains and that the structure and topology of a chain in a melt can be approximately reproduced by a corresponding θ-chain.