Examples

Here are a series of examples of what information can be represented by LongSpine data. Some of the examples are just static "this is how you show X" scenarios, others are queries that, with given inputs, yield particular answers.

Example 1: List the Portfolios responsible for each Matter for a particular period of government

LongSpine includes a model for AAOs and also a static dataset of all AAOs' content. This query uses only these two resources.

Inputs:

  • A change in government - a particular AAO. Here we use AAO 60, 26/11/2001

Steps:

  1. Using the AAOs model, formulate a SPARQL query to get all the Matters for AAO 60.
  2. Load the AAOs Model & Dataset into a triplestore
  3. Run the query

Outputs:

The query gnerated is:

           
    PREFIX aao: 
    PREFIX dct: 
    SELECT ?dept ?title ?matter ?desc
    WHERE {
        ?aaoPart a aao:AAO-Part ;
                 dct:isPartOf  ;
                 aao:matterDealtWith ?matter ;
                 aao:responsibleDepartment ?dept .

        ?matter dct:description ?desc .
        ?dept dct:title ?title .
    }
    ORDER BY ?dept
        

AAOs are comprised of Parts which contain the Matters, so find parts within A60 (identified by URI). AAO Parts are have Departments responsible for them with Depts indicated at a Portfolio level.

Example 1: Find the Portfolios for a Matter over time

For a given Matter, find the Portfolios that are responsible for that Matter over a particular timespan.

Inputs:

  • A Matter
  • A timespan
    • Expressed in dates or in terms of a particular timeline (like AAO periods or particular Governments)

Example 3: Find all the Government Structural Units, from all Datasets, assigned a particular Government Function in a particular Epoch

This query uses the fact that all component datasets' content is aligned to the LongSpine Overarching Data Model to allow a single query to retrieve content from multiple, differently presented, datasets.

Inputs:

  • A particular Government Function
  • A particular Epoch

SPARQL Query:

  PREFIX time: <http://www.w3.org/2006/time#> .
  PREFIX long: <http://linked.data.gov.au/def/longspine#> .

  SELECT *
  WHERE {
    ?gsu  a long:GovernmentStructuralUnit ;
          long:assigned <INPUT-GOVERNMENT-FUNCTION> ;
          time:hasTime <INPUT-EPOCH> .
  }