Skip to content

Error when parsing turtle file #2790

Closed
Closed
@lymereJ

Description

@lymereJ

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions