def compare_json(shex_url: str, shex_json: str, log: Logger) -> bool:
json_url = shex_url.rsplit("<STR_LIT:.>", <NUM_LIT:1>)[<NUM_LIT:0>] + "<STR_LIT>"<EOL>if '<STR_LIT::>' in json_url:<EOL><INDENT>resp = requests.get(json_url)<EOL>if not resp.ok:<EOL><INDENT>return False<EOL><DEDENT>json_text = resp.text<EOL><DEDENT>else:<EOL><INDENT>with open(json_url) as f:<EOL><INDENT>json_text = f.read()<EOL><DEDENT><DEDENT>d1 = jao_loads(json_text)<EOL>d2 = jao_loads(shex_json)<EOL>if not compare_dicts(d1._as_dict, d2._as_dict, d1name="<STR_LIT>", d2name="<STR_LIT>", file=log, filtr=json_filtr):<EOL><INDENT>print(d2._as_json_dumps())<EOL>return False<EOL><DEDENT>return True<EOL>
Compare the JSON generated from shex_url to the JSON in the target directory
:param shex_url: URL where we got the ShExC
:param shex_json: ShExJ equivalent of ShExC
:param log: Where comparison errors are recorded
:return: True if they match, false otherwise.  If no match, the offending string is printed