Skip to content

Conversion toRDF fails #178

Closed
Closed
@QuanticPotatoes

Description

@QuanticPotatoes

Hello,

I have a problem with toRDF function. In JSON-LD, i convert my json to nquads correctly :
http://tinyurl.com/kf482a4

But in node, it's don't work.

let json = { 
  "@context": { 
    "doi": "http://purl.org/ontology/bibo/doi",
    "schema": "http://schema.org/"
   },
  "@id" : "hello",
  "@graph": [
    {
      "@id": "http://json-ld.org/playground/coucou",
      "doi": "doitest"
    }
  ]
};

  jsonld.toRDF(doc, { format: "application/nquads" }, (err, nquads) => {
    console.log(nquads);
  });
};

nquads return just "" 😭

I have the feeling that problem comes from @id

let json = { 
  "@context": { 
    "doi": "http://purl.org/ontology/bibo/doi",
    "schema": "http://schema.org/"
   },
  //"@id" : "hello",
  "@graph": [
    {
      "@id": "http://json-ld.org/playground/coucou",
      "doi": "doitest"
    }
  ]
};

Ouput:
<http://json-ld.org/playground/coucou> <http://purl.org/ontology/bibo/doi> "doitest" .
I have tested with "jsonld": "^0.4.12"
I don't understand, if you can help me 😀
Thanks

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