Generating Ontologies from Templates: A Rule-Based Approach for Capturing Regularity