You are here

function convert_statements_to_rdf_data in Taxonomy import/export via XML 7

Given $statements=array('rdfs:type' => 'thing', 'dc:title' => 'A THING'); return that in an objectified $data array that RDF can serialize better

2 calls to convert_statements_to_rdf_data()
taxonomy_xml_rdf_export_vocabulary in ./taxonomy_xml_rdf.inc
Return an RDF representation of the requested vocab.
taxonomy_xml_term_as_rdf_data in ./taxonomy_xml_rdf.inc
When asked for a RDF representation of a taxonomy term, return a merge of both the extrinsic RDF statements that have been made about that term (using the RDF repository-triplestore and cannonic taxonomy/term/n notation) and also the Drupal internal…

File

./taxonomy_xml_rdf.inc, line 164

Code

function convert_statements_to_rdf_data($subject_uri, $statements) {

  // Convert CURIE statements to full statement resource refs
  foreach ($statements as $predicate => $objects) {
    $predicate = rdf_is_valid_curie($predicate) ? rdf_qname_to_uriref($predicate) : rdf_uri($predicate);
    $objects = rdf_objects($objects);
    foreach ($objects as $key => $object) {
      $objects[$key] = rdf_is_valid_uri($object) ? rdf_uri($object) : $object;
    }

    // Add this data to the entity
    $data[$subject_uri][$predicate->uri] = $objects;
  }
  return $data;
}