Open ehennestad opened 1 month ago
Yes, some overlap. readjsonfilelocation is more tolerant (one can say 'base' and it will find the 'base.json' file wherever it lives), whereas the get_document_schema expects (and we should insist on) a full path that may include a $PATH definition. We don't want get_document_schema to look around like readjsonfilelocation; we want it to find the precise schema specified. (Basically, cases b and c from readjsonfilelocation.)
The following functions seem to have some overlap:
in
did.document/readjsonfilelocation
: https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/document.m#L728in
did.database/get_document_schema
https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/database.m#L1051did.common.utility. replace_didpath
https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/%2Bcommon/%2Butility/replace_didpath.m#L1Any other places?
Could consolidate this into a set of utility functions.