npm install --save akomando
import { createAkomando } from 'akomando';
var createAkomando = require('akomando').createAkomando;
// 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'
}));
npm install -g akomando
// 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
<script type="text/javascript" src="./js/lib/akomando/bundle.akomando.js"></script>
<script src="https://unpkg.com/akomando/dist/bundle.akomando.js"
crossorigin="anonymous"></script>
<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>
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.
This tutorial shows how to use akomando to extract meaningful legal information from Akoma Ntoso documents.
This tutorial shows how to use akomando to extract and visualize meaningful information from Akoma Ntoso documents.
This tutorial shows how to create a full web application in legal context that works with Akoma Ntoso documents.
BitNomos S.R.L - Operative HQ, Via Galliera 3, 40129, Bologna, Italy, Europe