Skip to content

Representing string maps in RDF #709

Open
@iddan

Description

@iddan

Currently, maps of dynamic string keys can only be represented by an rdf:JSON literal this works for translating JSON-LD to Linked Data Dataset and vice versa but it makes the data unstructured (as it is just a literal).

{ "@id": "http://example.org/with-map", "http://example.org/map": { "a": "b" } }

Will be translated to

<http://example.org/with-map> <http://example.org/map> "{ \"a\": \"b\" }"^^rdf:JSON .

But what if instead they would be parsed to RDF data:

<http://example.org/with-map> <http://example.org/map> _:map .
_:map rdf:type rdf:Map .
_:map rdf:_1 _:entry1 .
_:entry1 rdf:key "a" .
_:entry1 rdf:value "b" .

My suggestion is based on an answer gave me in Stackoverflow

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions