Closed yuripourre closed 3 years ago
Remember to only persist the first level (forget about nested attributes). And all (children) attributes should be persisted as Id only.
Knowledge Base should index all concepts using Id.
Suggestion: words, types, concepts. They can be persisted in knowledge base separately.
We can try this one: http://jsoniter.com/
Json libraries comparison: https://github.com/fabienrenaud/java-json-benchmark
Do not forget to add a test to serialize and deserialize the same knowledge base.
Also, add tests to handling databases of words since it will be a common use case.
My suggestion is to use JSON so humans can also populate the database.
Now that the id is a String we do not should care about updating indexes to keep everything sorted.
Obviously use an external serializer and a helper class. Do not pollute pojos with annotations.
General approach (words dictionary may be different) A concept with
id = 1
andname.id = nameId1
.Persist as depth first search and all words are leaves.
Ideally, the best order would be;