How to extract information services (getty) info in pawtucket2?

I am having so trouble getting data out of Getty information services.
I can get data out of a wikipedia, and LCSH but it doesn't seem to work with the other information services.
I am trying to extract the name and the URL etc  (the same information that "more" displays in Providence)

if ($vs_subjects_lcsh = $t_object->get('ca_objects.lcsh_terms', array('returnWithStructure' => 'true'))) {
                                    print "<h6>Library of Congress Subject Terms:</h6>";
                                    foreach ($vs_subjects_lcsh as $va_key => $vs_subject_lcsh_r) {
                                            foreach ($vs_subject_lcsh_r as $va_key => $vs_subject_lcsh_s) {
                                                    foreach ($vs_subject_lcsh_s as $vs_subject_lcsh) {
                                                            $va_subject = explode(' [', $vs_subject_lcsh);
                                                            $va_subject[1] =rtrim($va_subject[1], "]");// strip ']' off the end
                                                            $va_subject[1] = "".ltrim($va_subject[1],"info:/lc").".html"; //
                                                            print caNavLink($this->request, $va_subject[0], '', '', 'Search', 'objects/search/'.$vs_subject_lcsh).
                                                            " ( link: <a href='". $va_subject[1]."' target='_blank'>".$va_subject[1]."</a> )<br/>";


  • There's no easy way to get to the extended info data in master-fix. In develop there's code to define custom subfields for the Getty thesauri, so that you could make the URL accessible via ca_objects.aat.url or the parent path via ca_objects.aat.partentPath or something.

    If you're working in master-fix or v1.5.1/2, you'd have to do that yourself. If it was me I'd probably try to build a WLPlugInformationServiceAAT instance for the value in question, so that I have all the convenience methods of BaseGettyLODServicePlugin available. You can look into BaseGettyLODServicePlugin::getExtendedInformation() to see how we build the panel.
  • This seems to be working OK so far: Thank Bruce

          $o_service = new WLPlugInformationServiceAAT();
         $results = $o_service->lookup(array(),$vs_subject_is_att_s['is_ATT']);
        if(strlen($results['results'][0]['idno'])>0){$out .= $results['results'][0]['idno']."<br/>";}
        if(strlen($results['results'][0]['label'])>0){$out .= $results['results'][0]['label']."<br/>";}
        $out .=" <a href='".$results['results'][0]['url']."' target='_blank'>".$results['results'][0]['url']."</a></br/>";
  • An update.
    The info I am getting back different.  How to I get back the Full Path info?

    Also, I noticed in Paw. that the function getExtendedInformation() always fails because

      public function getExtendedInformation($pa_settings, $ps_url) {
            $va_service_conf = $this->opo_linked_data_conf->get($this->getConfigName()); <--- this returns empty.  At least for the config named "aat"

  • another update:  I needed to copy over linked_data.conf and set :  linked_data_config = <ca_conf_dir>/linked_data.conf in app.conf.

    NOW it seems to be working OK.
  • Oh yeah, sorry. You're definitely the first to try this with Pawtucket2 :-)
  • Hi,
    For those who would like to display LCSH references with a cliquable link to LCSH site, I use this, for example in ca_entities_default_html.php:

    {{{<ifcount code="ca_entities.lcsh_terms" min="1" max="1"><H6>LCSH reference:</H6></ifcount>}}}
    {{{<ifcount code="ca_entities.lcsh_terms" min="2"><H6>LCSH references:</H6></ifcount>}}}
    {{{<unit relativeTo="ca_entities.lcsh_terms" delimiter="<br/>"><a href="^" target="_blank">^ca_entities.lcsh_terms.text</a></unit>}}}

    The modifyer %start=8 allows to remove the 8 characters "info:/lc" from the ;)

Sign In or Register to comment.