Skip to content

Commit

Permalink
Issue #83: Restore schema.org assignments to Application content type
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonrampton committed Mar 17, 2013
1 parent 7a563a5 commit 6954a76
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,171 @@ function appcat_application_content_node_info() {
);
return $items;
}

/**
* Implements hook_rdf_default_mappings().
*/
function appcat_application_content_rdf_default_mappings() {
$schemaorg = array();

// Exported RDF mapping: application
$schemaorg['node']['application'] = array(
'rdftype' => array(
0 => 'schema:SoftwareApplication',
1 => 'sioc:Item',
2 => 'foaf:Document',
),
'title' => array(
'predicates' => array(
0 => 'schema:name',
),
),
'created' => array(
'predicates' => array(
0 => 'dc:date',
1 => 'dc:created',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'changed' => array(
'predicates' => array(
0 => 'dc:modified',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'body' => array(
'predicates' => array(
0 => 'schema:text',
1 => 'content:encoded',
),
),
'uid' => array(
'predicates' => array(
0 => 'sioc:has_creator',
),
'type' => 'rel',
),
'name' => array(
'predicates' => array(
0 => 'schema:name',
),
),
'comment_count' => array(
'predicates' => array(
0 => 'sioc:num_replies',
),
'datatype' => 'xsd:integer',
),
'last_activity' => array(
'predicates' => array(
0 => 'sioc:last_activity_date',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'url' => array(
'predicates' => array(
0 => 'schema:url',
),
'type' => 'rel',
),
'field_aggregate_rating' => array(
'predicates' => array(
0 => 'schema:aggregateRating',
),
),
'field_application_category' => array(
'predicates' => array(
0 => 'schema:applicationSubCategory',
),
),
'field_civic_category' => array(
'predicates' => array(
0 => 'schema:genre',
),
),
'field_contributor' => array(
'predicates' => array(
0 => 'schema:provider',
),
),
'field_creator' => array(
'predicates' => array(
0 => 'schema:creator',
),
),
'field_description' => array(
'predicates' => array(
0 => 'schema:summary',
1 => 'schema:description',
),
),
'field_download_url' => array(
'predicates' => array(
0 => 'schema:downloadUrl',
),
),
'field_feature_list' => array(
'predicates' => array(
0 => 'schema:featureList',
),
),
'field_image' => array(
'predicates' => array(
0 => 'schema:image',
),
),
'field_install_url' => array(
'predicates' => array(
0 => 'schema:installUrl',
),
),
'field_keywords' => array(
'predicates' => array(
0 => 'schema:keywords',
),
),
'field_license' => array(
'predicates' => array(
0 => 'schema:publishingPrinciples',
),
),
'field_related_applications' => array(
'predicates' => array(),
),
'field_release_notes' => array(
'predicates' => array(
0 => 'schema:releaseNotes',
),
),
'field_requirements' => array(
'predicates' => array(
0 => 'schema:requirements',
),
),
'field_screenshot' => array(
'predicates' => array(
0 => 'schema:screenshot',
),
),
'field_software_type' => array(
'predicates' => array(
0 => 'schema:applicationCategory',
),
),
'field_url' => array(
'predicates' => array(
0 => 'schema:url',
),
),
'field_video' => array(
'predicates' => array(
0 => 'schema:video',
),
),
);

return $schemaorg;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ features[image][] = app_detail_logo
features[image][] = screenshot
features[image][] = small_square_thumbnail
features[node][] = application
features[rdf_mappings][] = node-application
features[schemaorg][] = node-application
features[taxonomy][] = application_category
features[variable][] = comment_anonymous_application
features[variable][] = comment_application
features[variable][] = comment_default_mode_application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*/

include_once 'appcat_application_content.features.inc';

19 changes: 19 additions & 0 deletions modules/features/appcat_misc/appcat_misc.module
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@
* @file
* Drupal needs this blank file.
*/

/**
* Implements hook_features_export_alter().
*
* Remove the uuid vocabulary terms, which we create in a separate
* features module because the terms are used by multiple features
* in this distro.
* See http://drupal.org/node/1698290
* (although it refers to tags rather than uuid_terms).
*/
function appcat_misc_features_export_alter(&$export, $module_name) {
$content_definition_modules = array(
'appcat_application_content',
'appcat_organization_content',
);
if (in_array($module_name, $content_definition_modules) && isset($export['features']['taxonomy']) && isset($export['features']['uuid_term'])) {
unset($export['features']['uuid_term']);
}
}

0 comments on commit 6954a76

Please sign in to comment.