get_step_triples can't do general type restrictions
Closed this issue · 2 comments
mconlon17 commented
Hmmm. When_step_triples tries to do type assertions, the type assertions may not be in the update graph. Two possible solutions:
- Put all the type assertions for everything in the update graph in the original and update graph. This can be done after the original graph is loaded -- one more query will add all the types of all the subjects in the original graph (all step lengths), or could be done with a more complex construction of the original graph in which types of intermediate objects are fetched as the graph is built. Regardless of original contruction, as processing continues, types are added if entities are added, so the type assertions will always be there. Can this preserve injection functionality?
- Allow get_step_triples to query vivo for triples rather than the update_graph -- that is, get_step_triples would operate the same way for types as for qualifiers. type restriction would just be a simple way to specify qualifiers that rely solely on types.
The first option appears more robust and will be faster -- querying VIVO on individual steps is very slow.
NOTE get_step_triples
passed all unit tests because all unit tests used injected graphs, and those graphs always contained the types of the intermediate objects. In testing against live VIVO, the original
graph did not contain the types of the intermediate objects.
mconlon17 commented
Done. No change needed to code. Once the graph contained the needed type assertions, get_step_triples worked as expected.