Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to declare a container as both @index and @set #269

Closed
lrowe opened this issue Jun 20, 2013 · 4 comments
Closed

Ability to declare a container as both @index and @set #269

lrowe opened this issue Jun 20, 2013 · 4 comments

Comments

@lrowe
Copy link

lrowe commented Jun 20, 2013

I have the following indexed data structure that I'd like to preserve during compaction:

{
  "dbxref": {
    "db1": ["term1"],
    "db2": ["term2a", "term2b"]
  }
}

Declaring a context with @container: @Index partly works, but I also want to preserve the array even when it has only a single member:

{
  "@context": {
    "@vocab": "http://localhost/context#",
    "dbxref": {
      "@container": "@index"
    }
  },
  "@id": "http://localhost/item1",
  "dbxref": {
    "db1": "term1",
    "db2": ["term2a", "term2b"]
  }
}

It would be helpful to have some way to declare a container as both @Index and @set.

@lanthaler
Copy link
Member

I don’t really understand what your data is supposed to mean but couldn’t you map db1 and db2 to a URI and set the containers there?

@lrowe
Copy link
Author

lrowe commented Jun 20, 2013

The dbxref object stores links to external databases from our system indexed by database identifier. I want to avoid turning dbxref into a node in its own right (presumably necessary if the keys were to be treated as URIs) as the relationship is from the item to the external database resource, something like:

<http://localhost/item1> <rdf:seeAlso> <db1:term1> .

(We'll probably move away from this data structure, but it doesn't seem completely unreasonable.)

@lanthaler
Copy link
Member

OK, I see. In that case the index-container is indeed the right thing. Unfortunately, there’s currently no way to use two containers at the same time.

I’ve added this issue to the JSON-LD.next milestone so that we’ll keep this in mind for the next version of JSON-LD sometime in the future. Thanks for raising this.

@gkellogg
Copy link
Member

gkellogg commented Apr 8, 2017

I propose taking this off of the 1.1 milestone; please 👍 or 👎 to favor/disfavor removing.

@gkellogg gkellogg added this to Syntax in JSON-LD 1.1 CG May 4, 2017
gkellogg added a commit that referenced this issue May 28, 2017
…y including `@set` along with another container type.

Fixes #269. Fixes #407.
gkellogg added a commit to ruby-rdf/json-ld that referenced this issue May 28, 2017
@gkellogg gkellogg removed this from Syntax in JSON-LD 1.1 CG Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants