8000 Fix getting level for custom report queries by beckyjackson · Pull Request #944 · ontodev/robot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix getting level for custom report queries #944

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

Merged
merged 4 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

< 8000 label class="SelectMenu-item" role="menuitem"> Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fix custom [`report`] queries [#944]

## [1.8.2] - 2021-12-02

### Added
Expand Down Expand Up @@ -283,6 +286,7 @@ First official release of ROBOT!
[`template`]: http://robot.obolibrary.org/template
[`validate`]: http://robot.obolibrary.org/validate

[#944]: https://github.com/ontodev/robot/pull/944
[#938]: https://github.com/ontodev/robot/pull/938
[#929]: https://github.com/ontodev/robot/pull/929
[#924]: https://github.com/ontodev/robot/issues/924
Expand Down
11 changes: 11 additions & 0 deletions docs/examples/missing-contributor.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT DISTINCT ?entity ?property ?value WHERE {
?entity a owl:Ontology .
FILTER NOT EXISTS {
?entity dc:contributor ?value .
}
BIND(dc:contributor as ?property)
}
5 changes: 5 additions & 0 deletions docs/examples/my-profile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WARN annotation_whitespace
ERROR invalid_xref
ERROR label_formatting
INFO file:missing-contributor.sparql
ERROR multiple_labels
12 changes: 6 additions & 6 deletions docs/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ INFO deprecated_class
```

`report` allows the user to define their own profile to configure different logging levels and include their own QC queries with the `--profile` option:
<!-- DO NOT TEST -->
```
robot report --input edit.owl \
--profile my-profile.txt \
--output my-report.tsv
```


robot report --input edit.owl \
--profile my-profile.txt \
--output my-report.tsv


For all default queries, include the query name shown above. If you do not wish to include a default query in your report, simply omit it from your profile. Any queries not named in the profile will not be run. Furthermore, your own queries can be included by providing the desired logging level followed by the absolute or relative path.
Note that in order for the queries to be included in the report, they _must_ return exactly three variables: `?entity ?property ?value`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ private static Set<ReportQuery> getReportQueries(Map<String, String> profile)
String rulePath = qs.getKey();
String ruleName =
rulePath.substring(rulePath.lastIndexOf("/") + 1, rulePath.lastIndexOf("."));
ReportQuery rq = new ReportQuery(ruleName, qs.getValue(), profile.get(ruleName));
ReportQuery rq = new ReportQuery(ruleName, qs.getValue(), profile.get(rulePath));
reportQueries.add(rq);
}
return reportQueries;
Expand Down
0