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

Adapting tests and python versions #82

Merged
merged 4 commits into from
Jun 7, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/testgha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.10']
python-version: ['3.8', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
14 changes: 7 additions & 7 deletions test/projects/TEC/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "ecfo_instance:CF_{id}";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/CF_{id}";
];
rr:predicateObjectMap [
rr:predicateMap [
Expand Down Expand Up @@ -172,7 +172,7 @@
];
rr:objectMap [
a rr:ObjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}";
rr:termType rr:IRI
];
];
Expand Down Expand Up @@ -265,7 +265,7 @@
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}/start";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}/start";
];
rr:predicateObjectMap [
rr:predicateMap [
Expand Down Expand Up @@ -299,7 +299,7 @@
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}/end";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}/end";
];
rr:predicateObjectMap [
rr:predicateMap [
Expand Down Expand Up @@ -333,7 +333,7 @@
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}";
];
rr:predicateObjectMap [
rr:predicateMap [
Expand All @@ -352,7 +352,7 @@
];
rr:objectMap [
a rr:ObjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}/start";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}/start";
rr:termType rr:IRI
];
];
Expand All @@ -363,7 +363,7 @@
];
rr:objectMap [
a rr:ObjectMap;
rr:template "ecfo_instance:applicablePeriod/{valid_from}/{valid_to}/end";
rr:template "https://w3id.org/ecfkg/i/UK/BEIS/2016/applicablePeriod/{valid_from}/{valid_to}/end";
rr:termType rr:IRI
];
].
Expand Down
2 changes: 1 addition & 1 deletion test/r2rml/INVERSETC-0005/mapping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ mappings:
s: http://example.com/Patient/$(ID)
po:
- [rdf:type, foaf:Person]
- [http://example.com/$(last_name), $(LastName), xsd:string]
- [ex:$(last_name), $(LastName), xsd:string]
- [ex:height, http://example.com/$(Height)]
8 changes: 4 additions & 4 deletions test/r2rml/INVERSETC-0005/test_inversetc0005.py
Original file line number Diff line number Diff line change
Expand Up @@ -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#'


Expand All @@ -21,12 +21,12 @@ 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)

if ddiff:
assert False
else:
assert True
assert True
Loading