FrontPage

The Textual Communities API

One of the core aims of Textual Communities is to make it possible for people with limited programming skills to make their own web pages offering an interface to their own materials in the TC system.  We do this through an "API": an Application Programmer's Interface. In essence, this is a series of calls to the TC database to bring back data: the XML for the transcription of any page, or any entity, in your community.

Here are the basic calls you need:

http://textualcommunities.usask.ca/api/communities/ brings us back a list of communities in the USask system

from this we learn that this Matthews diary is community 91, and http://textualcommunities.usask.ca/api/communities/91/ gives information about it

http://textualcommunities.usask.ca/api/communities/91/docs/ tells us all the documents in this community -- there are two, the first one, with id 1497295, is the War Diary.

http://textualcommunities.usask.ca/api/docs/1497295/ tells us more about the War Diary document

http://textualcommunities.usask.ca/api/docs/1497295/has_parts/ lists all the pages in the Ware Diary document; for example id 1497299 is folio 4

http://textualcommunities.usask.ca/api/docs/1497299/xml/ gives us the xml for this page, folio 4 of the War Diary

http://textualcommunities.usask.ca/api/communities/91/entities/  tells us all the entities in this community (ie, all the diary entries), eg 620366  is May 25th 1846

http://textualcommunities.usask.ca/api/entities/620366/has_parts/ tells us the paragraphs in this entity (three of them)

http://textualcommunities.usask.ca/api/entities/620366/has_text_of/ tells us what texts there are of this diary entry (only one, with the id 3006519)

http://textualcommunities.usask.ca/api/texts/3006519/xml/ gives us the xml for the whole of this diary entry in the document 1846, all through paras (could be a pb in this page, actually there isn't) 

Perhaps the most powerful and distinctive feature of TC is its ability to mix calls concerning documents and entities: asking, for example, exactly what entities are in what document, and in each page of that document, or in what documents and in what pages of those documents particularly entities are to be found.  Thus:

http://textualcommunities.usask.ca/api/docs/1497295/has_entities/ tells us what entities are in the War Diary

http://textualcommunities.usask.ca/api/docs/1497299/has_entities/ tells us what entities are on folio 4 of the War Diary (the entries for May 24, 25 and 26). 

There is a sample file using some of these calls at http://www.sd-editions.com/TC/StarterAPI.html.  The code for this file is at http://www.textualcommunities.usask.ca/web/textual-community/wiki/-/wiki/Main/Sample+API+file.

0 Attachments
5885 Views
Average (0 Votes)
Comments
No comments yet. Be the first.