Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when parsing turtle file #2790

Open
lymereJ opened this issue May 15, 2024 · 0 comments
Open

Error when parsing turtle file #2790

lymereJ opened this issue May 15, 2024 · 0 comments

Comments

@lymereJ
Copy link

lymereJ commented May 15, 2024

Using 0.7.0 running the following code gives me the following error. I've tried different version of Python, but I get the same error every time. It does seem to work on other machine so I'm not sure why it fails on mine. Any idea? The turtle file referenced below is here.

import rdflib
g = rdflib.Graph()
g.parse('./resources/brick/Brick.ttl')
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[4], [line 1](vscode-notebook-cell:?execution_count=4&line=1)
----> [1](vscode-notebook-cell:?execution_count=4&line=1) g.parse('./resources/brick/Brick.ttl', format="ttl")

File c:\Python310\lib\site-packages\rdflib\graph.py:1492, in Graph.parse(self, source, publicID, format, location, file, data, **args)
   [1489](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1489) parser = plugin.get(format, Parser)()
   [1490](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1490) try:
   [1491](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1491)     # TODO FIXME: Parser.parse should have **kwargs argument.
-> [1492](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1492)     parser.parse(source, self, **args)
   [1493](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1493) except SyntaxError as se:
   [1494](file:///C:/Python310/lib/site-packages/rdflib/graph.py:1494)     if could_not_guess_format:

File c:\Python310\lib\site-packages\rdflib\plugins\parsers\notation3.py:2021, in TurtleParser.parse(self, source, graph, encoding, turtle)
   [2019](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:2019) if not stream:
   [2020](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:2020)     stream = source.getByteStream()
-> [2021](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:2021) p.loadStream(stream)
   [2023](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:2023) for prefix, namespace in p._bindings.items():
   [2024](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:2024)     graph.bind(prefix, namespace)

File c:\Python310\lib\site-packages\rdflib\plugins\parsers\notation3.py:479, in SinkParser.loadStream(self, stream)
    [478](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:478) def loadStream(self, stream: Union[IO[str], IO[bytes]]) -> Optional["Formula"]:
--> [479](file:///C:/Python310/lib/site-packages/rdflib/plugins/parsers/notation3.py:479)     return self.loadBuf(stream.read())

OSError: [Errno 22] Invalid argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant