Skip to content

Instantly share code, notes, and snippets.

@tingletech
Last active August 29, 2015 14:05
Show Gist options
  • Save tingletech/4a3fc5f59e5af3054286 to your computer and use it in GitHub Desktop.
Save tingletech/4a3fc5f59e5af3054286 to your computer and use it in GitHub Desktop.
unofficial/unsupported SNAC 2 prototype API

SNAC Prototype APIs

SNAC has two de facto APIs that serve data to the public interface.

And we have CORS headers set, so no need to JSONP it.

  1. do a search in the public interface and note the URL

/snac/search?text=fred&sectionType=cpfdescription SAMPLE QUERY for fred

  1. add &rmode=slickgrid to the URL for JSON SAMPLE JSON for fred

  2. add &rmode=slickgrid&raw=1 to the URL for XML SAMPLE XML for fred

  3. add &startDoc=25 to go to the next page of results SAMPLE startDoc for fred

All read only parts of the Rexster REST API should work.

/rex2/snac/vertices?key=__&value=__

indexes can be accessed by key, up-to-date list of key indices: /rex2/snac/keyindices

  • recordId n2t.net ARK for the identity /rex2/snac/vertices?key=recordId&value=http://n2t.net/ark:/... SAMPLE recordId SEARCH

  • identity exact string match SAMPLE identity SEARCH

  • sourceEADurlIndex misnamed and unpopulated, need to populate for "related URIs/URLs," search to use in collection widget API for SNAC 2. [UN-POPULATED right now]

/rex2/snac/vertex/_id/snac/theJit

snac/theJit in the URL means a custom kibble is applied to the base vertex/_id. The output for this was designed to work with the javascript infovis toolkit's Radial Graph.

  1. you will need to look up the internal record _id using the recordId index SAMPLE recordId SEARCH
{
 results: 
  {
    _id: 2327314,
    ...

Note: This step can be removed if we migrate to a new graph wrapper in germlin. Right now, these internal _ids will change between rebuilds of the graph.

  1. call rexster extension on that node

/rex2/snac/vertices/_id/snac/theJit SAMPLE KIBBLE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment