OpO FAST Web Server and Database
OpO

The HTTP REST tree read API allows for getting a list of available trees listed by name and blank node identifiers. It also allows retrieval of an individual tree by name or blank node identifier.

All reads use the HTTP GET method. Query options are allowed for both list retrieval and for individual tree retrieval.

Four formats are supported for retrieval, JSON, TURTLE, N-Quads, and OG. OG is the Opo Graph format. Options for inclusion of comments and comment contents are available. Since some browsers don't support some of the format directly an option for text Content-Type is also available.

Tree List Retrieval

A GET with a URL that does not include a tree identifier will return a list of all trees filtered or paginated if specified as such. Without other options the returned list is a text list of all the tree identifiers which are either the tree names or the top blank node identifier for un-named trees.

Instead of a list of tree identifiers the full tree can be returned. By setting the 'full' option to true the 'format', 'text', and 'with_id' options become active. If just listing the tree identifiers they do not effect the returned list.

The list can be filtered by the graph or by pagination. Pagination uses both the 'page' and the page 'size' to determine which trees are returned in the list.

Examples of a GET URL for a list are:

http://www.example.com/tree?full=true&format=json&graph=graph1 http://www.example.com/tree?page=2&size=50 http://www.example.com/tree

Query parameter options are:

OptionValuesDescription
formatjson | turtle | og | n-quadsreply format if full
indent<integer>indentation
graph<string>acts as a filter
texttrue | falseContent-Type text/plain
fulltrue | falselist full tree
with_idtrue | falsenode identfier in comment
page<integer>page to retrieve
size<integer>page size
Individual Tree Retrieval

A GET with a URL that includes a tree identifier is used to return the contents of the specified tree in the specified format. Options include specifying the desired format and if the format supports comments then the 'with_id' option is also supported.

Examples of a GET URL for a specific tree are:

http://www.example.com/tree/my-tree?format=json&with_id=true http://www.example.com/tree/my-tree

Query parameter options are:

OptionValuesDescription
formatjson | turtle | og | n-quadsreply format
indent<integer>indentation
texttrue | falsereply Content-Type text/plain
with_idtrue | falsenode identfier in comment