Skip to content

jsonld_to_rdf and jsonld_from_rdf should be convert back to original #19

@wincowgerDEV

Description

@wincowgerDEV

I was working through the examples and was surprised that this logical expression to test whether doc can be translated to RDF and back to JSON-LD in its exact form does not work.

doc <- '{
  "http://schema.org/name": "Manu Sporny",
  "http://schema.org/url": {"@id": "http://manu.sporny.org/"},
  "http://schema.org/image": {"@id": "http://manu.sporny.org/images/manu.png"}
}'

cat(nquads <- jsonld_to_rdf(doc))

#I would expect this expression to be TRUE but it is false. 
jsonld_from_rdf(nquads) == doc
#FALSE

After further inspection of json_from_rdf it looks like a "@id": "_:b0", is being added as the first expression. Is this the desired behavior?

If this is something the team would like to add, I would be interested in working on it.

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