-
Notifications
You must be signed in to change notification settings - Fork 23
Improve keyword descriptions #92
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
Conversation
@azaroth42 I didn't see a way to significantly improve 4.2.1; perhaps the other changes do the job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good with editorial nits.
index.html
Outdated
@@ -3025,7 +3114,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3> | |||
</pre> | |||
</aside> | |||
|
|||
<p>The <em>modified</em> key's value above is automatically type coerced to a | |||
<p>The <em>modified</em> key's value above is automatically type interpreted as a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"type interpreted"? not familiar with that term? Did we rename "type coercion" to "type interpretation"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iherman had some pushback on the notion of "type coercion", and "type interpretation" seemed like it might be a better fit. What happens in this case, is that the @type
in the term definition is what allows the string value to be interpreted as a dateTime
. But, it should probably be "interpreted as" rather than "type interpreted as".
Personally, I could go either way on this. Strictly speaking, "coercion" would be when something of one type is converted to another type, perhaps automatically because of an operation such as addition or concatenation. In this case, arguably, the string has no inherent type, and it is interpreted as an xsd:string
, in the absence of any more explicit @type
declaration.
</dd> | ||
<dt><code>@type</code></dt><dd> | ||
The <code>@type</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>value object</a>. | ||
The unaliased <code>@type</code> MAY be used as a key in an <a>expanded term definition</a>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it sound like an aliased @type
MAY be used as a key in an expanded term definition... guessing other rules prevent this... probably don't need to change it, but my reading of the previous sentence and this sentence threw me a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pattern I came up with, and I'm happy to do something else. The first sentence says that it may be aliased when used in a node object or value object. The second is that it may be used unaliased as a key in an expanded term definition.
Suggestions for a clearer description welcome.
index.html
Outdated
<dd>Used to set the type of a <a>node</a> or the datatype of a <a>typed value</a>. | ||
This keyword is described further in <a class="sectionRef" href="#specifying-the-type"></a> | ||
and <a class="sectionRef" href="#typed-values"></a>. | ||
<div class="note">The notion of type can be confusing, as both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't start by saying that this can be confusing. It's confusing to people that have deep knowledge, but for beginners I don't expect it is.
Things have types. Nodes have types. Values have types. You use @type
to express that. That's not confusing.
The confusing part is probably the chording of @type
with other things like @value
and a node to get the expression you want... but we really only do that in one place that only experts tend to see.
In any case, I'd reword to something like:
The use of @type
to define a type for both node objects and value objects addresses the basic need to type data, be it a literal value or a more complicated resource. Experts may find the overloaded use of the @type
keyword for both purposes concerning, but should note that Web developer usage of this feature over multiple years has not resulted in its misuse due to the far less frequent use of @type
to express typed literal values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, the fact is, for many it seems to be a confusing issue. But, I like your wording better!
@gkellogg I like what I see, but I have two more proposals
|
@iherman Your first point is well taken, and I'll make the suggested change. Regarding changing |
@iherman I made your suggested changes to "Use of JSON Objects" and "Specifying the Type". |
@gkellogg thanks for the changes you made. Two more comments (just for nagging you:-)
Thx! |
… discussion of setting the type on value objects, with references to "Typed Values" and "Type Coercion".
4be2d3e
to
e937765
Compare
There are examples in the referenced sections, I don't see a point in repeating them, particularly as the section is mostly about typed objects. The "Specifying the Type" section is really about typing node objects, to make it clear, I discuss typing value objects and reference "Typed Values" and "Type Coercion". Do you really think we need to repeat that detail here? The reason "Specifying the Type" is in the "Basic Concepts" section, as this is considered a basic concept, while typed values are considered advanced. Otherwise, we'd need a separate section "Describing Nodes". But, there's really not enough there do do that, IMHO.
I'll pare out some of the repeated detail, but the original purpose of the note is that this describes basic features. Instead, I'll reference the "Advanced Concepts" section. |
@gkellogg first of all, I do not want to micromanage. As far as I am concerned this PR can be merged right away and it may be indeed enough to answer to #77. You are free to take or drop any of my comments. That being said, I guess the main reason of my comment is this remark:
I do not feel that typing a node is a basic concept whereas typing a value is an advanced. To be more precise, I do not see why these two should be different. You are right that section 4.2 is already there, in particular 4.2.1, and I understand that you do not want to repeat things. My feeling is, however, that 4.2 and 3.5 should be on equal footing; I do not have a strong feeling whether 3.5 should be moved into the 'advanced' category, or 4.2. (or possibly 4.2.1. only) should be put into the basic section, but I would think these two should be somehow kept together. Again, regardless from this, 👍 from me to merge at your discretion. |
…pts introduction.
@type
keyword definition, and added Uses of JSON Objects section.Addresses #77.
Preview | Diff