Conversation
Currently, it does linting only.
| semantic axis. | ||
| """ | ||
|
|
||
| from collections.abc import Sequence |
There was a problem hiding this comment.
Consider only including namespaces, not Classes.
| @@ -0,0 +1,101 @@ | |||
| #!/usr/bin/env python | |||
There was a problem hiding this comment.
consider adding the emacs + encoding header.
#!/usr/bin/env python3
-- coding: UTF-8 --
| import sys | ||
| import argparse | ||
|
|
||
| def SchemaOrgGraph(): |
There was a problem hiding this comment.
Consider adding type annotations as this is a new file, i.e.
def SchemaOrgGraph() -> rdflib.Graph:
| only_in_g1 = g1 - g2 | ||
| only_in_g2 = g2 - g1 | ||
| # TODO: print sampled diffs if any. | ||
| return len(only_in_g1) == 0 and len(only_in_g2) == 0 |
There was a problem hiding this comment.
Nitpick: the pythonic way is to use the implicit bool conversion, i.e.
return not only_in_g1 and not only_in_g2
I have no strong opinions on this.
| # TODO: print sampled diffs if any. | ||
| return len(only_in_subset) == 0 | ||
|
|
||
| def Lint(args): |
There was a problem hiding this comment.
I would pass the arguments explicitly, i.e. output_filename and files so the function can be easily called from Python code/unit-tests.
| """Reformats the file(s) properly.""" | ||
| def LintOne(filename, output_filename): | ||
| logging.info(" - reading file ...") | ||
| g = SchemaOrgGraph() |
There was a problem hiding this comment.
Why g and v? Maybe make the variable names longer / more expressive?
Adding a tool to mechanically manage the Turtle files.
Currently the tool can do linting and plain merging.