Ontologies are generalized semantic data models, while a knowledge graph is what we get when we leverage that model and apply it to instance data.
Felix