Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

I just wanted to note in this issue that Dublin Core has moved towards recommend placing metadata using RDF. If you look at the Dublin Core User Guide and search for 'RDF', that section explains the history. You can also look at their most recent guide to publishing metadata (2011), you'll see that the examples are RDF.

However, some organizations and governments might still rely on the old-school DC. style of meta tags, so this support may still be necessary.

DamienMcKenna’s picture

Title: Dublin Core tags » Add new meta tag: Dublin Core

Updated title.

BarisW’s picture

Status: Active » Needs review
FileSize
12.06 KB

Gents, attached is the Dublin Core integration of Metatag. Patched again 7.x.1.x-dev.
All credits go to my colleague Marty2081.

The Dublin Core Metatag submodule is developed by LimoenGroen on behalf of Gemeentemuseum Den Haag..

Status: Needs review » Needs work

The last submitted patch, issue-1491616-3-metatag-dublin-core.patch, failed testing.

BarisW’s picture

Status: Needs work » Needs review
FileSize
12.03 KB

Eat this, test bot..

rooby’s picture

Awesome thanks. I made my own in the meantime but I will test this and convert to using it asap.

I have one point for discussion, which you may have already considered:
For my quick fix solution from #1208366-8: Port to Drupal 7 I used the dcterms namespace.
Should we use the legacy dc namespace, or the dcterms namespace.

There is some information regartding this spread thinly around the dublin core documentation but the most concise information I have found is:
http://wiki.dublincore.org/index.php/FAQ/DC_and_DCTERMS_Namespaces

Marty2081’s picture

Hi Rueben,

I guess you're right and we should use the dcterms namespace, but I'm a bit lost on how to properly populate the DC tag values. I understand the definitions in the dc namespace had no defined domains or ranges and the overlapping ones in the dcterms namespace do have defined ranges.

For instance: the dcterms:creator value must be one of class "Agent". What would one put into dcterms:creator? Can you still just put a String in there like "John Doe"?

yashadev’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #5 applied cleanly and works well

rooby’s picture

Status: Reviewed & tested by the community » Needs review

See that there are discussion points in #6 that need to be answered before this gets committed.

I'm not comfortable marking ready for commit until that is sorted because we don't want to have to change it down the track.

Marty2081’s picture

Can you answer my question in #7 then?

DamienMcKenna’s picture

Related issue for Nodewords: #518274: Add more Dublin Core meta tags

RedTop’s picture

To further implementation and help along the discussion, here's my two cents.

Perhaps implement the current patch with the legacy namespace and perhaps built on that by later providing an option to allow developers to choose between the two namespaces? It all seems rather fluid now and I would rather stick to something which is already widely accepted, especially with such a conservative audience (info managers are the worst imo. :P)

nick_schuch’s picture

In response to RedTop in comment #12 I have attached a patch that provides a config form to change between the two metatags.

This is more of a proof of concept, let me know what you think.

Status: Needs review » Needs work

The last submitted patch, issue-1491616-13-metatag-dublin-core.patch, failed testing.

nick_schuch’s picture

Second times the charm.

nick_schuch’s picture

Status: Needs work » Needs review
miaoulafrite’s picture

thanks nick_schuch

i found out a little mistake i guess when you set up default value for metatag_dc_prefix.

it is actually set to CD where it should be DC

attached is a patch

Status: Needs review » Needs work

The last submitted patch, metatag_dc-metatag_dc_prefix-default-value-.patch, failed testing.

miaoulafrite’s picture

FileSize
2.18 KB

by the way, for date properties for example, schema shouldn't be scheme ?

i also found out that in DC.identifier default values, a "/" is missing after [site:url]

attached is a new patch

miaoulafrite’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

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

rooby’s picture

@miaoulafrite:
Your patch needs to include all the changes from #15.

That patch is 26k and yours is only 2k.

sylus’s picture

Rerolling the metatag patches with all fixes mentioned above.

sylus’s picture

Status: Needs review » Needs work
FileSize
14.03 KB

Whoops that was the original. I patched with recent changes but left out the patch file that was added in #17.

sylus’s picture

Status: Needs work » Needs review

Setting to needs review

sylus’s picture

Status: Needs work » Needs review
FileSize
26.61 KB

Adding modifications including the patch file included from #17 in case this was intentional.

mgifford’s picture

this patch applies fine to the git repo and really should be part of the next release of this module.

Minor issues when applying this to git:

warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

I also applied this to 7.x-1.0-alpha8, installed the module & went /admin/config/search/metatags/dublin-core

this is a picky point, but don't think the tab needs to say "Dublin Core Configuration" think that just "Dublin Core" would be sufficient & more consistent.

sylus’s picture

Rerolled fixing whitespace errors and fixing title suggestion as per #27

mgifford’s picture

Excellent. Now in trying to play with this a bit more I wanted to set it up so that I had some default DC metatags here admin/config/search/metatags

Strangely, all the types have become:

Unknown
Unknown: Unknown

Now this might be some unrelated bug, but I had (after applying the patch) gone their previously and seen the normal types:

Global
Global: Front page
Content
Taxonomy term
User

Gone into "Global: Front page" and tried to add some random metadata so it can appear on the front page.

Even after clearing the cache it all simply said Unknown.

sylus’s picture

Hmm I am not quite sure what is going on, can you try a fresh site? I am not able to reproduce this error.

mgifford’s picture

Status: Needs review » Reviewed & tested by the community

Seems to work fine on a test install.

DamienMcKenna’s picture

Assigned: Unassigned » DamienMcKenna
Issue tags: +D7 stable release blocker

I'll review this shortly.

DamienMcKenna’s picture

I've reviewed this and it looks good so far. I've written to the Dublin Core General Mailing List to ask for clarification on a few items, once I receive a response I'll be happy to help finish this and add it to the stable release.

rooby’s picture

Great. Their documentation definitely leaves me wanting clarification on things :)

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Nodewords-Metatag feature parity

Per emails with Stuart Sutton, the Managing Director of the DCMI, some changes are necessary:

  • The separator between the prefix and the tag name should be a colon rather than a period.
  • It may be advantageous to allow both prefixes be used, though default to "dcterms".
  • Prefixes and meta tag names should be lowercase.
Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
13.07 KB
14.01 KB

An updated patch which uses colon separators instead of periods and changes all prefixes and tag names to lowercase.

I'm not sure what should be done to address using both prefixes while defaulting to "dcterms":

  • Should a set of tags with each prefix be output all of the time (with no configuration option)?
  • Should a checkbox be added to the configuration page which allows the user to select "dc", "dcterms" or "both"?
  • Should the user be able to configure the prefixes per meta tag?
DamienMcKenna’s picture

Status: Needs review » Needs work

Thanks for the updated patch.

A few further suggestions:

  • metatag_dc_submit() should clear the caches itself, rather than just recommending the user do so.
  • metatag_dc_page_build() should detect which schemas to add rather than automatically adding both.
  • Thinking on it further, I think that for now we should be ok with just having a selector for "dc:" vs "dcterms:", we'll wait to see if anyone specifically requests allowing them to be edited separately.
sylus’s picture

Also one minor thing I noticed with coder review is that:

drupal_set_message("The cache needs to be cleared for this setting to take effect.");

Should be wrapped in t()

Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
1.48 KB
14.02 KB

New patch to incorporate the feedback from #37 and #38.

Changes:

  • When submitting the prefix configuration form the 'cache_metatag' cache bin is now cleared.
  • Removed the unnecessary warning message.
  • Added a switch statement to detect which prefix is currently selected and only include the schema for the currently selected prefix.
mgifford’s picture

@sylus & I were chatting offline & wondered if any thought has gone into HTML5 & Dublin Core? There are variations which should be considered at some point, but possibly in a future release:

http://efoundations.typepad.com/efoundations/2010/02/html5-metadata-and-...
http://theroadtojoy.at/cheatsheet/dc-html5/

DamienMcKenna’s picture

@mgifford: We'll consider that after v1.0 but in a separate issue, thanks for the links.

DamienMcKenna’s picture

@Devin: thinking on it further, I think we should scrap supporting the "dc:" tags entirely and focus on just "dcterms:" for now, if anyone specifically asks for it we'll do a follow-up issue.

DamienMcKenna’s picture

Status: Needs review » Needs work
Anonymous’s picture

FYI, the explanation in the first link provided by mgifford above actually comes from an incorrect reading of the different specs involved.

For example:

As for the case of name, the microdata specification refers to the possibility that @rel values are URIs, and again I think the implication is that such URI values are exempt from the registration requirement (though, again, this does not seem clear from the discussion in the "core" HTML5 spec).

Microdata doesn't make use of the rel attribute at all, so these two parts of the HTML5 spec don't relate to each other.

The second link use the old style DC metadata, which isn't currently advocated by Dublin Core.

colan’s picture

Re #35: I'm not sure about the colon instead of the period. I'm getting validation failures because things like "dcterms:creator" are being used instead of "dcterms.creator":

Line 6, Column 81: Bad value dc:creator for attribute name on element meta: Keyword dc:creator is not registered.

  • …eta name="dc:creator" content="blah" />
  • A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself.

We should probably stick with the "." as per the W3C, correct? All of the dot attributes are listed there, but no colon ones.

DamienMcKenna’s picture

@colan: See #35 above. I've had emails with the Dublin Core director who says to use a colon vs period instead as a divider. That said, I've notified them about the WHATWG's incorrect status.

DamienMcKenna’s picture

I've since found a DCMI document from 2008 that says to use dot notation, so I've requested clarification - I'll let you know what I find out.

rooby’s picture

In my previous investigations into dublin core it's as clear as mud.
Glad to know I'm not the only one that thinks so :)

DamienMcKenna’s picture

Further, on page 18 of the Intro to Dublin Core presentation from the 2011 DCMI Conference it shows both "dc:title" and "dc.date" - both notations. Argh.

DamienMcKenna’s picture

One final link: the "Notes on DCMI specifications for Dublin Core metadata in HTML/XHTML meta and link elements" document published in 2008 references "dc:language", but elsewhere says:

SHOULD be aware that all "prefixed names" (whether containing a single period character ("DC.date") or multiple period characters ("DC.date.someEvent") are interpreted as RDF predicates/property URIs using a single rule based on simple concatenation of the "namespace URI" and "local name".

I think we should go back to DC-HTML's authoritative statement:

A DC-HTML Prefixed Name consists of a "prefix" followed by a period (".") and a "local name".

DamienMcKenna’s picture

@rooby: Yeah, like I said I've asked for clarification from the director, I'll post an update as soon as I know something then we can finish this patch off.

manhalt’s picture

Status: Needs work » Needs review
FileSize
14.26 KB

This is the same as the patch from #39 but I've improved the description on the main fieldset.

DamienMcKenna’s picture

FileSize
13.01 KB

A bit of an update:

  • Standardized on the 'dcterms.' prefix, thus also removed the custom settings page.
  • Improved the info file's description field.
  • Added a README.txt file.

@linclark: Would you mind taking a look and letting me know if this is ok? Thanks.

Anonymous’s picture

@DamienMcKenna I'm not familiar with the dot-style DC metadata. I only have experience with the RDF style.

scor’s picture

After discussing this with Thomas Baker, we concluded it was probably best to use the "." notation as default for now. The DCMI does intend to make this notation archaic and move to the RDFa notation in the future, but there is not official documentation on that yet, and thus the consumers currently expecting the "." notation haven't been updated to the ":" notation. So it seems best to go ahead with the latest patch.

In the future for follow up issues, you might want to provide an option to choose which delimiter/notation to use in case some site administrator want to publish DC metadata with the newer ":" notation depending on which consumers they are targeting. In a more extreme case, some might have a need to support both at the same time, hence duplicating each metadata tag.

When using the "." notation, there is no need to publish any xmlns namespace.

DamienMcKenna’s picture

Per emails with Thomas Baker and others, I've refocused this issue on using the dot-notation format defined in DC-HTML; I'm also going to learn about how to handle RTFa in Drupal and see what Metatag (and Nodewords) can do to better work with it.

DamienMcKenna’s picture

Status: Needs review » Needs work

The patch needs some updating per @scor's suggestions in #55.

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
0 bytes

I've removed the xmlns definitions per scor's comment, tidied up the README.txt file and removed some unnecessary code that had been previously commented out. I think this should be pretty good to go.

DamienMcKenna’s picture

FileSize
13.18 KB

Oh, it might help if I output the correct patch :-P

DamienMcKenna’s picture

Status: Needs review » Fixed

I've committed the patch from #59, thanks for everyone's help!

rooby’s picture

Great news! Thanks to all also.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Last night saw the release of 7.x-1.0-beta1, so I'm closing all these "fixed" issues in the interest of tidying up the issue queue. Thank you all for your help getting us to this point!

DamienMcKenna’s picture

Issue summary: View changes

Clarified the issue on the 15 basic tags and DC-HTML.

DamienMcKenna’s picture

Assigned: DamienMcKenna » Unassigned
Issue summary: View changes