oxigraph / oxigraph

SPARQL graph database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bulk loader should accept empty contents

majidaldo opened this issue · comments

Describe the bug
If buffer content is empty, you get a RuntimeError

To Reproduce
Steps to reproduce the behavior:

  1. Which version of Oxigraph are you using? On which platform?
    0.3.20
  2. A command line or a code snippet that triggers the bug.
In [1]: import pyoxigraph as og
In [2]: s = og.Store()
In [3]: from io import StringIO
In [4]: StringIO('') 
Out[4]: <_io.StringIO at 0x22a81f83d00>
In [5]: s.bulk_load(_, 'text/turtle')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[5], line 1
----> 1 s.bulk_load(_, 'text/turtle')
RuntimeError: Invalid argument: ingestion arg list is empty


# even fails with prefixes 
In [8]: s.bulk_load(StringIO('prefix p: <proto:> '), 'text/turtle')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[8], line 1
----> 1 s.bulk_load(StringIO('prefix p: <proto:> '), 'text/turtle')

RuntimeError: Invalid argument: ingestion arg list is empty

This is inconsistent with og.parse behavior.

Thank you for this bug report! I manage to reproduce it. A bug fix should not be too hard.