FrontPage

The API Basics

Here are the basic instructions for drawing material out of the Textual Communities API

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 -- two of them, with id 1497295


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


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


http://textualcommunities.usask.ca/api/docs/1497299/xml/ gives us the xml
for this page

http://textualcommunities.usask.ca/api/docs/1497299/has_entities/ gives us the entities on this page (actually, three diary entries)

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)

Switching our examples to the Canterbury Tales:

http://www.textualcommunities.usask.ca/api/communities/4/ tells us about the Tales community

http://www.textualcommunities.usask.ca/api/communities/4/docs/ lists the documents in the Tales community. Ad1 has document id 2420795. http://www.textualcommunities.usask.ca/api/docs/2420795/ tells us about the document.

http://www.textualcommunities.usask.ca/api/docs/2420795/has_parts/ lists the pages in 2420795. Folio 1r has id 2420796. http://www.textualcommunities.usask.ca/api/docs/2420796/ tells us about this page, including the information that it has a revision: 'cur_rev', with the id 20720.

http://www.textualcommunities.usask.ca/api/docs/2420796/has_revisions/ gives us a list of all the revisions of this page. The 'user' token tells us who did the transcription. Note that the revision saved at "2014-10-14T11:49:17Z" has the id 20720 and hence is the current, most recent, version. We can see that the user responsible for this was user 262. http://www.textualcommunities.usask.ca/api/users/262/ tells us more about this user.

From http://www.textualcommunities.usask.ca/api/memberships/ we can discover that user 262 is a member of community 4 (the Canterbury Tales), with role 3 (member) and membership id 912. We can find out what pages in document 2420795 (Ad1) have been transcribed to membership 912 (ie, that user in that role in that community) from http://textualcommunities.usask.ca/api/memberships/912/assign/2420795/.

http://www.textualcommunities.usask.ca/api/tasks/17073/: tells us that task 17073  is for document 52192, and membership 751, and has status "0": that is, assigned. http://www.textualcommunities.usask.ca/api/docs/52192/ tells us this is the front cover; http://www.textualcommunities.usask.ca/api/docs/52192/parent/ tells us this document 4338. http://www.textualcommunities.usask.ca/api/memberships/751/ tells us that user 94 has been assigned this task, and also gives the date this task was assigned. 

So: we can go to the tasks table, retrieve all tasks until we identify the tasks for this document id: thus, http://www.textualcommunities.usask.ca/api/tasks/?doc=52192 tells us tasks 10794 and and 17073 were associated with this page, with memberships 712 and 751. The "status" field on each task tells us whether it is assigned, in progress, etc.



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