Why do certain fields not behave like fields? Why do certain fields not behave like fields? For example 'Product title' and 'Product price' fields from Drupal Commerce:



You can tell that these two fields are composed very differently. I have noticed that most fields have the same composition as 'Product price' above; whereas 'Product title' doesn't even look like a field.

Matter of fact, the question could be rephrased as: why isn't 'Product title' a field, what is it? And how can I make it behave more like a field? Specifically, how to attach RDF mappings to 'Product title' using the RDF module, like you can with regular fields?
Product title is an entity property instead of a field. See blog post by Wolfgang Ziegler for an explanation.

You should be able to add RDF definitions by using hook_rdf_mapping(). I looked into the Commerce module and it didn't use the hook. You might want to file an issue on the Commerce project page.

Luckily you can define the RDF mappings by yourself. Below is an example code which might work.

function your_module_rdf_mapping() {
  return array(
    array(
      'type' =&gt; 'commerce_product',
      'bundle' =&gt; RDF_DEFAULT_BUNDLE, // might be something else
      'mapping' =&gt; array(
        'rdftype' =&gt; array('sioc:Item', 'foaf:Document'),
        'title' =&gt; array(
          'predicates' =&gt; array('dc:title'),
        ),
      ),
    ),
  );
}


If you want to expose entity properties to the UI, you can use hook_field_extra_fields(). Node module is using that to expose the title property to the UI. Below is an example code of that.

/**
 * Implements hook_field_extra_fields().
 */
function node_field_extra_fields() {
  $extra = array();

  foreach (node_type_get_types() as $type) {
    if ($type-&gt;has_title) {
      $extra['node'][$type-&gt;type] = array(
        'form' =&gt; array(
          'title' =&gt; array(
            'label' =&gt; $type-&gt;title_label,
            'description' =&gt; t('Node module element'),
            'weight' =&gt; -5,
          ),
        ),
      );
    }
  }

  return $extra;
}