Spans

Any span of any document on PubAnnotation may be accessed through its own URI, e.g.,

https://pubannotation.org/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86

We call it a span URI.

Note that, in a span URI, the document is specified, e.g. ‘/docs/sourcedb/PubMed/sourceid/25314077’, and the span is specified, e.g. ‘/spans/0-86’.

The span specification of PubAnnotation is based on caret (text cursor) positions.

caret positions

In the above example, the string ‘protein’ exists between the caret positions 4 and 11, thus its span specifications will be ‘/span/4-11’.

PubAnnotation provides a GUI to get the URI of any span:

  1. Open a document page
    caret positions

  2. Select a span, then the URI of the span will appear below the document.
    caret positions

  3. Click the URL to open the document page with the selected span highlighted.

Once a span URI is obtained, annotations to the span can be accessed by adding ‘/annotations’ to the URL:

https://pubannotation.org/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations

The annotations also can be accessed in JSON:

https://pubannotation.org/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations.json

or in a visualization (TextAE):

https://pubannotation.org/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations/visualize

Note that, to the same document, annotations may be produced by more than one projects, and all of them will be shown by accessing the above URLs.

The annotations from a specific project can be accessed by specifying the project in the URL as in:

https://pubannotation.org/projects/example/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations

for HTML rendering, or

https://pubannotation.org/projects/example/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations.json

for JSON representation.

The latter can be supplied to a project specification as a sample annotation.

caret positions

Also, it can be given to TextAE for visualization, e.g. https://textae.pubannotation.org/editor.html?target=https://pubannotation.org/projects/example/docs/sourcedb/PubMed/sourceid/25314077/spans/0-86/annotations.json