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

datatype requests #37

Open
djhaynes opened this issue Mar 15, 2016 · 8 comments
Open

datatype requests #37

djhaynes opened this issue Mar 15, 2016 · 8 comments

Comments

@djhaynes
Copy link
Contributor

At the 3/9/16 SACM Virtual Interim Meeting, there was a request for the following features with respect to datatypes in SACM.

  • Make URI a first class datatype
  • Make Array and Map primitive datatypes (based on experience with CBOR)

If anyone else has datatype requests for SACM, feel free to add them to this tracker.

@mcokus
Copy link

mcokus commented Jan 10, 2017

Concerning the URI part of the issue, we may need to discuss the scope. URIs cover more than web addresses (see RFC3986 - https://datatracker.ietf.org/doc/rfc3986/). Does the datatype need to address all URIs in general or just web addresses? For example, the following are all URIs:
ftp://ftp.is.co.za/rfc/rfc1808.txt
http://www.ietf.org/rfc/rfc2396.txt
ldap://[2001:db8::7]/c=GB?objectClass?one
mailto:John.Doe@example.com
tel:+1-816-555-1212
urn:oasis:names:specification:docbook:dtd:xml:4.1.2

@mcokus
Copy link

mcokus commented Jan 10, 2017

Concerning the Array/Map part of the issue, it's not clear what "based on experience with CBOR" means in the context of an information model, since CBOR is a specific data format. I'm thinking the intention is to describe the datatypes in a way that makes implementation in CBOR easier. If that's the case, then we could pattern Map and Array on JSON, since CBOR can be use to define compact representations of JSON structures.

@henkbirkholz
Copy link
Member

"based on experience with CBOR": While CBOR is a encoding/dataformat, it can be described using the language CDDL - maybe that was implied here?. Because, CDDL can already represent both JSON and CBOR structures natively (and JSON uses a totally different serialization). This is for two primary reasons:

  1. CBOR is comparable to JSON, because it has a superset of JSON's ability, it just.... serializes to a binary format.
  2. More importantly, they both therefore share a huge portion of the underlying information model. That is why the language CDDL can represent them both, the language already abstracts (the CBOR-specific prelude excluded, of course) from the actual encoding, which is what an information model usually does.

In any case, the characteristics of arrays and map are the same in both encodings. If those are meant, I agree that the semantics can probably be derived from the corresponding definitions, as Mike already suggested:

https://tools.ietf.org/html/rfc4627#section-2.2
https://tools.ietf.org/html/rfc4627#section-2.3
(and Major Type 4 & Major Type 5 in https://tools.ietf.org/html/rfc7049)

@jimsch
Copy link
Contributor

jimsch commented Jan 10, 2017

I think that this could probably have been written just as easily as "based on experience with JSON". I just read it as we should have these types available because we have found them useful. They are available (I think) as primitives (ordered vs unordered lists?) so I think that it has been satisfied.

@henkbirkholz
Copy link
Member

Well, as the definition says: Maps are an unordered set of AVP that only allows exactly one instance of each attribute, but provides unambigous semantics. An array is an ordered set of values that allows combination of sequences of values with the same type, but therefore also allows for ambigous semantics.

I am in doubt that the ordered and unordered lists defined by the IM draft are either of those. I am also not sure if we need them, though. In general, it does not hurt to enable the use of JSON, I'd say.

@jimsch
Copy link
Contributor

jimsch commented Jan 10, 2017

An unordered list is defined as - here are a set of name and values pairs that can occur in any order in the list. To me this is semantically the same as a MAP.

An ordered list is defined as - here are a set of name and value pairs that can occur in a fixed order in the list. This is basically the same thing as what an array looks like assuming that you have the ability to deal with elements in the middle that are absent. This could be done by the use of tagging or nil points in the array to say that the field is not there. That seems to be to be the semantic equivalent of an array, but I can see some people might not agree with that.

@sacm
Copy link

sacm commented Jan 10, 2017 via email

@jimsch
Copy link
Contributor

jimsch commented Jan 11, 2017

Can you generate a pull request so we can see how this would be different from what is current in the document?

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

5 participants