diff options
Diffstat (limited to 'modules/rdf/rdf.api.php')
-rw-r--r-- | modules/rdf/rdf.api.php | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/modules/rdf/rdf.api.php b/modules/rdf/rdf.api.php index 0635b7faf..a4fc070a2 100644 --- a/modules/rdf/rdf.api.php +++ b/modules/rdf/rdf.api.php @@ -12,30 +12,35 @@ */ /** - * Allow modules to define RDF mappings for bundles. + * Allow modules to define RDF mappings for field bundles. * - * Modules defining their own bundles can specify which RDF semantics should be - * used to annotate these bundles. These mappings are then used for automatic - * RDFa output in the HTML code. + * Modules defining their own field bundles can specify which RDF semantics + * should be used to annotate these bundles. These mappings are then used for + * automatic RDFa output in the HTML code. * * @return - * An array of mapping structures. Each mapping has three mandatory keys: - * - type: The name of an entity type. - * - bundle: The name of a bundle. - * - mapping: The mapping structure which applies to the entity type, bundle - * pair. A mapping structure is an array with keys corresponding to - * existing field instances in the bundle. Each field is then described in - * terms of RDF mapping. 'predicates' is an array of RDF predicates which - * describe the relation between the bundle (subject in RDF) and the value of - * the field (object in RDF), this value being either some text, another - * bundle or a URL in general. 'datatype' and 'callback' are used in RDFa to - * format data so that it's readable by machine: a typical example is a date - * which can be written in many different formats but should be translated - * into a uniform format for machine comsumption. 'type' is a string used to - * determine the type of RDFa markup which will be used in the final HTML - * output, depending on whether the RDF object is a literal text or another - * RDF resource. The 'rdftype' key is a special case which is used to define - * the type of the instance, its value shoud be an array of RDF classes. + * A list of mapping structures, where each mapping is an associative array: + * - type: The name of an entity type, e.g. 'node' or 'comment'. + * - bundle: The name of the bundle, e.g. 'blog', or RDF_DEFAULT_BUNDLE for + * default mappings. + * - mapping: The mapping structure which applies to the entity type and + * bundle. A mapping structure is an array with keys corresponding to + * existing field instances in the bundle. Each field is then described in + * terms of RDF mapping: + * - predicates: An array of RDF predicates which describe the relation + * between the bundle (RDF subject) and the value of the field (RDF + * object). This value is either some text, another bundle or a URL in + * general. + * - datatype: Is used along with 'callback' to format data so that it is + * readable by machine. A typical example is a date which can be written + * in many different formats but should be translated into a uniform + * format for machine comsumption. + * - callback: A function name to invoke for 'datatype'. + * - type: A string used to determine the type of RDFa markup which will be + * used in the final HTML output, depending on whether the RDF object is a + * literal text or another RDF resource. + * - rdftype: A special property used to define the type of the instance. + * Its value shoud be an array of RDF classes. */ function hook_rdf_mapping() { return array( @@ -44,7 +49,7 @@ function hook_rdf_mapping() { 'bundle' => 'blog', 'mapping' => array( 'rdftype' => array('sioct:Weblog'), - 'title' => array( + 'title' => array( 'predicates' => array('dc:title'), ), 'created' => array( @@ -52,17 +57,17 @@ function hook_rdf_mapping() { 'datatype' => 'xsd:dateTime', 'callback' => 'date_iso8601', ), - 'body' => array( + 'body' => array( 'predicates' => array('content:encoded'), ), - 'uid' => array( + 'uid' => array( 'predicates' => array('sioc:has_creator'), - 'type' => 'rel', + 'type' => 'rel', ), - 'name' => array( + 'name' => array( 'predicates' => array('foaf:name'), ), - ) + ), ), ); } |