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

Require exactly one type for all resources #1185

Closed
azaroth42 opened this issue Jun 27, 2017 · 11 comments
Closed

Require exactly one type for all resources #1185

azaroth42 opened this issue Jun 27, 2017 · 11 comments
Assignees
Labels
normative presentation Ready-for-Eds Editorial changes ready for Editorial review

Comments

@azaroth42
Copy link
Member

#1131 suggests that all relationships that can ever have more than one value must always be an array.
This is possible in the JSON-LD context by using @container:@set. It will be possible for language tagged strings in languagemaps in JSON-LD 1.1.

The current definition of type (@type, rdf:type) is that all resources must have at least one type, not exactly one type. Thus, by #1131, it should always be an array.

However, as per #1106, it is not possible to re-define the behavior of @type, you can only add aliases to it, like type. Meaning that I believe it is invalid to assert @container:@set for @type... and we would be inconsistent. The definition of @type is in this section of JSON-LD: https://www.w3.org/TR/json-ld/#node-objects

Given that we have not come across any use cases for multiple types in 5 years, I propose that the solution is to require exactly one type for every resource.

@azaroth42 azaroth42 added this to the Presentation 3.0 milestone Jun 27, 2017
@tomcrane
Copy link
Contributor

👍

@azaroth42
Copy link
Member Author

azaroth42 commented Jun 27, 2017

Urgh, just realised that the same applies to @context when used in inline resources.

If you have a Image service, with an extension, you would need:

"service": {
  "@context": ["http://example.org/extension/context.jsonld", 
    "http://iiif.io/api/image/3/context.json"],
  "id": "...",
  "height": 1000,
  "extension": "fish"
}

We can minimize this in JSON-LD 1.1 with the use of type and property specific contexts, but the above is still a problem.

@jpstroop
Copy link
Member

jpstroop commented Jul 5, 2017

Community Call on 7/5: Make the requirement to type-check the exception rather than the rule.

@azaroth42
Copy link
Member Author

Reflected the issue to JSON-LD for W3C discussion: json-ld/json-ld.org#512

@azaroth42
Copy link
Member Author

Discussion at Getty AV: 👍

@azaroth42
Copy link
Member Author

Further discussion: Need to distinguish between URIs and Resources (e.g. profile URIs don't need types, but licenses do)
Web-Annotation / IIIF inconsistency that annotation bodies (for example) don't require types... but not a conflict, we would just be more restrictive.

@azaroth42 azaroth42 added ratify and removed discuss labels Sep 28, 2017
@zimeon
Copy link
Member

zimeon commented Oct 12, 2017

👍 agreed at Toronto WG meeting

@christopher-johnson
Copy link

How do you intend to handle structures like this with only one type?

"resource":{
        "@id": "http://example.org/iiif/book1/res/music.mp3",
        "@type": "dctypes:Sound",
        "format": "audio/mpeg"
      }

http://example.org/iiif/book1/res/music.mp3 has at least two types, an oa:hasBody and a dctypes:Sound. The class of an object property (as an instance of some class) is transitive to the object implicitly.

ref: #1280

@azaroth42
Copy link
Member Author

Done: http://prezi3.iiif.io/api/presentation/3.0/#type

(Noting small typo, missing a space)

@azaroth42 azaroth42 added Ready-for-Eds Editorial changes ready for Editorial review and removed ratify labels Nov 3, 2017
@azaroth42
Copy link
Member Author

@christopher-johnson Indeed implicitly. One explicit type in the serialization.

@zimeon
Copy link
Member

zimeon commented Nov 6, 2017

Agree done but I think we should fix typo before closing... PR #1294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative presentation Ready-for-Eds Editorial changes ready for Editorial review
Projects
None yet
Development

No branches or pull requests

5 participants