Skip to content
DavidLeoni edited this page Oct 28, 2014 · 32 revisions

Status

Design principles

Status

0.50 (in progress)

will be major rework to properly support entity update. Code will stay in its own branch-0.50

0.26 (current)

  • Entity model: to be reworked, shrinked and needs (immutable) implementation of interfaces
  • SemanticText and NLP stuff: has implementations and it's quite stable
  • provenance: to be removed and put in TraceProv repository

Design principles

OpenEntity should be a generic interface to support a variety of knowledge bases. Classes should be expected to have missing values, either because not offered by the knowledge base or too expensive to fetch (for example, batch read of entities might not be available).

Immutability

Immutability prevents hard to find errors and in most cases doesn't actually hit perfomances. Thus interfaces shouldn't have methods for setting properties and most implementation classes should be immutable. To this end, implementations will leverage classes and principles of Google Guava immutable collections

Nullable values

To mark nullable variables we used the @Nullable tag from from JSR-305. Latest IDEs can recognize the tag and warn about unchecked null usage. Wherever possible we also marked Refine nullable fields. We consider all the objects as non null unless marked otherwise. todo how to configure default value?

Example usage:

@Nullable String s;

TODO - probably using the Optional class of Guava would be better, but adopting it would cause compatibility problems with existing

Clone this wiki locally