Library of Congress

Authorities & Vocabularies

The Library of Congress > Linked Data Service > Technical Center: Searching/Querying

Searching

  • Search results are sorted by relevancy to your search
  • Asterisk (*) wildcards may be used to represent any number of characters.
  • Question mark (?) wildcards may be used to represent a single character.
  • Boolean AND, NOT, OR commands may be used.
  • Multiple terms are treated as an AND query

The asterisk symbol may be used at the beginning, end, or middle of a term.

For example, a search for "*dog*" will return:

  • Dogfish
  • Bulldog
  • Lepdogaster
  • etc.

Search limits / Special search constraints

Search limits or special search constraints are applied by invoking a constraint, followed by a colon, and then the value to query. These can be combined with the boolean options above to perform complex searches of the system. The following constraints, with examples, are available:

Known-label retrieval

If you have a known label or heading but are unsure of its URI, it is possible to arrive at the true URI by using the label functionality provided in the LC Linked Data Service. For instance, if your label or heading is "Orchids", use this URI to obtain a HTTP 302 FOUND message with a redirection to the established URI:

The URI syntax for the label functionality is to use the token "label/", followed by a case-insensitive string for the search term.

  • http://id.loc.gov/authorities/{scheme_name}/label/{term}
  • or
  • http://id.loc.gov/vocabulary/{vocabulary_name}/label/{term}

{scheme_name} in the first example is optional. Not including a scheme name will search everything under /authorities. Do not place a trailing slash on the known label or heading. Also, stemming, truncation, etc., is not functional, so wildcard characters such as the asterisk (*) or the percent sign (%) should not appear within the string unless they are part of the stored heading or label. The entire string must match a label or heading stored within the system.

If the label functionality does not properly match the string provided, a HTTP 404 Not Found message will be returned. If your label possesses a character outside the American Standard Code for Information Interchange (ASCII) Offsite link range of 128 characters, it is strongly advised to URL-encode Offsite link your string prior to sending the request. Browsers such as Safari and Firefox do this automatically, whereas Internet Explorer will not always do so. For example, the URL encoded representation for:

  • Bărăganul (Romania)

is:

  • B%C4%83r%C4%83ganul%20%28Romania%29

If multiple concepts with the same label are found within the database, the system will only returned the first concept it finds with that label. Hits are ordered alphabetically by the last token of the URI. For Library of Congress Subject Headings, this token is the Library of Congress Control Number, such as "sh85095334".

OpenSearch support

The Authorities and Vocabularies service supports OpenSearch Offsite link for querying, responses, and autodiscovery the Library of Congress Subjects Headings. OpenSearch is typically supported within most recent browsers such as Firefox 2 and 3, Internet Explorer 7 and 8, etc. When the browser discovers the OpenSearch functionality for this service, the site can be queried directly from the browser's included search bar without having to actually visit our web site.

Querying

No tool for querying the backend RDF is provided in this release. If you need to perform custom queries for more detailed analysis of our data, please download the bulk metadata: RDF/XML or N-Triples. Once downloaded, it's possible to use the data in any number of SPARQL-aware Offsite link engines, such as Sesame Offsite link or Joseki Offsite link.

If you are querying against the RDF/XML serialization of the data, XSPARQL Offsite link is a technology that combines aspects of the XQuery Offsite link language and SPARQL into the same syntax. Similarly, XSLT+SPARQL Offsite link from Diego Berrueta allows SPARQL interaction via XSLT Offsite link.