Jump to content

RDFa Semantic web


deandre212
 Share

Recommended Posts

A way to automatically embed RDF (RDFa) in mark-up. Web semantics is the future of the web and to me native RDFa support is something that could help push PW2 into the forefront.

Google is consuming it where it finds it, using it to generate more accurate and relevant search results. Best Buy is now famous for having enjoyed a 30% increase in sales since incorporating RDFa into their online shopping site.

Link to comment
Share on other sites

Adam is right, and I'll expand on what he said. Things like RDFa and microformats are part of your markup. If you are wanting to support these, ProcessWire supports it. ProcessWire doesn't generate markup (except for a few helper plugins). Instead, it manages your content and lets you decide how you want to mark it up and output it. That is to say, it's already RDFa and microformats ready. However, you still have to decide when and where you want to mark up your content this way.

While you could use TinyMCE, I think I'd want to do so with the support of a TinyMCE plugin. I'd want something foolproof that doesn't get me involved in the technical details of RDFa every time I add a page to my site. If that is also your need, I would structure your data semantically using fields in ProcessWire for data that you want to markup with RDFa attributes. Then take the semantic data from your page fields, and use RDFa attributes when you output your markup. This will work great for many instances. But it doesn't solve the need for contextual RDFa attributes that appear in content you've input into TinyMCE. I did a quick search for an RDFa plugin for TinyMCE and it sounds like there are people working on it, but nothing concrete (as far as I can tell). So for that type of RDFa support, we may have to wait till a rich text editor has proper support. Though that would put pretty much all CMSs in the same spot on that particular issue. I will keep an eye on this and do more research, as I do think this is an important thing.

Thanks,

Ryan

Link to comment
Share on other sites

Yes, I was going to ask Adam to show me in which way TinyMCE can handle rdfa because I know of none. And yes I understand that ProcessWire does not generate mark up. And I believe it doesn't have to in order embed the rdfa output into the html. It just needs to know where to output. Say that rdfa output could be achieved through a plugin. The plugin could be used to inject the namspaces into the doctype. And where you have a headline field, the plugin would inject rdfa attributes and so on. The markup is completely left up the you. I understand that you could add rdfa attributes to the markup yourself but I think a plugin that automatically injects rdfa attributes based on the context of the fields used in a template is a good idea. That would probably call for specific fields to used for specific types of data i.e. dedicated fields for title/headline, creator/author, post date, body, image and so forth. This is somewhat how plugins for wordpress and drupal handle rdfa. Drupal 7 have rdfa natively (as a plugin). The problem with those cms is that you HAVE to do things there way and they generate markup instead of letting you create your own. The one thing that draws me to this cms is the ability to control the way your site functions and generates its markup. But I do believe a little automation in the form of plugins can help end users.

Link to comment
Share on other sites

deandre: I apologize for being obvious when it was needed: I personally  never heard of RDFa before, but since it seems to be in XHTML, you have total control around id.

You may want to:

  • add RDFa support to all custom fields. simply add RDFa tags to titles, and all custom generated markup.
  • create included file RDFa.php (or whatever the name)
  • in that file, create function RDFize() (or whatever the name), that you will call on fields with markup, so instead of echo $page->body you will do echo RDFize($page->body);

I believe that's currently only solution [or add RDFa tags via HTML section in TinyMCE, however there will be probably some hacking involved].

Adam

Link to comment
Share on other sites

If anyone wants to take the lead on building this functionality, I'll be glad to collaborate with you on making it a ProcessWire module. Based on what Deandre212 posted, I am thinking it might involve a Page::render hook that looks for certain tags and adds attributes to them. Or, [possibly better] it might involve creating a new RDFa runtime TextFormatter module that you can assign to text fields like text, textarea and textarea-tinymce. For an example of an existing runtime text formatter, see any of the modules in here: /wire/modules/Textformatter/.  While I know how the ProcessWire side would work, I don't really know how the RDFa side would work...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...