Skip to content

nquads and trix should serialize non-context aware stores also. #1892

@aucampia

Description

@aucampia

While writing some tests I noticed:

================================================================================= FAILURES ==================================================================================
____________________________________________________________ test_serialize_parse[nquads-TRIPLE-BINARY_IO-None] _____________________________________________________________
Traceback (most recent call last):
  File "/home/iwana/sw/d/github.com/iafork/rdflib.cleanish/test/test_serializers/test_serializer.py", line 383, in test_serialize_parse
    serialize_result = graph.serialize(
  File "/home/iwana/sw/d/github.com/iafork/rdflib.cleanish/rdflib/graph.py", line 1127, in serialize
    serializer = plugin.get(format, Serializer)(self)
  File "/home/iwana/sw/d/github.com/iafork/rdflib.cleanish/rdflib/plugins/serializers/nquads.py", line 15, in __init__
    raise Exception(
Exception: NQuads serialization only makes sense for context-aware stores!
========================================================================== short test summary info ==========================================================================
FAILED test/test_serializers/test_serializer.py::test_serialize_parse[nquads-TRIPLE-BINARY_IO-None] - Exception: NQuads serialization only makes sense for context-aware s...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 1 failed, 10 xfailed in 0.13s =======================================================================

I don't see why this should be the case, nquads should just encode everything with the default context, which will result in something that looks like ntriples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions