Commit ea23e4da authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Set default value of "encoding" parameter of LCSV2RDF to 'utf-8'

parent e882f62c4c6a
......@@ -38,7 +38,7 @@ class LCSV2RDF(object):
reference : W3C unofficial draft,
def __init__(self, stream, delimiter, encoding,
def __init__(self, stream, delimiter, encoding='utf-8',
uri_generator=None, uri_cls=text_type, default_lang=None):
""" check stream validity and init attribute"""
self.source_file = ucsvreader(stream, encoding=encoding, delimiter=delimiter)
......@@ -156,7 +156,7 @@ class SKOSParser(datafeed.DataFeedParser):
source=self.source, raise_on_error=raise_on_error, **kwargs)
def lcsv_extentities(stream, scheme_uri, delimiter, encoding, language_code=None):
def lcsv_extentities(stream, scheme_uri, delimiter, encoding='utf-8', language_code=None):
"""Return external entities generator from SKOS LCSV stream or URL (by transforming it to RDF
......@@ -171,7 +171,7 @@ def lcsv_extentities(stream, scheme_uri, delimiter, encoding, language_code=None
graph = rdfio.RDFLibRDFGraph()
# add LCSV statements to the RDF graph
lcsv2rdf = lcsv.LCSV2RDF(stream, delimiter, encoding, default_lang=language_code,
lcsv2rdf = lcsv.LCSV2RDF(stream, delimiter, encoding=encoding, default_lang=language_code,
uri_cls=graph.uri, uri_generator=lambda x: str(uuid4()) + x)
for (subj, pred, obj) in lcsv2rdf.triples():
graph.add(subj, pred, obj)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment