Skip to content

Support multiple IRIs for @reverse  #372

Open
@alexkreidler

Description

@alexkreidler

Hi all,

It would be great to allow multiple property IRIs in the @reverse property. This would allow users to transform JSON-LD to other formats like N-Quads more easily without having to manipulate the output format to add additional triples with the extra properties they want to add.

For example, I have some JSON-LD like this:

{
  "@id": "ex:BEA/code/FREQ",
  "@type": "skos:ConceptScheme",
  "skos:notation": "FREQ",
  "entries": [
    {
      "@id": "ex:BEA/code/FREQ/A",
      "@type": "skos:Concept",
      "skos:prefLabel": "Annually",
      "skos:notation": "A"
    },
    {
      "@id": "ex:BEA/code/FREQ/Q",
      "@type": "skos:Concept",
      "skos:prefLabel": "Quarterly",
      "skos:notation": "Q"
    }
  ]
}

I'd like to have a context entry like this:

    "entries": {"@reverse": ["skos:hasTopConcept", "skos:inScheme"]}

This use-case is based on Example 14 from the RDF Data Cube Specification.

I know that the feature set is frozen for 1.1, I just wanted to put this out there for consideration for the next version.

I guess the trickiest part would be handling the expanded form, which looks like this currently:

{
  "@reverse": {
    "http://www.w3.org/2004/02/skos/core#hasTopConcept": [
        {
          "@id": "ex:BEA/code/FREQ/A",
          "@type": "skos:Concept",
          "skos:prefLabel": "Annually",
          "skos:notation": "A"
        },
    ]
  }
}

We can't have keys that are arrays, so we'd need to restructure it. I'm not sure if it's possible to do that in a backwards-compatible way, which might be a deal-breaker.

Let me know what you think. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Future Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions