Separate class finalization from Universal Translator
aamedina opened this issue · 1 comments
Problem:
The Universal Translator component does too much right now. If people want to use a metaobject protocol it isn't clear how to effectively configure it. I think it was useful to develop the MOP but now it presents a challenge introducing the technology to other people. I want to perform the minimum amount of metaobject inferencing when bootstrapping instead and move the full MOP (which does class finalization on every loaded OWL class) into its own component. I originally did write it like this but the cyclic dependencies of the RDF module and MOP module made it convenient to move everything into one library.
Solution:
The essential elements of the MOP I have found are:
- compute-class-precedence-list / class-precedence-list
- compute-slots / class-slots / class-direct-slots
- class-direct-subclasses / class-direct-superclasses
In the MOP RDF vocabulary these are represented by the following RDF properties:
- :mop/classPrecedenceList
- :mop/classSlots / :mop/classDirectSlots
- :mop/classDirectSubclasses
class-direct-superclasses just looks at :rdfs/subClassOf so it doesn't need to be materialized beyond RDFS.
The approach I am considering taking during bootstrap is as follows:
- Gather your vocabulary by requiring Clojure namespaces that represent RDF models
- Transact all of the vocabulary into Asami local storage "asami:local://.vocab"
- Query Asami for all classes (not individuals)
- Run the "poor mans" finalize in parallel materializing those essential properties per class.
- Transact the updated metaobjects into Asami which becomes your RDF graph
After integrating Asami I decided against this