-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,12 @@ | |
__email__ = "[email protected]" | ||
__name__ = "INVERSETC-0005 based on YARRRMLTC-0013" | ||
|
||
|
||
import os | ||
from ruamel.yaml import YAML | ||
import yatter | ||
from rdflib.graph import Graph | ||
from deepdiff import DeepDiff | ||
|
||
R2RML_URI = 'http://www.w3.org/ns/r2rml#' | ||
|
||
|
||
|
@@ -21,12 +21,14 @@ def test_inversetc0005(): | |
expected_mapping = yaml.load(file) | ||
|
||
input_mapping = Graph() | ||
mapping_path = input_mapping.parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mapping.ttl'), format="ttl") | ||
mapping_path = input_mapping.parse(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mapping.ttl'), | ||
format="ttl") | ||
translated_mapping = yaml.load(str(yatter.inverse_translation(mapping_path, mapping_format=R2RML_URI))) | ||
|
||
ddiff = DeepDiff(expected_mapping['mappings'], translated_mapping['mappings'], ignore_order=True) | ||
|
||
print(expected_mapping['mappings']) | ||
print(translated_mapping['mappings']) | ||
if ddiff: | ||
assert False | ||
else: | ||
assert True | ||
assert True |