docs: add deprecation warnings for addNoun and addVerb methods
- Add @deprecated JSDoc tags to TypeScript definitions
- Update all documentation examples to use modern add() and relate() API
- Preserve batch operations (addNouns, addVerbs) as they remain current
- Mark deprecated methods in both source and compiled definitions
Migration guide:
- addNoun(data, type, metadata) → add(data, { nounType: type, ...metadata })
- addVerb(source, target, type, metadata) → relate(source, target, type, metadata)
This commit is contained in:
parent
6e299c576c
commit
e311a149df
21 changed files with 343 additions and 331 deletions
|
|
@ -69,19 +69,19 @@ const brain = new BrainyData()
|
|||
await brain.init()
|
||||
|
||||
// Add entities (nouns)
|
||||
const articleId = await brain.addNoun("Revolutionary AI Breakthrough", {
|
||||
const articleId = await brain.add("Revolutionary AI Breakthrough", {
|
||||
type: "article",
|
||||
category: "technology",
|
||||
rating: 4.8
|
||||
})
|
||||
|
||||
const authorId = await brain.addNoun("Dr. Sarah Chen", {
|
||||
const authorId = await brain.add("Dr. Sarah Chen", {
|
||||
type: "person",
|
||||
role: "researcher"
|
||||
})
|
||||
|
||||
// Create relationships (verbs)
|
||||
await brain.addVerb(authorId, articleId, "authored", {
|
||||
await brain.relate(authorId, articleId, "authored", {
|
||||
date: "2024-01-15",
|
||||
contribution: "primary"
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue