Basic Data Navigation
SlashDB is a Resource Oriented Architecture. It means that each URL strongly references to certain document with data. The most important concept is to think of URLs like paths to specific documents in your file system. For example, let's reach out for an XML document of Customer "ALFKI" in our Northwind database:
While "discovering" the data using GUI, cURL, programming libraries or a REST client at any moment you may change extension of current URL to receive the same data in more suitable document format.
There are two ways to navigate the databases setup in SlashDB. Users can navigate via the SlashDB online interface or by typing an URL in an internet browser.
Navigation by SlashDB interface
Selecting a database by selecting the HTML button will open up to a list of tables in the selected database.
For example, clicking on the HTML button for Chinook (Above) will open up the Chinook database. (Below)
As described in Data Discovery, the database sub-folders allow users to view folders and files in the HTML, JSON, CSV, XML and XSD formats.
Clicking on HTML again will reveal the content of the selected table. For example, selecting Invoice in the Chinook database example will reveal a list of files with an invoice ID. (Below)
Navigation by URL
Alternatively users can just type in the address bar of an internet browser the URL of the database, table or file they would like to access.
For example, to access the Chinook database via URL, type the following URL in the internet browser's address bar:
The internet browser will open up the list of tables in the Chinook database.
To open the Invoice table type the following:
The internet browser will open up the list of files with an invoice ID.
The tables view allows users to browse table rows freely, but more importantly, it allows users to transverse relations.
As an example, in the Chinook database, we pick the Playlist table and see records in it.
To find out what is in the PlaylistID 1 (Music) playlist, click on the button in the column PlaylistTrack.
The view is changed and we can see now the table PlaylistTrack with records for PlaylistID 1. It's an association table for many-to-many relation between Playlist and Track. We can follow next relation to the Track table.
Clicking on the header of the table will take us to a page with all tracks related to PlaylistID 1.
On the other hand clicking on the HTML button in row for TrackId 1 will take us to details of that track.
Users can keep going further, by finding out which Album, Genre, etc. the song is ID'd under.
PlaylistTrack, Album and Genre are all tables that are searchable in the top level Chinook database. So instead of viewing which songs are on Playlist 1, users can find out which Playlists have Jazz songs by selecting the Genre table.
Navigating Tables by URL
Alternatively, users can skip all the above and go directly to any table by typing a URL into a internet browser.
The above URL directed the user to the customer with InvoiceId 1. SlashDB follows a consistent format of URL creation. A detailed explanation can be found below:
The URL method is very powerful and allows users to narrow down searches in a variety of ways.
SlashDB allows to easily follow relations between tables by adding to the URL segment a segment with a name of the relation. You can follow as many relations as you need and within each context (table) you may perform additional filtering
https://demo.slashdb.com/db/Chinook/Customer/CustomerId/14/Invoice.html - first find certain Customer (CustomerId = 14) then follow relation "Invoice" to find his inovoices.
https://demo.slashdb.com/db/Chinook/Customer/CustomerId/14/Invoice/InvoiceLine/Track/Album/Artist.html - get list of artists whose music the Customer ever bought
https://demo.slashdb.com/db/Chinook/Customer/CustomerId/14/Invoice/InvoiceDate/2013-03-01../InvoiceLine/Track/Album - get albums bought by Customer 14 after 2013-10-08
Output Document Formats
Each URL represents specific resource. The file extension suffix in the URL specifies the request/response format of the HTTP transaction’s payload. If no extension is provided, HTML data will be returned by default.
The format of a response body can be selected as follows:
- the file extension suffix on the URL, or
Acceptheader to a request when receiving a payload (HTTP method GET).
If both the extension and the header are present in a request, then the extension takes precedence.
Response will include a
Content-Type header corresponding to the format requested.
When sending a payload (using HTTP methods PUT or POST), adding
Content-Type header to the request will control how SlashDB will interpret that content. Response body, if any, will be of the same type as request's
curl "https://demo.slashdb.com/db/Chinook/Genre.csv" curl -H "Accept: text/csv" "https://demo.slashdb.com/db/Chinook/Genre"
curl --request PUT \ --data-binary @genre1.csv \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1.csv" curl --request PUT \ --header "Content-Type: text/csv" \ --data-binary @genre1.csv \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1"
curl "https://demo.slashdb.com/db/Chinook/Genre.json" curl -H "Accept: application/json" "https://demo.slashdb.com/db/Chinook/Genre"
curl --request PUT \ --data-binary @genre1.json \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1.json" curl --request PUT \ --header "Content-Type: application/json" \ --data-binary @genre1.json \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1"
curl "https://demo.slashdb.com/db/Chinook/Genre.xml" curl -H "Accept: text/xml" "https://demo.slashdb.com/db/Chinook/Genre" curl -H "Accept: application/xml" "https://demo.slashdb.com/db/Chinook/Genre"
curl --request PUT \ --data-binary @genre1.xml \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1.xml" curl --request PUT \ --header "Content-Type: text/xml" \ --data-binary @genre1.xml \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1" curl --request PUT \ --header "Content-Type: application/xml" \ --data-binary @genre1.xml \ "https://demo.slashdb.com/db/Chinook/Genre/GenreId/1"
curl "https://demo.slashdb.com/db/Chinook/Genre.xsd" curl -H "Accept: text/xsd" "https://demo.slashdb.com/db/Chinook/Genre"
XML Schema represents metadata for a given resource. Sending data is not applicable.
.html or no extension
curl "https://demo.slashdb.com/db/Chinook/Genre" curl "https://demo.slashdb.com/db/Chinook/Genre.html" curl -H "Accept: text/html" "https://demo.slashdb.com/db/Chinook/Genre"
Sending data in HTML is not applicable.