Skip to content

danionita/ncf

 
 

Repository files navigation

Net Cash Flow generation for RDF e3value models

Introduction

The e3value methodology

The e3value modeling approach is a graphical method to present networks of enterprises and end users exchanging things of economic value with each other. It is a tool for business development, with a focus on networked businesses. The methodology has been successfully applied in a number of industries, such as Internet service provisioning, digital rights management, electricity power, and in development countries (e.g. Africa and Asia). This is the result of over fifteen years of academic research, and is well published (see [http://e3value.few.vu.nl] for the e3value portal containing numerous scientific publications).

Tool support

There is software tool support available to draw e3value models (see [http://e3value.few.vu.nl/tools/xp/]). Once the graphical models have been drawn, it is possible to attribute all kind of numbers to the created model. For instance, prices of products and services can be given, the number of customers, etc. The result can be used to generate net cash flow sheets. These sheets show - per enterprise and end users - the amount of money exchanged, and indicate the sustainability of each actor involved. The engine that generates these sheets is part of the fore mentioned tool support. This package makes the software engine available as open source, so that the engine can be changed, extended, etc.

The NCF module

The Net Cash Flow (NCF) module of the e3value tool set is basically a compiler that takes as input a RDF representation of the e3value model at hand, and generates an Excel spreadsheet containing per actor the net cash flows. The required RDF representation of the e3value model can be generated by using the normal e3value tool set. Basically, this representation contains a conceptual representation of the e3value model, without any graphical information. The RDF file should be cf. its RDF Schema (RDFS) (see [http://e3value.few.vu.nl/docs/misc/e3value.rdfs]). If the normal e3value graphical editor is used to generate the RDF file, the result file should comply with the RDFS specification.

Maven

The NCF software module is available as maven project. Therefore, to build the module, maven must be installed (see [https://maven.apache.org/]).

Inserting library files to your local maven repository

Maven automatically fetches library dependencies from its public repositories to the user's local library repository. However, there are a few dependencies which are not in the maven repositories, so these should be added manually.

It concerns the following jar files:

RDF2Java

wget http://rdf2java.opendfki.de/export/296/trunk/lib/rdf2java.jar

mvn install:install-file -Dfile=rdf2java.jar -DgroupId=dfki -DartifactId=rdf2java -Dversion=295 -Dpackaging=jar

DFKIUtils

wget http://rdf2java.opendfki.de/export/296/trunk/import/DFKIUtils.jar

mvn install:install-file -Dfile=DFKIUtils.jar -DgroupId=dfki -DartifactId=dfkiutils -Dversion=295 -Dpackaging=jar

RDF API

wget http://www-diglib.stanford.edu/~melnik/rdf/rdf-api-2001-01-19.jar

mvn install:install-file -Dfile=rdf-api-2001-01-19.jar -DgroupId=stanford -DartifactId=rdfapi -Dversion=1.19 -Dpackaging=jar

Note that is important that the above above groupIds, artifactIds, and versions are used, since they are referenced as such by the project's pom.

Building the NCF module

The module can be build by:

mvn clean install

This generates target/ncf-1.0.jar which contains the NCF module without dependencies, target/RDF2Excel.jar which contains the NCF module including all dependencies and the target\jars folder which contains all dependencies.

Invoking the NCF module from the command line

The target/RDF2Excel.jar file can be run as a standalone tool by invoking:

java -jar RDF2Excel.jar -i

This starts a file browser, which can be used to select a RDF file containing the e3value model.

java -jar RDF2Excel.jar -f <filename>

This runs the NCF compiler using the given RDF file as input.

The produce a human readable representation of the Excel file (e.g. for debugging purposes), the -l option can be used.

Controlling the logging

The file target\log4j.properties (source in src/main/java/resources) controls the logging. Consult the log4j documentation (see [http://logging.apache.org/log4j/1.2/]) to adapt this file to your needs.

Invoking the NCF module from code

The file src/main/java/com.e3value.eval.ncf/ProfGenerator contains the required functionality to call the NCF compiler from external code. The compiler can be called by using the following code fragments (see also the source code in ProfGenerator.java).

String destinationFileName = "";
try {
	ProfGenerator p = new ProfGenerator();
	p.loadRDFFile(rdfFileName);
	Iterator i = p.getMapObjects().values().iterator();
	int found_models = 0;
	while (i.hasNext()) {
	Object o = i.next();
	if (o instanceof model) {
		found_models++;
		if (found_models > 1) {
			throw new E3ParseException(
           		"RDF file should contain exactly one 'model'");
           	}
			p.setMymodel((model) o);
		}
	}
	destinationFileName = fn.substring(0, rdfFileName.length() - 4) + ".xls";
            p.storeXLS(destinationFileName, true, true, true, true, true, true,
                    true, true, true, true, logging);
} catch (Throwable t) {
	System.err.println(t);
    t.printStackTrace();
}

Using a different namespace for the RDF input file

The RDF file as generated by the e3value tool uses the http://www.cs.vu.nl/~gordijn/e3value# namespace. The namespace used by the compiler can be customized by replacing loadRDFFile in the above code fragment by

loadRDFFile(rdfFileName, "customNameSpace")

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%