Use rdf quadnames as polymorphic types. Also some refactoring, and include ontology.