diff --git a/src/yatter/__init__.py b/src/yatter/__init__.py index b1b226b..b10cf8f 100644 --- a/src/yatter/__init__.py +++ b/src/yatter/__init__.py @@ -69,7 +69,7 @@ def inverse_translation(rdf_mapping, mapping_format=RML_URI): triples_map = [tm[rdflib.Variable('triplesMap')] for tm in rdf_mapping.query(query).bindings] for tm in triples_map: - tm_name = tm.split("/")[-1] + tm_name = tm.split("/")[-1].split("#")[-1] yarrrml_tm = {YARRRML_SOURCES: [add_inverse_source(tm, rdf_mapping, mapping_format)]} subject, classes = add_inverse_subject(tm, rdf_mapping) yarrrml_tm.update(subject) diff --git a/src/yatter/__main__.py b/src/yatter/__main__.py index e1d8e5f..4b71d8c 100644 --- a/src/yatter/__main__.py +++ b/src/yatter/__main__.py @@ -14,6 +14,7 @@ def write_results(mapping): elif type(mapping) is dict: with open(args.output_mapping_path, "wb") as f: yaml = YAML() + yaml.width = 3000 yaml.default_flow_style = False yaml.dump(mapping, f) diff --git a/src/yatter/source.py b/src/yatter/source.py index bde36c5..f5fb009 100644 --- a/src/yatter/source.py +++ b/src/yatter/source.py @@ -282,7 +282,7 @@ def get_logical_source(logical_source_id, rdf_mapping): raise Exception() if source and reference_formulation and iterator: - yarrrml_source = [source.value + '~' + reference_formulation.toPython().replace(QL_URI, '').lower(), iterator.value] + yarrrml_source = [source.value + '~' + reference_formulation.toPython().replace(QL_URI, '').lower(), iterator.value] elif source and sql_query: # this means a database source source_dict = {"query": sql_query.value, "source": source.value}