TEC-Toolkit / cfkg

Data cleaning steps and mappings used to transform data from different sources to RDF
Apache License 2.0
1 stars 0 forks source link

Cannot generate graph for DESNZ 2023 #17

Closed m-markovic closed 3 weeks ago

m-markovic commented 9 months ago

I keep getting an error when I try to run python -m morph_kgc cf_2023_v2.ini on 2023 data in https://github.com/TEC-Toolkit/cfkg/tree/main/DESNZ-UK

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/main.py", line 31, in rml_df, fnml_df = retrieve_mappings(config) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/mapping/mapping_parser.py", line 21, in retrieve_mappings rml_df, fnml_df = mappings_parser.parse_mappings() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/mapping/mapping_parser.py", line 476, in parse_mappings self._get_from_r2_rml() File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/mapping/mapping_parser.py", line 507, in _get_from_r2_rml data_source_rml_df, data_source_fnml_df = self._parse_data_source_mapping_files(section_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/mapping/mapping_parser.py", line 564, in _parse_data_source_mapping_files _validate_termtypes(mapping_graph) File "/Users/s10mm2/Documents/EATS/pythonEnv/lib/python3.11/site-packages/morph_kgc/mapping/mapping_parser.py", line 447, in _validate_termtypes raise ValueError(f'Found an invalid subject termtype. Found values {subject_termtypes}. ' ValueError: Found an invalid subject termtype. Found values {'http://w3id.org/rml/Literal', 'http://w3id.org/rml/IRI'}. Subject maps must be http://w3id.org/rml/IRI, http://w3id.org/rml/BlankNode or http://w3id.org/rml/RDFstarTriple.

dgarijo commented 3 weeks ago

Fixed in https://github.com/TEC-Toolkit/cfkg/commit/5687f221e715d449e857d8a1028a658dd33915b6#diff-1b1c81f1905cab683a9ffe460456206a2a4848ad83a71201b8d6f0e8ab632759