Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SPARQLTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,10 @@ def _as_array(v):

def _deepequals(a, b):
return a == b or dumps(a) == dumps(b)


def validJSON(json_file):
"""Validate json file (loaded into Python as a dict) is a valid query for
SPARQLTransformer (see https://github.com/D2KLab/py-sparql-transformer/issues/13).
"""
return ("@graph" in json_file) or ("proto" in json_file)