Applied legal epistemology. Building a knowledge-based ontology of the legal domain