Hi Shaun,
Sadly, the data is given to me as a series of JSON objects which need to be read in line by line.
No problem, try this:
for $line in file:read-text-lines('input.json') return json:parse($line)
If you want to store all objects in a database, you can combine the query with db:add:
for $line at $pos in file:read-text-lines('json.json') return db:add('db', json:parse($line), $pos || '.xml')
Our Wiki will give you some more hints [1,2,3].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/File_Module [2] http://docs.basex.org/wiki/JSON_Module [3] http://docs.basex.org/wiki/Database_Module