Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify via tool #92

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Verify via tool #92

wants to merge 8 commits into from

Conversation

bpelakh
Copy link
Contributor

@bpelakh bpelakh commented Nov 16, 2021

No description provided.

@bpelakh bpelakh requested a review from pwin November 16, 2021 14:22
@bpelakh bpelakh marked this pull request as draft November 16, 2021 14:22
@bpelakh
Copy link
Contributor Author

bpelakh commented Nov 16, 2021

@pwin This has not been tested at all. It's just an outline of an approach. It needs to be tested, unit tests should be written, and documentation needs to be updated. Feel free to ping me for reviews, etc.

Copy link
Contributor Author

@bpelakh bpelakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwin Other than the small nits I mentioned, the only thing remaining is documentation. Do you want to take a swing at it, perhaps including your working Jena use case as an example? Then we can bump up the version and put this one to rest.

required:
- tool
- source
#- shapes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwin we should remove this rather than commenting it out.

Comment on lines 1092 to 1096
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_tb(exc_traceback, limit=30, file=sys.stdout)
print(exc_value, file=sys.stdout)
print(exc_type, file=sys.stdout)
sys.exit()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to print the traceback (which should be for internal failures) - if the user provided a bad path for a tool, that should be reported as a regular issue, using logging.error(), we should not have print() statements in the code. Also, a sys.exit(1) should be used to indicate an error termination.

errors = [validation_graph.subjects(RDF.type, sh.ValidationResult)]
assert len(errors) == 1

@pytest.mark.skipif(sys.platform == 'win32', reason="No /bin/cp")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@pytest.mark.skipif(sys.platform == 'win32', reason="No /bin/cp")
@pytest.mark.skipif(sys.platform == 'win32', reason="No /bin/cat")

@bpelakh bpelakh marked this pull request as ready for review November 18, 2021 19:38
@bpelakh bpelakh changed the title Draft: Verify via tool Verify via tool Nov 18, 2021
@@ -1181,7 +1183,7 @@ def format_value(v):
# Extend the width of each column to contain the longest value.
max_length = [max(a, b) for a, b in zip(max_length, [len(s) for s in as_text])]
rows.append(as_text)
row_format = " ".join(f"{{:{length}.{length}}}" for length in max_length) + "\n"
row_format = "||" + "| ".join(f"{{:{length}.{length}}}" for length in max_length) + "||\n"
rows.sort(key=lambda x: x[0])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwin Could this sort be the reason your ORDER BY didn't work for the table?

@pwin
Copy link
Collaborator

pwin commented Nov 29, 2021 via email

…- it now can return the validation report on stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants