US Government Web Services and XML Data Sources
Load and stress tested with SiteBlaster
USGovXML Icon
Home     Index     About     Contact     Examples     Help      Mobile Apps 
US Government Data Sources

Authorities and Vocabulary Service

Department: Independent Agency
Agency: Library of Congress (LOC) (http://www.loc.gov/index.html )
Sub Agency: Library of Congress Online Catalog (http://catalog.loc.gov/ )
Description:
The Library of Congress Authorities and Vocabularies service (http://id.loc.gov/ ) enables both humans and machines to programmatically access authority data at the Library of Congress via URIs. This service is influenced by -- and implements -- the Linked Data movement's approach of exposing and inter-connecting data on the Web via dereferenceable URIs.

The Library of Congress Subject Headings (LCSH) is the first vocabulary to be included in the Authorities and Vocabularies service. Additional vocabularies to be included are:

• Thesaurus of Graphic Materials
• MARC Geographic Area Codes
• MARC Language Codes
• MARC Relator Codes

LCSH has been actively maintained since 1898 to catalog materials held at the Library of Congress. By virtue of cooperative cataloging, other libraries around the United States also use LCSH to provide subject access to their collections. In addition LCSH is used internationally, often in translation.
Help/Documentation:
http://id.loc.gov/about/ , http://id.loc.gov/download/
WSDL/Data Location:
The service is invoked by submitting an Http GET request to the following URI: http://id.loc.gov/authorities/{identifier} where {identifier} is the identifier assigned to the subject heading.

Library of Congress Subject Heading identifiers can be downloaded individually or collectively as a compressed file (i.e. .zip file) from http://id.loc.gov/download/

Operations:
OperationDescription
N/A

Support: idfeedback@loc.gov , http://id.loc.gov/contact/
Example: LCSH

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlDocument xmlDocBody = new System.Xml.XmlDocument();

// load an individual subject heading
xmlDoc.Load("http://id.loc.gov/authorities/sh95000541#concept");
MessageBox.Show(xmlDoc.OuterXml.ToString());

/*
Process the downloaded Subject Headings (i.e. the decompressed RDF/XML file)

* Note: the structure of a description node is as follows

    <rdf:Description rdf:about="http://id.loc.gov/authorities/sh85120352#concept" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" xmlns:dcterms="http://purl.org/dc/terms/">1986-02-11T00:00:00-04:00</dcterms:created>
    <skos:inScheme rdf:resource="http://id.loc.gov/authorities#conceptScheme" xmlns:skos="http://www.w3.org/2004/02/skos/core#" />
    <skos:inScheme rdf:resource="http://id.loc.gov/authorities#topicalTerms" xmlns:skos="http://www.w3.org/2004/02/skos/core#" />
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept" />
    <skos:related rdf:resource="http://id.loc.gov/authorities/sh85076763#concept" xmlns:skos="http://www.w3.org/2004/02/skos/core#" />
    <skos:prefLabel xml:lang="en" xmlns:skos="http://www.w3.org/2004/02/skos/core#">Service industries--Taxation</skos:prefLabel>
    <owl:sameAs rdf:resource="info:lc/authorities/sh85120352" xmlns:owl="http://www.w3.org/2002/07/owl#" />
    <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" xmlns:dcterms="http://purl.org/dc/terms/">1986-02-11T00:00:00-04:00</dcterms:modified>
    </rdf:Description>

*/

// load the subject headings into an XML Document
xmlDocBody.Load(@"C:\20090604_164455.rdf");

//create a name space manager so that the XML document can be processed by XPath
XmlNamespaceManager nsMgr = new XmlNamespaceManager(new NameTable());
nsMgr.AddNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
nsMgr.AddNamespace("skos", "http://www.w3.org/2004/02/skos/core#");
nsMgr.AddNamespace("dcterms", "http://purl.org/dc/terms/");
nsMgr.AddNamespace("owl", "http://www.w3.org/2002/07/owl#");
nsMgr.AddNamespace("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
nsMgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema#");

// get the first rdf:Description node
System.Xml.XmlNode nodeDescription = xmlDocBody.SelectSingleNode("//rdf:Description", nsMgr);
int i = 0;

// iterate thru all of the remaining rdf:Description nodes
while (nodeDescription != null)
{
    i++;
    string aboutURL = nodeDescription.Attributes.GetNamedItem("rdf:about").Value;
    string label = nodeDescription.SelectSingleNode("skos:prefLabel", nsMgr).InnerText;
    nodeDescription = nodeDescription.NextSibling;
}

MessageBox.Show("There were " + i.ToString() + " rdf:Description nodes");
Application.Exit();






 
Terms of Use     Contact     Mobile    

Copyright © 2008-2016 USGovXML.com All rights reserved.