Skip to content
Open
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
4 changes: 3 additions & 1 deletion csvwlib/converter/ToRDFConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def parse_virtual_columns(self, row_node, atdm_row, table_metadata):
self.graph.add((row_node, CSVW.describes, subject))
else:
print(f"term {virtual_column['propertyUrl']} not in namespaces")
S

def _add_file_metadata(self, metadata, node):
language = JSONLDUtils.language(self.metadata.get('@context',[]))
for key, value in metadata.items():
Expand Down Expand Up @@ -165,6 +165,8 @@ def _object_node(value, col_metadata, atdm_row, tm_url):

@staticmethod
def _normalize_to_uri(string):
if string in [None, '']:
return ''
string = quote(string, safe='')
string = string.replace('-', '%2D')
return string
Expand Down
2 changes: 1 addition & 1 deletion csvwlib/utils/TypeConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TypeConverter:

@staticmethod
def convert_if_necessary(value, column_metadata):
if 'datatype' not in column_metadata:
if 'datatype' not in column_metadata or not isinstance(column_metadata['datatype'], dict):
return value

return TypeConverter.convert(value, column_metadata['datatype'])
Expand Down
2 changes: 1 addition & 1 deletion csvwlib/utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def validate_metadata(self, metadata):
self.check_titles(table)

def check_csv_reference(self, table, metadata):
if not self.start_url.endswith('.csv'):
if not (self.start_url or "").endswith('.csv'):
return
if table['url'] != self.start_url:
for key in list(metadata.keys()):
Expand Down