An ontology is created in a similar way as a d3web knowledge base using the knowledgebase markup.
%%knowledgebase %
A more detailed description of this markup can be found on the page Doc KnowledgeFormalization.