Comments (22)
If you want to make
@content
more generally applicable, you either need to update HTML […], or provide for@content
as being a global Microdata attribute, similar to@itemprop
.
Yep. And since we are already changing / extending HTML in this spec, I suggest that if we decide we want to do this, we start by stating that for microdata @content
is global, and then file an issue to see if HTML will accept that for HTML in general.
from microdata.
This would be as a synonym for @value
, right? Should we explicitly acknowledge it, or note that it should be processed appropriately but is invalid as content?
from microdata.
Looking at that, about 60% are of the examples are valid given that they use meta content="[something]"
which is accounted for in the spec already. But that leaves about 40%, where there is some other element.
If the processors actually handle the content
attribute for e.g. span
or p
elements, the required changes are:
- add a step before the last one in the algorithm than finds the value, along the lines of
Otherwise, if the element has a
value
attribute
the value is the value of the element'svalue
attribute
-
note in the changes to HTML that
content
becomes a global(?) attribute - or some other expansion of where it is valid -
describe what to do with it in the example stuff.
Do you have some test results?
from microdata.
Here's a test
<p itemscope itemtype="http://schema.org/Offer">
<span itemprop="name">A test description, price is 10000 GBP.</span>
<span content="10000" itemprop="price">10.000</span>
<span itemprop="priceCurrency" content="GBP"></span>
</p>
- Google's SDTT seems to understand @content but not understand @value here (on the price property)
- The opensource structured data linter doesn't seem to accept either.
Looking around https://w3c.github.io/html/fullindex.html#attributes-table there are several elements listed in that table for 'value' but not enough to match @content's functionality yet as I understand it.
/cc @gkellogg
from microdata.
According to the Microdata to RDF spec, @content
is only used on the meta
element, as this is how it was described in the original Microdata spec. Of course RDFa accepts @content
on any element.
See microdata-rdf/issues#7.
If you update this in Microdata, we'd also need to update Microdata to RDF (or simply include the RDF conversion bits in the new Microdata spec).
from microdata.
The Yandex Structured Data Validator recognised it too.
@gkellogg yes, this would be a substantive change. On the other hand, if that's what happens in reality, it seems to be a reasonable one to make.
@danbri do you have any handy data on the use of @content
in the wild, for microdata (as opposed to RDFa)?
from microdata.
Here's a test where the answers are clearer - if @content is supported on anything, the price is "Super cheap!!1" and the currency "GBP". Other variations may occur. Again, the [Yandex Structured Data Validator](https://webmaster.yandex.com/tools/microtest/) read both the
content` attributes.
<p itemscope itemtype="http://schema.org/Offer">
<span itemprop="name">A test description, price is 10000 GBP.</span>
<span content="Super cheap!!1" itemprop="price">10.000</span>
<b itemprop="priceCurrency" content="GBP">£ Sterling</b>
</p>
from microdata.
Not handy but I could look into it. I guess the central interest is on non-meta elements, maybe ratios would be something I could get shared.
from microdata.
Note that the Content model for span does not include @content
, but rather Global Attributes. The Content model for meta, does specifically include @content
.
If you want to make @content
more generally applicable, you either need to update HTML to make @content
a global attribute, or provide for @content
as being a global Microdata attribute, similar to @itemprop
.
IIRC, we were leveraging off of the HTML content model to use @content
on meta
(as well as a handful of other data attributes).
Arguably, having @content
on span
should be flagged as an error by an HTML validator.
from microdata.
@gkellogg if we made @content global, would you be likely to update any implementations to track this?
My understanding is that at least major implementations (Google, Yandex) already treat it as global, and that it addresses practical shortfalls of Microdata. So I'd like to propose we make @content a global HTML attribute.
from microdata.
@danbri, I'd certainly update my implementation. Do you imagine incorporating Microdata to RDF in your Microdata update? If not, we'll need to plan on updating that too.
from microdata.
Note that there are other attributes with special content-like attributes:
data
andmeter
use@value
which is interpreted as a numeric typeobject
uses@data
interpreted as a URI@time
uses@datetime
.
Of these, it might be worth considering @value
to be generic, as there is no other reasonable way to get such datatyped literals out of Microdata.
from microdata.
Linter and Distiller updated to allow @content
universally.
from microdata.
That seems like we probably should just do this… We've got enough interop to show it can be done easily, we have schema.org examples out there suggesting it and we know that people use that, we have an example that it probably isn't a major imposition on implementations, and in any event RDFa already parses this so it brings us into closer alignment.
I'd like to have the data on usage in the wild, but if #35 lands, I'll happily put this in the spec… (I don't think this conflicts with #35 but they both touch a bunch of places, and I am sure that after landing the two there will be cleanup to do, plus #35 would benefit from a few pairs of thoughtful eyes so a couple of days extra seems wearable). Assigning it to me with the assumption that we will move forward...
from microdata.
+1, adding @content globally sounds fine to me. I'd check with @Hixie to understand why it wasn't included in the first iteration of Microdata (other than it being "allowed" in the content model - what are the validators going to say? Do people care about validating HTML these days? I know we stopped doing this a long time ago at our company).
from microdata.
It fared poorly in usability studies.
from microdata.
@gkellogg on #20 (comment) : I think I would prefer to issue a new release of the RDF conversion document rather than adding it to the core microdata spec. It would create too much (unnecessary) discussion about the role of RDF, and we do not need that.
I am a bit neutral whether the RDF conversion spec should remain a note or become a rec. But I have a mild preference of republishing it in the Web Platform WG.
from microdata.
+1 adding @content
, too. The example on the numbers are typical use cases where this becomes extremely handy; the human readable text may not always coincide with the machine readable format.
I am not sure when I would update the Microdata parsers in RDFLib and in my Microdata distiller, but I would certainly try to find time for it (however, the prerequisite is to update the RDF conversion document as well.
from microdata.
Can we keep the "RDF conversion" question in #3, so this issue is just about whether or not to add @content
, please?
from microdata.
@chaals, apologies:-)
from microdata.
@Hixie said:
@content fared poorly in usability studies.
So my +1 to add it is now a +0. Do we either have 1) Data from @Hixie noting the usability studies (doubtful, as Google has not released this data to the public AFAIK), or 2) Demonstration that "@content" is being used across X million sites in Microdata markup.
If we don't have data for either, we're just flying by the seat of our pants (which is usually a bad thing to do spec-wise).
There is another option here, which is to fix the schema.org examples.
from microdata.
@content
fared poorly in usability studies.
I've never understood how you can do usability studies on the use of attributes. RDFa allows the use of @content
universally, and having it be restricted seems to be less usable than having it universal.
from microdata.
Related Issues (20)
- Global Identifier
- Values section title odd
- Textual property value does not use language of the element HOT 4
- No description of how numeric property values are obtained. HOT 12
- Incomplete sentence: "User agents are"
- Syntax highlighting not working correctly HOT 12
- Capitalization of "microdata"
- give examples and algorithms a URL HOT 1
- Provide an example of itemid
- incomplete sentence "User agents are" HOT 2
- RDFa and JSON-LD are not equivalent HOT 12
- RDFa should generate to RDFa Lite HOT 4
- Use the same example for JSON-LD and RDFa HOT 6
- Reference to [microdata-rdf] should be changed HOT 13
- Reusing components in different contexts HOT 4
- itemref as a url, not just an ID within the same document
- "Valid" definition doesn't resolve
- "Our company" example is confusing
- Hedral the Cat HOT 1
- Hedral Issue 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microdata.