State of schema.org in Drupal 8

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

This wiki page represents the current state of the schema.org support for Drupal 8. Every attempt will be made to keep this document as up to date as possible.

Schema.org is an initiative from the major search engines to standardize a set of types and properties for describing the content in web pages. Google, Bing, Yahoo! and Yandex use this structured data as additional hints to better understand the content and improve the user experience of their products (Rich Snippets are one example). Schema.org launched in June 2011, 6 months after Drupal 7 was released. Work has been going on over the last few months to integrate schema.org in Drupal 8 core. These are the changes which have been committed to Drupal 8 so far:

  • The way RDF mappings are stored has been refactored to be more in line with the new Entity API and use the new configuration API (CMI) (#1869600).
  • Most of the terms from the vocabularies we used in Drupal 7 (Dublin Core, FOAF, SIOC, SKOS) have been replaced with their equivalent from schema.org (#1784234).
  • Datatype callbacks have been made more flexible to address the needs of schema.org (#2020001).
  • Allow field formatters to inject RDFa attributes directly in their HTML output, leading to better quality markup for fields like file, image and taxonomy term reference (#1778122).

Below is the new schema that gets installed with the standard profile. Please leave comments below if you have feedback.

D8_RDF_Schema_2013-07-26.png

Preview schema.org and Drupal 8

You can preview the schema.org markup generated by Drupal 8 on the Schema.org + Drupal 8 sample site. You can also get your own ephemeral Drupal 8 sandbox online thanks to the Simplytest.me service.

What remains to be done

There is more work needed to make schema.org support in Drupal rock. The major limitation at the moment is the lack of support for compound fields which hold more than one value, such as address field (street, locality, zip code, country), fivestar rating (average vote, total votes) or link (URL and title). Some of these are not part of core but we need to have the API in place to support them in contrib to avoid the situation we are currently in in Drupal 7. For that to be possible, the RDF mapping definitions need to be extended to allow for multiple mappings for field (#1778194). Fields are currently limited to one mapping each, which is sufficient for text-like fields and entity reference fields but not sufficient for compound fields.

There is also an issue open to improve the handling of RDF namespaces (#1778410), and more generally we also want to strengthen our markup tests (#2034951) to use the EasyRdf library we've added to core. You can find a more exhaustive list of issues (some of which have already been resolved) in the Fix RDF meta issue) that Lin compiled a few months ago.

How to get involved

If you want to help, join us on IRC in the #drupal-rdf channel, jump in one of the issue linked above, or leave a comment below.

We hold a weekly code sprint every Tue at 4pm EST. Anyone is welcome to join in remotely on IRC: #drupal-rdf.

Funding and credits

Thank you to Acquia and Agaric for sponsoring this work, and to developers Lin Clark, Stéphane Corlosquet, Jesse Day, Kay VanValkenburgh. We also want to thank other members of the community for their reviews and feedback: yched, fago, effulgentsia, Berdir, etc. Work is not complete yet so this will likely grow.

AttachmentSize
D8_RDF_Schema_2013-07-26.png364.78 KB

Comments

Code sprint this Wednesday am

scor's picture

We will have a code sprint this Wednesday morning, July 31st in Cambridge, MA (contact me for the details if you can make it physically). We'll start at 7:30am EST. Anyone is welcome to join in remotely on IRC: #drupal-rdf.

This post ranks well for

allella's picture

This post ranks well for Drupal 8 and Schema.org, but it's not been updated. So, providing links for the next guy.

RDF made it into Drupal 8

There is an RDF UI contrib module for Drupal 8 that puts a UI on mapping schema.org fields. (based on Sachini's Google Summer of Code project)

I am curious if you can download YAML (.yml) fields for various schema.org content types and drop them into a custom module or otherwise import them in as a new content type without having to manually build all the schema fields.

Excellent idea

scor's picture

You are right. I added a note on Drupal 8 at https://www.drupal.org/project/schemaorg.

I am curious if you can download YAML (.yml) fields for various schema.org content types and drop them into a custom module or otherwise import them in as a new content type without having to manually build all the schema fields.

Yes, you can. You can go to admin/config/development/configuration/single/export and export the mappings for an individual content type. If you wanted to export a set of dependencies from your site, for example a content type, its fields and its mappings, you would most likely first export your entire site configuration and then pick the content type files and its dependencies. I'm not aware of a module that can do that for you, but such module might already exist, if not it will soon. What you are referring to here is the concept of content configuration packages, a topic that we discussed on a podcast due to come out this week or next week. I'll post a link here when it's out.

Edit: looks like the Drupal 8 version of feature will support what you are looking for: https://www.drupal.org/project/features

Semantic Web

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: