Content

Overview

The BCLaws API can be described in terms of how to make a request, and what to expect as the result.

The Content API describes the documents and directories available within the BCLaws library.

The BCLaws content is divided into groups called 'aspects'. The following aspects are currently available:

You can browse the xml content by appending the aspect you want to www.bclaws.ca/civix/content/

For example, by navigating to www.bclaws.ca/civix/content/complete/ you can get a listing of Meta data available at the highest level of the aspect.

Example XML Result


     <root>
        <index>
            <CIVIX_DOCUMENT_TITLE>Statutes and Regulations</CIVIX_DOCUMENT_TITLE>
            <CIVIX_DOCUMENT_ID>statreg</CIVIX_DOCUMENT_ID>
            <CIVIX_INDEX_ID>statreg</CIVIX_INDEX_ID>
            <CIVIX_DOCUMENT_TYPE>index</CIVIX_DOCUMENT_TYPE>
            <CIVIX_INDEX_FIELDS>XPATH:chapter://*:chapter</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:desc://*:desc</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:oic://*:oic</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:term://*:term</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:regnum:/*[1]/*:regnum</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:type:/*[1]/name()</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:marginalnote://*:marginalnote</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:yearenacted:/*[1]/*:yearenacted</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:insert://*:insert</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:hnote://*:hnote</CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>
            XPATH:amendment://text()[preceding::processing-instruction()[1][name() = 'amendment-start']]
            </CIVIX_INDEX_FIELDS>
            <CIVIX_INDEX_FIELDS>XPATH:title://*:title[1]</CIVIX_INDEX_FIELDS>
        </index>
    </root>  

Navigating

If the CIVIX_DOCUMENT_TYPE is index or dir, you can navigate through the various index or directory levels by appending the CIVIX_DOCUMENT_ID to the url.

So in our example above you could append the CIVIX_DOCUMENT_ID statreg plus / to the url giving you www.bclaws.ca/civix/content/complete/statreg/

Example XML (Shortened for brevity)


    <root>
        <dir>
            <CIVIX_DOCUMENT_TITLE>-- A --</CIVIX_DOCUMENT_TITLE>
            <CIVIX_DOCUMENT_ID>524872423</CIVIX_DOCUMENT_ID>
            <CIVIX_INDEX_ID>statreg</CIVIX_INDEX_ID>
            <CIVIX_DOCUMENT_TYPE>dir</CIVIX_DOCUMENT_TYPE>
            <CIVIX_DOCUMENT_PARENT>statreg</CIVIX_DOCUMENT_PARENT>
            <CIVIX_DOCUMENT_ANCESTORS>statreg</CIVIX_DOCUMENT_ANCESTORS>
            <CIVIX_DOCUMENT_VISIBLE>true</CIVIX_DOCUMENT_VISIBLE>
        </dir>
        <dir>
            <CIVIX_DOCUMENT_TITLE>-- B --</CIVIX_DOCUMENT_TITLE>
            <CIVIX_DOCUMENT_ID>1944036832</CIVIX_DOCUMENT_ID>
            <CIVIX_INDEX_ID>statreg</CIVIX_INDEX_ID>
            <CIVIX_DOCUMENT_TYPE>dir</CIVIX_DOCUMENT_TYPE>
            <CIVIX_DOCUMENT_PARENT>statreg</CIVIX_DOCUMENT_PARENT>
            <CIVIX_DOCUMENT_ANCESTORS>statreg</CIVIX_DOCUMENT_ANCESTORS>
            <CIVIX_DOCUMENT_VISIBLE>true</CIVIX_DOCUMENT_VISIBLE>
        </dir>
    

The content API gives consumers of the API a self-describing RESTFUL interface for navigating BCLaws content. Once a document type is reached (Meta data where CIVIX_DOCUMENT_TYPE is equal to document) you can then use the Document API to interact with document content