Skip to content

dev version breaks compaction against a url #6

@cboettig

Description

@cboettig

The following works for me on the CRAN version but not the dev version:

library("jsonld")

# Example from https://github.com/digitalbazaar/jsonld.js#quick-examples
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"}
}'
# Compact given a url to a context:
out <- jsonld_compact(doc, "http://purl.org/codemeta/2.0")

I wonder if this is related to 9281d4b . I'm thinking that turning content negotiation off might not be a good idea since it seems the basic json-ld algorithms rely on content negotiation as I comment in ropensci/codemetar#34. But the above fails for me with even the default setting in the dev version, so I think is a bug(?)

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