Skip to content

JSON-LD 1.1 Feature Request: New @label keyword #371

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

Closed
jasnell opened this issue Oct 7, 2014 · 10 comments
Closed

JSON-LD 1.1 Feature Request: New @label keyword #371

jasnell opened this issue Oct 7, 2014 · 10 comments
Labels
api defer Issue deferred to future Working Group spec-design syntax

Comments

@jasnell
Copy link
Contributor

jasnell commented Oct 7, 2014

In the spirit of "Labeling Everything" (http://patterns.dataincubator.org/book/label-everything.html) ... it would be worthwhile, IMO, for JSON-LD to provide a basic @Label keyword for use both in @context and nodes. It's largely syntactic sugar but would be useful.

For example:

{
  "@context": {
    "@label": "An Example Context",
    "displayName": "@label",
  },
  "displayName": "A Simple Label"
}

Which would expand to:

_:c14n0 <http://www.w3.org/2000/01/rdf-schema#label> "A Simple Label" .
@lanthaler
Copy link
Member

Hmm… how would that be different from explicitly mapping @Label to rdfs:label in the context? Is this simply a matter of saving a couple of characters?
Could you please elaborate a bit on what "@Label": "An Example Context" in the context should do or how it is supposed to be interpreted?

@jasnell
Copy link
Contributor Author

jasnell commented Oct 7, 2014

@Label in the @context is documentation.

In general, this would be syntactic sugar... saving characters for a common use case and promotion of best practice..

@davidlehn
Copy link
Member

Contexts themselves are not a part of the RDF data model so it seems kind of strange to start applying particular RDF properties, or things that look like RDF properties, to them. I fear getting too meta with this discussion without solid use cases. But if @contexts are to become resources, there may be better ways to do this sort of thing. For instance, add a more flexible special @about property in the @context that would be processed with the main context and would let you add properties for the context itself such as @id, @type, and any other properties like label, description, etc. This really needs more discussion to determine if the added complexity is needed.

{
  "@context": {
    "@about": {
      "id": "a-magic-context",
      "type": ["MyMagicContext", "jsonld:Context"],
      "label": "My Super Magic Context",
      ...
    },
    "@base": "https://www.example.com/ns/stuff#",
    "id": "@id",
    "type": "@type",
    "jsonld": "http://www.w3.org/ns/json-ld#",
    "label": "http://www.w3.org/2000/01/rdf-schema#label"
    ...
  },
  ...
}

@davidlehn davidlehn added the 1.1 label Oct 7, 2014
@cappelaere
Copy link

Could @Label be used for localization of properties themselves?
I have this issue where I need to define many properties and values for an API. It is easy to localize the property value as defined in the JSON-LD spec (example 31 for instance). But if the property tags are used for visualization, they need to be localized as well. Best place would seem to be in @context using @Label or expand each property with a hash containing @Label and @value.
Anybody with some experience in that area?
Thanks.
Pat.

@gkellogg
Copy link
Member

I don't see much value to this, there are a number of things which might deserve keywords, and where do we draw the line. IMO, it's just as easy to define the following:

{
  "@context": {
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "displayName": "rdfs:label",
  },
  "displayName": "A Simple Label"
}

@dlongley
Copy link
Member

@cappelaere,

Could @Label be used for localization of properties themselves?

Best place would seem to be in @context using @Label or expand each property with a hash containing @Label and @value.

I disagree. The best place for information about a property should be at its URL. You should be able to go to the URL of the property and get more information about it -- which may include a "display label" of some kind. This probably shouldn't be context-specific, it would be the same regardless of the term the property (URL) gets mapped to, and therefore shouldn't be in a @context. Rather, it's part of the vocab.

@davidlehn
Copy link
Member

There are two parts to the original issue, one is @label sugar, the other is adding properties about a @context as if it were also a resource. I agree with @gkellogg that @label is unnecessary, but treating @contexts as resources is very meta and maybe worth at least considering.

@lanthaler
Copy link
Member

What use cases can be realized with treating embedded @contexts as resources that can’t be realized by expressing that data in the body of the document? Please note that external contexts are already resources that are identified with a URL and can thus be described as any other thing in JSON-LD.

@kevinSuttle
Copy link

See also: #369 (comment)

@lanthaler lanthaler modified the milestone: JSON-LD.next Jan 10, 2016
@gkellogg gkellogg removed this from the JSON-LD.next milestone Sep 22, 2016
@gkellogg gkellogg added defer Issue deferred to future Working Group and removed on-hold labels Apr 4, 2018
@gkellogg
Copy link
Member

Closed in favor of w3c/json-ld-syntax#6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api defer Issue deferred to future Working Group spec-design syntax
Projects
None yet
Development

No branches or pull requests

7 participants