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

Feature/ted 1227 #472

Merged
merged 3 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ def validate_output_structure(self) -> bool:

success = True

def _iter_dir(path):
return [i for i in path.iterdir() if i.is_dir()]

mandatory_paths_l3 = [
self.mapping_suite_path / MS_OUTPUT_FOLDER_NAME,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
[data-role=collapsible] .ui-collapsible-content {
padding: 10px;
}

hr {
margin: 12px 0;
height: 5PX;
background: #ccc;
border: 0;
}
</style>
</head>
<body>
Expand All @@ -63,8 +70,10 @@
<li>Date created: {{ created }}</li>
<li>SHACL test suite identifier: {{ test_suite_identifier }}</li>
<li>Mapping suite identifier: {{ mapping_suite_identifier }}</li>
</ul>
{% if notice_ids %}
<li><div><hr></div>
<hr>
<ul><li>
{% set nr_notices = notice_ids|length %}
{% if nr_notices > 1 %}
Notice identifiers ({{ nr_notices }}):
Expand All @@ -78,9 +87,8 @@
{% elif nr_notices == 1 %}
<b>Notice identifier: {{ notice_ids[0] }}</b>
{% endif %}
</li>
</li></ul>
{% endif %}
</ul>
<hr>
<h2>Results</h2>
<table class="dataTable">
Expand Down Expand Up @@ -127,8 +135,8 @@
{% endfor %}
</tbody>
</table>

{% endif %}
<hr>
</body>
</html>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@
[data-role=collapsible] .ui-collapsible-content {
padding: 10px;
}

hr {
margin: 12px 0;
height: 5PX;
background: #ccc;
border: 0;
}
</style>
</head>
<h1>SPARQL Validation Summary Report</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
margin: 25px auto;
width: 80%;
}
a[data-search-by-status] {
text-decoration: none;
}
table th, table td {
vertical-align: top;
}
Expand All @@ -33,6 +36,9 @@
.warning {
color: #8a6d3b;
}
.unknown {
color: #000;
}
.danger, .invalid, .error {
color: #a94442;
}
Expand Down Expand Up @@ -85,6 +91,13 @@
padding: 10px;
}

hr {
margin: 12px 0;
height: 5PX;
background: #ccc;
border: 0;
}

</style>
</head>
<body>
Expand All @@ -95,8 +108,11 @@
<li>Date created: {{ created }}</li>
<li>SPARQL test suite identifier: {{ test_suite_identifier }}</li>
<li>Mapping suite identifier: {{ mapping_suite_identifier }}</li>
{% if notice_ids %}
<li><div><hr></div>
</ul>
{% if notice_ids %}
<hr>
<ul>
<li>
{% set nr_notices = notice_ids|length %}
{% if nr_notices > 1 %}
Notice identifiers ({{ nr_notices }}):
Expand All @@ -111,32 +127,34 @@
<b>Notice identifier: {{ notice_ids[0] }}</b>
{% endif %}
</li>
{% endif %}
</ul>
{% endif %}
<hr>
<h2>Results summary</h2>
<table class="display" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Result</th>
<th>Count</th>
<th>Ratio (%)</th>
</tr>
</thead>
<tbody>
{% for _value in ['valid', 'unverifiable', 'warning', 'invalid', 'error', 'unknown'] %}
<tr>
{% set _results = validation_results | selectattr("result", "equalto", _value) | list | count %}
<td class="strong {{ _value }}">{{ _value }}</td>
<td>{{ _results }}</td>
<td>{{ (_results / results_count * 100) | round(2) }}%</td>
</tr>
{% endfor %}
</tbody>
</table>
<table class="display summary" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Result</th>
<th>Count</th>
<th>Ratio (%)</th>
</tr>
</thead>
<tbody>
{% for _value in ['valid', 'unverifiable', 'warning', 'invalid', 'error', 'unknown'] %}
<tr>
{% set _results = validation_results | selectattr("result", "equalto", _value) | list | count %}
<td>
<a href="#" data-search-by-status="{{ _value }}" class="strong {{ _value }}">{{ _value }}</a>
</td>
<td>{{ _results }}</td>
<td>{{ (_results / results_count * 100) | round(2) }}%</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr>
<h2>Results</h2>
<table class="display" data-order='[[0, "asc"]]'>
<table class="display results" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Form Field</th>
Expand All @@ -157,17 +175,16 @@
</div>
</td>
<td>{{ result.query.query | e | replace('\n', '<br>') }}</td>
<td class="strong {{ result.result }}">{{ result.result }}</td>
<td class="strong {{ result.result }}" data-search="{{ result.result }}">{{ result.result }}</td>
<td>
<button class="open-dialog">Details</button>
<div class="dialog" title="{{ result.query.title }}">
<ul>
<li>Query result: {{ result.query_result }}</li>
{% if result.query.xpath|length == 0 %}
<li>No XPATHs provided</li>
{% endif %}
<li>Fields are covered: {{ result.fields_covered }}</li>
{% if result.query.xpath|length > 0 %}
{% else %}
<li>Fields are covered: {{ result.fields_covered }}</li>
<li>
<h4 class="info">Fields:</h4>
<ol>
Expand Down Expand Up @@ -210,7 +227,7 @@
</table>
<hr>
<h2>Query results summary</h2>
<table class="display" data-order='[[0, "asc"]]'>
<table class="display summary" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Query result</th>
Expand Down Expand Up @@ -242,6 +259,7 @@
</tr>
</tbody>
</table>
<hr>
</body>
</html>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Expand All @@ -258,7 +276,10 @@
$c.attr("data-state", $c.attr("data-state") == "collapsed" ? "expanded" : "collapsed");
return false;
});
$("table.display").DataTable({
$("table.display.summary").DataTable({
dom: 'r'
});
const data_table = $("table.display.results").DataTable({
dom: 'B<"clear">lfiprtip',
buttons: [],
"lengthMenu": [[5, 15, 30, -1], [5, 15, 30, "All"]],
Expand All @@ -267,6 +288,10 @@
details: true
}
});
$("a[data-search-by-status]").click(function() {
data_table.search($(this).data("search-by-status")).draw();
return false;
});

$(document).on('click', '.open-dialog', function () {
$dialog = $(this).next('.dialog');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
padding: 10px;
}

hr {
margin: 12px 0;
height: 5PX;
background: #ccc;
border: 0;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -144,7 +150,7 @@

<hr>
<h2>Results summary</h2>
<table class="display" data-order='[[0, "asc"]]'>
<table class="display summary" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Result</th>
Expand All @@ -163,7 +169,7 @@
</table>
<hr>
<h2>Results</h2>
<table class="display" data-order='[[0, "asc"]]'>
<table class="display results" data-order='[[0, "asc"]]'>
<thead class="center aligned">
<tr>
<th>Form Field</th>
Expand Down Expand Up @@ -225,7 +231,10 @@
$c.attr("data-state", $c.attr("data-state") == "collapsed" ? "expanded" : "collapsed");
return false;
});
$("table.display").DataTable({
$("table.display.summary").DataTable({
dom: 'r'
});
$("table.display.results").DataTable({
dom: 'B<"clear">lfiprtip',
buttons: [],
"lengthMenu": [[5, 15, 30, -1], [5, 15, 30, "All"]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _process_sparql_ask_result(self, query_result, sparql_query: SPARQLQuery,
if xpath_coverage_validation and xpath_coverage_validation.validation_result:
xpath_validation_result = xpath_coverage_validation.validation_result

sparql_query_result.fields_covered = any(
sparql_query_result.fields_covered = not sparql_query.xpath or any(
map(lambda v: v in xpath_validation_result.xpath_covered, sparql_query.xpath))

sparql_query_xpath = set(sparql_query.xpath)
Expand Down