Giter Site home page Giter Site logo

Comments (22)

chaals avatar chaals commented on July 20, 2024 2

@gkellogg:

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.

chaals avatar chaals commented on July 20, 2024

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.

chaals avatar chaals commented on July 20, 2024

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:

  1. 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's value attribute

  1. note in the changes to HTML that content becomes a global(?) attribute - or some other expansion of where it is valid

  2. describe what to do with it in the example stuff.

Do you have some test results?

from microdata.

danbri avatar danbri commented on July 20, 2024

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>

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.

gkellogg avatar gkellogg commented on July 20, 2024

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.

chaals avatar chaals commented on July 20, 2024

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.

chaals avatar chaals commented on July 20, 2024

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.

danbri avatar danbri commented on July 20, 2024

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.

gkellogg avatar gkellogg commented on July 20, 2024

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.

danbri avatar danbri commented on July 20, 2024

@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.

gkellogg avatar gkellogg commented on July 20, 2024

@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.

gkellogg avatar gkellogg commented on July 20, 2024

Note that there are other attributes with special content-like attributes:

  • data and meter use @value which is interpreted as a numeric type
  • object 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.

gkellogg avatar gkellogg commented on July 20, 2024

Linter and Distiller updated to allow @content universally.

from microdata.

chaals avatar chaals commented on July 20, 2024

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...

@iherman @msporny ping

from microdata.

msporny avatar msporny commented on July 20, 2024

+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.

Hixie avatar Hixie commented on July 20, 2024

It fared poorly in usability studies.

from microdata.

iherman avatar iherman commented on July 20, 2024

@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.

iherman avatar iherman commented on July 20, 2024

+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.

chaals avatar chaals commented on July 20, 2024

Can we keep the "RDF conversion" question in #3, so this issue is just about whether or not to add @content, please?

from microdata.

iherman avatar iherman commented on July 20, 2024

@chaals, apologies:-)

from microdata.

msporny avatar msporny commented on July 20, 2024

@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.

gkellogg avatar gkellogg commented on July 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.