Skip to content

lappsgrid-incubator/vocabulary-dsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAPPS Vocabulary DSL

Build status: master status develop status

Templating system to generate LAPPS vocabulary web pages.

The LAPPS Vocabulary is expressed as a Groovy DSL that is then processed to generate the http://vocab.lappsgrid.org site as well as Java classes and input to the Discriminator DSL.

This repository creates the executables (shell startup script and jar file) needed to process the LAPPS Vocabulary file. To create the executables do

$ make release

This creates the shell script target/vocab/vocab and the jar file target/vocab/vocab-1.3.0-SNAPSHOT.jar, where VERSION is determined by the content of the VERSION file. It also creates the archive target/vocab-VERSION.zip which contains the shell script and the jar. Those two executables should be added to the bin directory of https://github.com/lapps/vocabulary-pages, where they are used to create HTML pages and Java files.

Using the jar file

java -jar vocab.jar [options] vocabulary-file

where vocabulary-file is the path to the dsl file to be processed.

Options

  • -h --html <path>
    specifies the template used to generate the HTML page for each term in the vocabulary
  • -i --index <path>
    specifies the template used to generate the vocabulary index.html page
  • -d --discriminators
    generate the discriminator dsl fragement
  • -r --rdf <string>
    generates one of the RDF formats owl, rdf, ttl, jsonld, or n3
  • -f --features
    generates the Features.java source file
  • -j --java <string>
    generates the Java source file with annotation definitons. The parameter is the name of the class/file that will be generated.
  • -p --package <string>
    specify the package name to use for the Java source files.
  • -o --output <path>
    output directory

Examples

These examples are for the startup script.

vocab -h pages.template -i index.template -o /tmp lapps.vocab
vocab -j Annotations -p org.lappsgrid.vocabulary -o /tmp lapps.vocab

Makefile

While the build and dependency management is done with Maven, a Makefile is also included to simplify common tasks related to creating an ddeploying the jar file.

Common Goals

  • jar
    Creates an executable jar file. Runs mvn package.
  • clean
    Removes artifacts from previous builds. Runs mvn clean.
  • release
    Creates two zip files with the main jar file and a startup script. The two zips are identical, one is named vocab-latest.zip and one vocab-VERSION.zip where VERSION is taken from the VERSION file, both zip files are in the target directory.
  • install
    Copies the versioned jar and startup script to $HOME/bin as well as to a machine specific directory if it exists.
  • upload
    Uploads the zip file to the downloads area on the ANC web server. This goal will need to be modified before it can be used by other users and also assumes the user has a valid SSH key installed on the ANC server.

Discriminators

Currently the vocabulary files and the discriminator files are genereated by two separate DSL processors. Currently the output from the vocabulary DSL must be copied and pasted into the discriminator.config file before the disciminator web pages can be generated.