Skip to content

Dataset: NQuads serialization only makes sense for context-aware stores! #2335

Closed
@sdasda7777

Description

@sdasda7777

Hi, I'd like to serialize JSON-LD to N-Quads, however I keep getting NQuads serialization only makes sense for context-aware stores! exception. From the Dataset definition and this issue it seems that it however should work, correct? Here is my code (formatting might be bit off):

from rdflib import Dataset
        
    try:
        data = """{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "url": "http://www.janedoe.com"
}"""
         ds = Dataset()
         ds = ds.parse(data=data, format="json-ld")
         print(ds.serialize(format="nquads"))
    except Exception as e:
         print(e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`format: N-QuadsRelated to N-Quads format.serializationRelated to serialization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions