function taxonomy_xml_parse_lsid in Taxonomy import/export via XML 7
Same name and namespace in other branches
- 6.2 taxonomy_xml.module \taxonomy_xml_parse_lsid()
- 6 taxonomy_xml.module \taxonomy_xml_parse_lsid()
Helper function to check if a given string looks like an LSID. If so, it returns it in an array of componant bits. If not, returns NULL.
LSID is a "Life Sciences Identifier" GUID used to identify Taxonomic concepts. It's not great, and it's probably not going to carry on living, but it's out there in metadata and web services.
For convenience, it also returns a namespaced 'type' so we can quickly see what 'type' of resource the LSID is referring to. eg an LSID starting with 'urn:lsid:ubio.org:classificationbank' is the type of entity that Drupal will call a term, and TCS would call a TaxonConcept.
1 call to taxonomy_xml_parse_lsid()
- taxonomy_xml_shortname in ./
taxonomy_xml.module - Return the shorthand label of a potentially long RDF URI
1 string reference to 'taxonomy_xml_parse_lsid'
- taxonomy_xml_shortname in ./
taxonomy_xml.module - Return the shorthand label of a potentially long RDF URI
File
- services/
lsid.taxonomy_service.inc, line 83 - declare how to load and import a SONZ (Services of New Zealand) Taxonomy
Code
function taxonomy_xml_parse_lsid($id) {
$bits = explode(":", $id);
if (count($bits) < 5) {
return NULL;
}
$lsid = array(
'urn' => $bits[0],
'schema' => $bits[1],
'authority' => $bits[2],
'namespace' => $bits[3],
'identifier' => $bits[4],
'version' => @$bits[5],
# optional
'type' => implode(':', array(
$bits[0],
$bits[1],
$bits[2],
$bits[3],
)),
);
if (count($bits) > 4 && $lsid['urn'] == 'urn' && $lsid['schema'] == 'lsid') {
return $lsid;
}
return NULL;
}