MarcEdit Update

 MarcEdit  Comments Off
Feb 222011
 

I’ve made a few tweaks to the classification service.  The big update was a bug fix that was fields proceeding the inserted classification to be deleted.  Obviously, that’s a problem.  This has been corrected.  Additionally, I’ve added an option to remove using the subfield z (in the 035, 776, 020 and 022) as part of the matching process.

The classification service screen now looks like the following:

image

–TR

 Posted by at 12:02 am
Feb 152011
 

Posted a MarcEdit update that includes the Batch Classification service.  This service utilizes OCLC’s Classify API to generate call numbers for records.  I originally noted the work on this tool while I was at code4lib here.  The original tool was pretty simple – it was created to examine a record, extract a control number, and simply query the API to see if a call number stem would be returned.  After getting some feedback and questions, I’ve made some changes, updated the code and have created a tool that looks like the following:

image

Features:

  1. Ability to add a call number to either a selected record or all records a file.
  2. Ability to select from either dewey or library of congress classifications.
  3. Ability to calculate dates and cutters.  MarcEdit will utilize the date found in the 008 and generate a cutter up to 4 characters in length for a particular call number
  4. Ability to conditionally insert items based on the presence of other call number fields.
  5. Ability to set the field that the generated call number data should be placed.
  6. Very granular control data extraction and normalization.  Data is extracted from the following fields:
    • OCLC Number: 001, 035, 776$w$z
    • LCCN:  010, 776$w$z
    • ISBN: 020$a$z
    • ISSN: 022$a$z
    • UPC: 024$a
  7. Support for multiple fields.  I.E., if an OCLC number exists in the 001, 035 and 776$w$z – the program will store and query each of these values and perform a search on each.  The same is true for lccn, isbn and issn.
  8. Supports normalization of field data.  Normalization is most important for the 020, 022 and 776 – the program normalizes the data to ensure the best chance of receiving a match through the API service.
  9. Supports the ability to follow works when multiple records are retrieved.  I.E., if an ISBN search is done that returns 4 items and 2 works, the program will determine the work with the highest number of holdings, retrieve an internal ID and resolve that data.

I imagine at some point, there will be additional functionality added to this tool, but I think that this will be a good place to start.

–TR

 Posted by at 1:30 am
Feb 092011
 

During Code4Lib, I spent a little time playing with OCLC’s Classify service (http://oclc.org/developer/services/classify).  I’ve been working on adding a couple of functions into MarcEdit that will allow folks to leverage some of the OCLC web services.   Using OCLC’s Classify, I’ve been working on an experimental tool that would allow you to do batch classification of records based on OCLC’s classification.  Below, you will find the class and below that, you can find how this might look in MarcEdit.

OCLC Classify Class

 class oclc_api_classify
    {
        public enum Class_Type {lcc = 0, dd=1}
        private string pLastError = "";

        public string LastError
        {
            get { return pLastError; }
            set { pLastError = value; }
        }
        private string MakeHTTPRequest(string url)
        {
            System.Net.HttpWebRequest wr;
            System.IO.Stream objStream = null;
            try
            {
                wr = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url);
                wr.UserAgent = "MarcEdit 5.2";

                System.Net.WebResponse response = wr.GetResponse();
                objStream = response.GetResponseStream();
                System.IO.StreamReader reader = new System.IO.StreamReader(objStream);
                string sresults = reader.ReadToEnd();
                reader.Close();
                return sresults;
            }
            catch (Exception e)
            {
                return e.ToString();
            }
        }

        public string DoSearch(string url, oclc_api_classify.Class_Type ctype)
        {
            string sreturn = MakeHTTPRequest(url);
            //process results
            return ProcessClassify(sreturn, ctype);
        }

        private string ProcessClassify(string s, oclc_api_classify.Class_Type ctype)
        {
            System.Xml.XmlDocument objXML = new System.Xml.XmlDocument();
            objXML.LoadXml(s);
            System.Xml.XmlNamespaceManager oMan = new System.Xml.XmlNamespaceManager(objXML.NameTable);
            oMan.AddNamespace("oclc", "http://classify.oclc.org");
           

            System.Xml.XmlNodeList objList;

            try
            {
                if (ctype == Class_Type.dd)
                {
                    objList = objXML.SelectNodes("//oclc:ddc/oclc:mostPopular", oMan);
                    if (objList != null)
                    {
                        foreach (System.Xml.XmlNode objN in objList)
                        {
                           
                            if (objN.Attributes["nsfa"] != null)
                            {
                                return objN.Attributes["nsfa"].InnerText;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    
                    objList = objXML.SelectNodes("//oclc:lcc/oclc:mostPopular",oMan);
                    if (objList != null)
                    {
                        foreach (System.Xml.XmlNode objN in objList)
                        {
                            if (objN.Attributes["nsfa"] != null)
                            {
                                return objN.Attributes["nsfa"].InnerText;
                                break;
                            }
                        }
                    }
                    else
                    {
                        //System.Windows.Forms.MessageBox.Show("miss");
                    }
                }
                return "";
            }
            catch (Exception e)
            {
                LastError = e.ToString();
                return "";
            } 
        }

        
    }

In MarcEdit:

In MarcEdit, I’ve added an experimental dialog that does the batch classification search.  Here’s an example:

image

As you can see, I’m envisioning two options:

  1. Ability to process Individual Records
  2. Ability to process All Records in a file
  3. Ability to select suggested Dewey or Library of Congress work
  4. Ability to decide to insert data if fields only if call numbers are not present
  5. Ability to determine what field the call number should be inserted into.

I’m thinking this will show up in the next MarcEdit update, so long as OCLC’s terms and conditions ends up being something that I (and they) can live with.

–TR

 Posted by at 1:03 pm

MarcEdit Update

 MarcEdit  Comments Off
Feb 082011
 

Update was posted Feb. 7th.  Here’s what’s being worked on:

  1. MarcEditor changes, specifically:
    1. When saving .mrk files, the change in the Edit control from the textbox to a custom control shifted the newline character from the system default (on windows \r\n) to simply using a carriage return (\r).  This will be corrected so that it returns back to the system default constant.
    2. Swap Field update – indicator wildcard correction when changing indicators from a wildcard to specified indicator.
  2. Extract Selected Records
    1. An option to delete selected records after extract has been added.
  3. URL Checker
    1. Updated to make it more fault tolerant when working with resources that require cookie sessioning.
    2. Ability to cancel a verification process
  4. Merge Records Changes:
    1. Bug corrections
    2. Adding a new option so that you can save the merged data to a new file
  5. Help file updates
  6. Plug-in code updates
    1. Better fall over when the plug-in changes and needs to be updated.
  7. CDS-ISIS Translation – Updated the advanced translation options to fix the indicator fix.

You can find the download links at: http://people.oregonstate.edu/~reeset/marcedit/html/downloads.html or if you have auto updates turned on, you will be prompted for update.

 

–TR

 Posted by at 12:45 am