Skip to content

json-ld/expand handles @type @json ambiguosly #28

Description

@dpetran
(json-ld/expand
    {"@context" {"ex" "http://example.org/"}
     "@id" "ex:jsonTest"
     "ex:myJSON" {"@value" {"some" {"json" 42}}
                  "@type" "@json"}})
;;=>
  {:idx [], :id "http://example.org/jsonTest", "http://example.org/myJSON" [{:value {"some" {"json" 42}}, :type "@json", :idx ["ex:myJSON"]}]}

(json-ld/expand
    {"@context" {"ex" "http://example.org/"
                 "myJSON" {"@id" "http://example.org/myJSON",
                           "@type" "@json"}}
     "@id" "ex:jsonTest"
     "myJSON" {"some" {"json" 42}}})
;;=>
{:idx [], :id "http://example.org/jsonTest", "http://example.org/myJSON" [{:value {"some" {"json" 42}}, :type :json, :idx ["myJSON"]}]}

Note in the example that the first example has a :value of "@json", and the second one has a :value of :json. These should in all cases be consistently be the string "@json" so it is consistent with all other datatypes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions