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

CompactIRI won't use term for @id if term defined with @container: @list #143

Closed
gkellogg opened this issue Jul 1, 2012 · 3 comments
Closed

Comments

@gkellogg
Copy link
Member

gkellogg commented Jul 1, 2012

@warpr (Kuno Woudt) noticed that setting a term to @container: @list prevents it from being used as an @id.

I've hit upon some surprising behaviour again with the json-ld
playground. I understand all of that is still in development, but I am
still curious if the behaviour I'm seeing is correct, or if I've found a
bug, or if I'm just doing something stupid and my input is wrong :)

Here is my starting point: http://ur1.ca/9leae

In this test document senet:properties is a "@list", I would like to see it framed as a regular javascript array, so I add { "@container": "@list" } to the context, my full context now looks like this:

{
  "@context": {
    "owl": "http://www.w3.org/2002/07/owl#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "senet": "https://senet.org/ns#",

    "id": "@id",
    "type": "@type",
    "senet:properties": { "@container": "@list" }
  }
}

This does change the "senet:properties" on "senet:Game" to render as a javascript list, but the second object in the @graph suddenly has its id changed from "senet:properties" to the full url, "https://senet.org/ns#properties".

I wasn't expecting that to happen, is the behaviour correct? Is there something I need to add in the context to have this id stay compact?

The context comes from this document snippet:

{
  "@context": {
    "owl": "http://www.w3.org/2002/07/owl#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "senet": "https://senet.org/ns#",
    "id": "@id",
    "type": "@type",
    "senet:properties": {
      "@container": "@list"
    }
  },
  "@graph": [
  {
    "id": "senet:Game",
    "type": "owl:Class",
    "senet:properties": [
    {
      "id": "senet:title",
      "type": "owl:DataProperty"
    }, {
      "id": "senet:slug",
      "type": ["owl:DataProperty", "owl:FunctionalProperty"]
    }]
  }, {
    "id": "https://senet.org/ns#properties",
    "type": "rdf:Property"
  }, {
    "id": "senet:slug",
    "type": ["owl:DataProperty", "owl:FunctionalProperty"]
  }, {
    "id": "senet:title",
    "type": "owl:DataProperty"
  }]
}

The reason is because of IRI Compaction step 2.3

Otherwise, if term has a container set to @list, continue to the next term.

This should probably only do this is value is not null, otherwise, it's perfectly reasonable to use senet:properties in an @id.

@niklasl
Copy link
Member

niklasl commented Jul 1, 2012

Which term should be used if context contains both:

"properties": {"@id": "senet:properties"}
"propertiesList": {"@id": "senet:properties", "@container": "@list"}

Or should "senet:properties" be used in this case because the prefix "senet" is defined, thus enabling the @id to be shortened into a CURIE?

@lanthaler
Copy link
Member

@niklasl in your example it would be properties as it is shorter

@lanthaler
Copy link
Member

I can't reproduce this issue anymore and thus close this issue. Please reopen it if it wasn't fixed in the spec.

lanthaler added a commit that referenced this issue Aug 20, 2012
lanthaler added a commit that referenced this issue Aug 20, 2012
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