As done for other modules we need to add RDF to comment module.
There are three steps to this:
1. Add comment_rdf_mapping to the comment module with something like this
return array(
'comment' => array(
'rdftype' => array('sioct:Post'),
'title' => array('dc:title'),
'created' => array(
'properties' => array('dc:date', 'dc:created'),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'replyof' => 'sioct:reply_of',
)
);
2. Use rdf_comment_view to add the RDF mapping to the comment object
function rdf_comment_view($comment){
$comment->rdf_mapping = rdf_get_mapping('comment');
}
NB: We can't use rdf_comment_load which would be cleaner because there is currently a bug (will create issue and update this with that)
3. Use rdf_comment_preprocess to actually add the RDF in the template.
This process is also the general model for adding RDF to other entities.
Comments
Comment #1
stefan freudenberg commentedTo add markup to the date a comment has been posted I would need to disable escaping. Instead of
I'd like to have
in comment.tpl. Is it ok to change it?
Comment #2
stefan freudenberg commentedImplemented comment_rdf_mapping.
Comment #3
scor commentedthis was integrated in the main RDF patch #493030: RDF #1: core RDF module.