In all the hard work we've done to make sure the terms were properly annotated on node pages, we've missed the term pages themselves :( To fill that blank, and in line with what we already do for nodes and users, we should add the title of the term in a meta tag on top of the HTML document, including its RDF type.

It's great to see that the term description is displayed on the term page too (if it exists). However it seems it's not using a field and therefore does not expose the RDF mapping which is present in core as part of taxonomy_rdf_mapping()!

The good news is that by virtue of the fact that we have RDFa on terms displayed as part of the node teasers, we do have in fact the relation between the term and all the nodes being displayed. But that's assuming the terms are displayed in teaser mode. Site administrators could decide to remove them from the teaser and we would lose this relation. Let's see if there is an easy way to add it in the wrapper for each node.

Comments

Anonymous’s picture

StatusFileSize
new1021 bytes

This patch takes care of :

To fill that blank, and in line with what we already do for nodes and users, we should add the title of the term in a meta tag on top of the HTML document, including its RDF type.

See #712914: rdf_template_variable_wrapper does not work for unrendered template variables for a discussion of :

[term description is] not using a field and therefore does not expose the RDF mapping which is present in core as part of taxonomy_rdf_mapping()!

I will check on the wrapper for each node and add tests.

Anonymous’s picture

StatusFileSize
new1.31 KB

This patch includes the annotation for the term description.

It requires #712914: rdf_template_variable_wrapper does not work for unrendered template variables to work.

It would also require a solution #712920: rdf_template_variable_attributes_array doesn't allow you to set value for 'inline' in order to output valid XHTML.

Anonymous’s picture

Status: Active » Needs review

In thinking about the wrapping the node issue, do we want to expose the tag even if it's not exposed in the HTML?

For instance, if taxonomy is used as an internal way of organizing content, a site administrator may set the tags to hidden on both the node and the teaser and not realize that the terms are still being exposed. Certainly an edge use case, but possibly one to consider.

Status: Needs review » Needs work

The last submitted patch, rdf_termpage_711848_2.patch, failed testing.

scor’s picture

Status: Needs work » Needs review
StatusFileSize
new2.13 KB

Let's focus on the most important aspect of this issue for now. This patch adds the term name and RDF type to each term page. Most importantly, it ensures that dereferencing a term URI in Drupal returns the same RDF data as what is stated elsewhere in Drupal: this is one of the main pillar of Linked Data. Yahoo! SearchMonkey for example will ignore statements about a resource if these are not present when looking up the resource itself.

Anonymous’s picture

Status: Needs review » Needs work
+++ modules/rdf/rdf.test
@@ -332,6 +332,21 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
+    $this->assertTrue(!empty($term_rdfa_meta), t('RDFa markup found term page.'));

Just a small typo, 'RDFa markup found term page.' should be 'RDFa markup found on term page.' It is missing the on.

Otherwise looks good.

148 critical left. Go review some!

scor’s picture

Status: Needs work » Needs review
StatusFileSize
new2.13 KB

typo fixed!

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

This is ready to go. As scor said in #5, it adds the term name and RDF type to each term page so that the term URIs actually dereference.

dries’s picture

#711848 by linclark, scor: added missing RDFa annotations on term pages.

+++ modules/rdf/rdf.module
@@ -630,6 +630,24 @@ function rdf_preprocess_comment(&$variables) {
+        'content' => $term->name,

I wonder if we're missing a check_plain here...

scor’s picture

Dries: I also checked this out before posting the patch #7: all elements are processed by theme_html_tag which escapes the values via drupal_attributes().

scor’s picture

just realizing this was committed at as part of http://drupal.org/cvs?commit=339496 - leaving this RTBC to check whether Dries meant to commit this or not.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Yep, meant to commit this.

Status: Fixed » Closed (fixed)
Issue tags: -RDF

Automatically closed -- issue fixed for 2 weeks with no activity.