Getting started

Using akomando in Node.js applications Read the full documentation

Install akomando by means of NPM:
                              npm install --save akomando
                           
Then import the createAkomando function using the ES6 sintax:
                              import { createAkomando } from 'akomando';
                           
or import the createAkomando function using the vintage ES5 sintax:
                              var createAkomando = require('akomando').createAkomando;
                           
Try akomando with one of the following basic examples or read the full documentation.
                              
// load the AkomaNtoso file in a string
const myAkomaNtosoStream = fs.readFileSync('./my-akomantoso.xml');
const myAkomaNtosoString = myAkomaNtosoStream.toString();

// initialize akomando
const myAkomando = createAkomando({
   aknString: myAkomaNtosoString,
});

// logs the doctype of the loaded document
console.log(myAkomando.getDocType());

// logs the loaded AkomaNtoso as XLM String
console.log(myAkomando.getAkomaNtoso({
   serialize: 'AKNString'
});

// logs the loaded AkomaNtoso as JSON
console.log(myAkomando.getAkomaNtoso({
   serialize: 'JSON'
}));

// logs the raw text of the loaded AkomaNtoso without new lines characters
console.log(myAkomando.getAkomaNtoso({
   serialize: 'TEXT',
   newLines: false,
}));

// logs the loaded AkomaNtoso as HTML String, without inserting the head element and the body element
console.log(myAkomando.getAkomaNtoso({
   serialize: 'HTMLString',
   addHeadElement: false,
   addBodyElement: false,
}));

// logs all meta FRBRcountry of the loaded AkomaNtoso as a JSON object
console.log(myAkomando.getMeta({
   serialize: 'JSON',
   metaRoot: 'FRBRthis',
}));

// logs all hierarchies identifiers of hierarchies having content contained in the loaded AkomaNtoso
console.log(myAkomando.getHierIdentifiers({
   filterByContent: true,
}));

// logs all hierarchies identifiers of articles contained in the loaded AkomaNtoso
console.log(myAkomando.getHierIdentifiers({
   filterByName: 'article',
}));

// Logs the number of all elements contained in the current AkomaNtoso document
console.log(myAkomando.countDocElements());

// Logs the number of all 'ref' elements contained in the current AkomaNtoso document
console.log(myAkomando.countDocElements({
   filterByName: 'ref',
}));

// Logs the list of references that are used at least by one element in the document
console.log(myAkomando.getReferencesInfo({
   filterBy: 'used'
}));

// logs an object containing all the components contained in
// the loaded AkomaNtoso as HTML Documents
console.log(myAkomando.getComponents({
    serialize: 'HTMLDom'
}));

                              
                           
Read the full documentation

Using akomando as a command-line interface Read the full documentation

Downaload and install Node.js and NPM as explained at this link. Then install akomando globally by means of NPM:
                              npm install -g akomando
                           
Try akomando with one of the following basic examples or read the full documentation.
                              
// returns the doc type of the AkomaNtoso file having path "path/to/file"
$ akomando get-doc-type path/to/file

// returns the AkomaNtoso file having path "path/to/file" as a JSON string
$ akomando get-akomantoso path/to/file -s json

// returns the AkomaNtoso file having path "path/to/file" as a HTML string without head and body elements
$ akomando get-akomantoso path/to/file -s html --no-head --no-body

// returns the raw text of the AkomaNtoso file having path "path/to/file" without new lines character
$ akomando get-akomantoso path/to/file -s text --no-new-lines

// returns the meta of the AkomaNtoso file having path "path/to/file" as an AkomaNtoso string
$ akomando get-meta path/to/file

// returns the meta of the AkomaNtoso file having path "path/to/file" as a JSON string
$ akomando get-meta path/to/file -s json

// returns all the meta of the AkomaNtoso file having path "path/to/file" ordering them descending
$ akomando get-hier-identifiers path/to/file --order descending

// returns all hierarchies identifiers of articles of the AkomaNtoso file having path "path/to/file"
$ akomando get-hier-identifiers path/to/file --filter-by-name article

// returns all hierarchies identifiers of hierarchis having content of the AkomaNtoso file having path "path/to/file"
$ akomando get-hier-identifiers path/to/file --filter-by-content

// returns the the number of all elements contained in the AkomaNtoso file having path "path/to/file"
$ akomando count-doc-elements path/to/file

// returns the number of all 'ref' elements contained in the AkomaNtoso file having path "path/to/file"
$ akomando count-doc-elements path/to/file --filter-by-name ref

// Logs the list of the elements that have a "source" attribute not connected to any TLC element in metadata
$ akomando get-references-info  --filter-by used

// logs the string representation of an object containing
// all the components contained in the loaded AkomaNtoso as JSON Objects
$ akomando get-components  -s json

                              
                           
Read the full documentation

Using akomando as a client side package Read the full documentation

Option 1 - Download akomando
Download the latest version of akomando and put the file bundle.akomando.js in the scripts' folder of your application (for instance js/lib/akomando). Then insert the following in the script section of your HTML:
                           
<script type="text/javascript" src="./js/lib/akomando/bundle.akomando.js"></script>
                           
                        
Option 2 - Use CDN
Insert the following in the script section of your HTML to use akomando from our CDN without downloading it:
                           
<script src="https://unpkg.com/akomando/dist/bundle.akomando.js"
        crossorigin="anonymous"></script>
                           
                        
Try akomando with one of the following basic examples or read the full documentation.
                              
<script>
   // load the content of an AkomaNtoso file in some way. Here we use jQuery
   var myAkomaNtosoString = $.ajax({
      url: 'my-akomantoso.xml',
      async: false
   }).responseText;

   // initialize akomando
   var myAkomando =  akomando.createAkomando({
      aknString: myAkomaNtosoString,
   });

   // logs the doctype of the loaded document
   console.log(myAkomando.getDocType());

   // logs the loaded AkomaNtoso as XLM String
   console.log(myAkomando.getAkomaNtoso({
      serialize: 'AKNString'
   });

   // logs the loaded AkomaNtoso as JSON
   console.log(myAkomando.getAkomaNtoso({
      serialize: 'JSON'
   }));

   // logs the raw text of the loaded AkomaNtoso without new lines characters
   console.log(myAkomando.getAkomaNtoso({
      serialize: 'TEXT'
      newLines: false,
   }));

   // logs the loaded AkomaNtoso as HTML String, without inserting the head element and the body element
   console.log(myAkomando.getAkomaNtoso({
      serialize: 'HTMLString',
      addHeadElement: false,
      addBodyElement: false,
   }));

   // logs all meta FRBRcountry of the loaded AkomaNtoso as a JSON object
   console.log(myAkomando.getMeta({
      serialize: 'JSON',
      metaRoot: 'FRBRthis',
   }));

   // logs all hierarchies identifiers of hierarchies having content of the loaded AkomaNtoso
   console.log(myAkomando.getHierIdentifiers({
      filterByContent: true
   }));

   // Logs the number of all elements contained in the current AkomaNtoso document
   console.log(myAkomando.countDocElements());

   // Logs the number of all 'ref' elements contained in the current AkomaNtoso document
   console.log(myAkomando.countDocElements({
      filterByName: 'ref',
   }));

   // Logs the list of references that are used at least by one element in the document
   console.log(myAkomando.getReferencesInfo({
      filterBy: 'used'
   }));

   // logs an object containing all the components contained in
   // the loaded AkomaNtoso as HTML Documents
   console.log(myAkomando.getComponents({
      serialize: 'HTMLDom'
   }));

</script>
                              
                           
Read the full documentation

About akomando

Akomando is a document-centered Javascript library to handle AkomaNtoso documents. It supplies a set of functionalities and helpers to perform the most common tasks on Akoma Ntoso documents. Akomando also supplies a set of specific and complex legal-meaningful operation to retrieve information from Akoma Ntoso documents.

Akomando is fine-tuned on the latest version of the AkomaNtoso schema but you can easily create and use your own configurations files in order to handle older versions of AkomaNtoso.

Although Akomando is document-centered, it can be used on large sets of documents to execute bulk operations. It can be installed as a Node.js package, as a Command-line interface or as a client side library compliant to the latest versions of most common browsers (Safari, Chrome, Firefox, Internet Explorer, Edge).

Akomando is a product of BitNomos S.R.L., and it is an open source software distributed under the MIT license.

Tutorials

Analysis of Acts


This tutorial shows how to use akomando to extract meaningful legal information from Akoma Ntoso documents.

Data Visualization


This tutorial shows how to use akomando to extract and visualize meaningful information from Akoma Ntoso documents.

Full Web App


This tutorial shows how to create a full web application in legal context that works with Akoma Ntoso documents.

Contact us