The lemon API
HTML Java XSLT Other
Switch branches/tags
Nothing to show
Clone or download
Latest commit f6f5ef9 Apr 20, 2018
Permalink
Failed to load latest commit information.
main Update POMs Apr 20, 2018
oils Update POMs Apr 20, 2018
.gitignore Add more data categories Mar 22, 2013
LICENSE Add license and readme Mar 6, 2013
README.md Update README to reflect current API Aug 7, 2014
pom.xml Update Group ID Dec 19, 2017

README.md

The Lemon API

The lemon (Lexicon Model for Ontologies) API provides a programmatic interface for the lemon model. The lemon model is a model for describing lexica and their relationships to ontologies given in the OWL format. Lemon was designed with the following goals

  • RDF-native
  • Concise
  • Descriptive not Prescriptive
  • Modular
  • Semantics by Reference

For more details of the lemon model see http://lemon-model.net

JavaDoc

JavaDoc is available at http://monnetproject.github.com/lemon.api/

Usage Example

final LemonSerializer serializer = LemonSerializer.newInstance();
final LemonModel model = serializer.create();
final Lexicon lexicon = model.addLexicon(
        URI.create("http://www.example.com/mylexicon"),
        "en" /*English*/);
final LexicalEntry entry = LemonModels.addEntryToLexicon(
        lexicon,
        URI.create("http://www.example.com/mylexicon/cat"),
        "cat",
        URI.create("http://dbpedia.org/resource/Cat"));

final LemonFactory factory = model.getFactory();
final LexicalForm pluralForm = factory.makeForm();
pluralForm.setWrittenRep(new Text("cats", "en"));
final LinguisticOntology lingOnto = new LexInfo();
pluralForm.addProperty(
        lingOnto.getProperty("number"),
        lingOnto.getPropertyValue("plural"));
entry.addOtherForm(pluralForm);

serializer.writeEntry(model, entry, lingOnto, 
        new OutputStreamWriter(System.out));