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 717 #283

Merged
merged 4 commits into from
Sep 27, 2022
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 @@ -125,17 +125,19 @@ def sparql_validation_generator(data: pd.DataFrame, base_xpath: str, controlled_

prefixes.append(SPARQL_PREFIX_LINE.format(prefix=prefix, value=prefix_value))

subject_type_display = ('\n\t\t' + subject_type) if subject_type else ''
object_type_display = ('\n\t\t' + object_type) if object_type else ''
yield f"#title: {sparql_title}\n" \
f"#description: “{sparql_title}” in SF corresponds to “{e_form_bt_id} " \
f"{e_form_bt_name}” in eForms. The corresponding XML element is " \
f"{concat_field_xpath(base_xpath, field_xpath)}. " \
f"The expected ontology instances are epo: {class_path} .\n" \
f"#xpath: {concat_field_xpath(base_xpath, field_xpath, separator=',')}" \
"\n" + "\n" + "\n".join(prefixes) + "\n\n" \
f"ASK WHERE {{ \n\t\t" \
f"{subject_type}\n\t\t" \
f"{object_type}\n\t\t" \
f"{property_path} }}"
f"ASK WHERE {{ " \
f"{subject_type_display}" \
f"{object_type_display}" \
f"\n\t\t{property_path} }}"


def _process_concept_mapping_sheet(sheet: pd.DataFrame) -> pd.DataFrame:
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/data_sampler/test_unique_xpaths_from_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_index_notice_by_id(notice_2016, mongodb_client):
def test_unique_xpaths_from_xml(notice_repository_with_indexed_notices):
mongodb_client = notice_repository_with_indexed_notices.mongodb_client
unique_xpaths = get_unique_xpaths_from_notice_repository(mongodb_client=mongodb_client)
assert len(unique_xpaths) == 378
assert len(unique_xpaths) == 368


def test_unique_notice_id(notice_repository_with_indexed_notices):
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_unique_xpaths_covered_by_notices(notice_repository_with_indexed_notices
mongodb_client = notice_repository_with_indexed_notices.mongodb_client
unique_notices = get_unique_notice_id_from_notice_repository(mongodb_client=mongodb_client)
unique_xpaths = get_unique_xpaths_covered_by_notices(notice_ids=unique_notices, mongodb_client=mongodb_client)
assert len(unique_xpaths) == 378
assert len(unique_xpaths) == 368


def test_get_most_representative_notices(notice_repository_with_indexed_notices):
Expand Down
Binary file not shown.