A flask web application that crawls Activity Streams for IIIF Canvases and offers a search API.
Canvas Indexer is being developed as part of the CODH's IIIF Curation Platform, but meant to be a general IIIF tool. Integration into the IIIF Curation Platform means that in this very early stage there is a focus on cr:Curation type documents. Nevertheless all development is done with generality in mind.
 The crawler currently only looks for canvases within them (and not, for example, sc:Manifests) and the search API offers dedicated parameters.
 The crawling process implements the IIIF Change Discovery API 0.1 and extending the indexing mechanism and search API to support IIIF documents within Activity Streams in general (or at least sc:Manifests for a first step) should be straightforward.
- create virtual environment:
$ python3 -m venv venv
- activate virtual environment:
$ source venv/bin/activate
- install requirements:
$ pip install -r requirements.txt
|shared||db_uri||sqlite:////tmp/ci_tmp.db||a SQLAlchemy database URI (file system paths have to be absolute)|
|crawler||as_sources||||comma seperated list of links to Activity Streams in form of OrderedCollections|
|||interval||3600||crawl interval in seconds (value <=0 deactivates automatic crawling)|
|||log_file||/tmp/ci_crawl_log.txt||file system path to where the crawling details should be logged|
|||allow_orphan_canvases||false||set whether or not Canvases, that are not associated with any parent elements in the index anymore, should still appear in search results|
|api||server_url||http://localhost:5005||URL under which Canvas Indexer can be accessed (only needed when using bots (details below))|
|||bot_urls||||comma seperated list of URLs to bots (only needed when using bots (details below))|
|||facet_label_sort_top||||comma seperated list defining the beginning of the list returned for the
|||facet_label_sort_bottom||||comma seperated list defining the end of the list returned for the
|||facet_value_sort_frequency||||comma seperated list of facets to be sorted by frequency|
|||facet_value_sort_alphanum||||comma seperated list of facets to be sorted alphanumerically|
|label||||facet label for which a custom order is defined|
|||sort_top||||comma seperated list defining the beginning|
|||sort_bottom||||comma seperated list defining the end|
$ source venv/bin/activate $ python3 run.py [debug]
||set the type of search results to be returned to either
||set the type of metadata the search results should be based on to
|where_metadata_label||used to search by a property+value pair. requires where_metadata_value|
|where_metadata_value||used to search by a property+value pair. requires where_metadata_label|
||set the type of metadata creator to
||0 based index from which to start listing results from the list of all results|
||limit the number of results being returned|
returns a pre generated overview of the indexed metadata facets
- The crawler can be configured to run periodically (see Config) or triggered manually by accessing
- On its first run the crawler will go through an Activity Stream in its entirety, subsequent runs will only regard Activities that occured after the previous run.
- In its current state the crawler indexes only the label value pairs given in a IIIF resource's metadata property.
Canvas Indexer can be set up to send image URLs of the canvases it indexes to bots that return tags. These tags are then integrated in the index. Example code of a bot can be found in the folder bot_example.
The Canvas Indexer logo uses image content from 絵本花葛蘿 in the 日本古典籍データセット（国文研所蔵） provided by the Center for Open Data in the Humanities, used under CC-BY-SA 4.0. The Canvas Indexer logo is licensed under CC-BY-SA 4.0 by Tarek Saier. A high resolution version (4456×2326 px) can be downloaded here.
Sponsored by the National Institute of Informatics.
Supported by the Center for Open Data in the Humanities, Joint Support-Center for Data Science Research, Research Organization of Information and Systems.