public abstract class AbstractNetwork extends java.lang.Object implements Network, java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_SIZE |
static int |
MAX_TEXT
Define max text size for data value.
|
Constructor and Description |
---|
AbstractNetwork(boolean isShortTerm) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addVertex(Vertex vertex)
Register the vertex with the network.
|
void |
associateCaseInsensitivity(java.lang.String word,
Vertex meaning)
Associate alternative cases of the word with the meaning.
|
void |
associateCaseInsensitivity(Vertex word)
Associate alternative cases of the word with the meaning, types, conjugations.
|
void |
checkReduction(Vertex sentence)
Check if the sentence has been reduced, if not, then reduce.
|
AbstractNetwork |
clone()
Return a copy of the network.
|
Vertex |
createAnonymousSpeaker()
Create a new anonymous speaker.
|
Vertex |
createFormula(java.lang.String code)
Compile the forumla response.
|
Vertex |
createFragment(java.lang.String text)
Tokenize the fragment into its words and create a vertex representation.
|
Vertex |
createInstance(Primitive type)
Create a new instance of the type.
|
Vertex |
createInstance(Vertex type)
Create a new instance of the type.
|
Vertex |
createMeta(Relationship relationship)
Return the relationship meta vertex.
|
Vertex |
createName(java.lang.String text)
Create the word as a name.
|
Vertex |
createNewObject(java.lang.String name)
Create the word, and a new meaning.
|
Vertex |
createObject(java.lang.String name)
Create the word, and its meaning.
|
Vertex |
createParagraph(java.lang.String text)
Tokenize the paragraph into its sentences and create a vertex representation.
|
Vertex |
createParagraph(Vertex sentence)
Convert the sentence to a paragraph if it has multiple phrases.
|
Vertex |
createPattern(java.lang.String text)
Tokenize the sentence pattern into its words and wildcrads, and create a vertex representation.
|
Vertex |
createPattern(java.lang.String text,
SelfCompiler compiler)
Tokenize the sentence pattern into its words and wildcrads, and create a vertex representation.
|
Vertex |
createPrimitive(java.lang.String name)
Create the primitive and associate the word to it.
|
Vertex |
createSentence(java.lang.String text)
Tokenize the sentence into its words and create a vertex representation.
|
Vertex |
createSentence(java.lang.String text,
boolean generated)
Tokenize the sentence into its words and create a vertex representation.
|
Vertex |
createSentence(java.lang.String text,
boolean generated,
boolean reduction)
Tokenize the sentence into its words and create a vertex representation.
|
Vertex |
createSentence(java.lang.String text,
boolean generated,
boolean reduction,
boolean whitespace)
Tokenize the sentence into its words and create a vertex representation.
|
Vertex |
createSpeaker(java.lang.String name)
Find or create the speaker with the name.
|
Vertex |
createTemplate(java.lang.String code)
Compile the template response.
|
Vertex |
createTemporyVertex()
Create a temporary, non-persistent vertex.
|
Vertex |
createTimestamp()
Create a timestamp based on the current nanos.
|
Vertex |
createUniqueSpeaker(Primitive id,
Primitive type,
java.lang.String name)
Find or create the speaker from the unique id.
|
Vertex |
createVertex()
Create a new vertex in this network,
assign the id and creation date.
|
Vertex |
createVertex(java.lang.Object data)
Create a new vertex in this network with the data,
If a vertex with the data already exists, then it is returned as the data must be unique.
|
Vertex |
createVertex(Vertex source)
Create a new vertex from the source.
|
Vertex |
createWord(java.lang.String text)
Tokenize the text into its words and create a vertex representation of the word or compound word.
|
Bot |
getBot()
Return the associated Bot instance.
|
java.util.Map<java.lang.Object,Vertex> |
getVerticesByData() |
void |
importMerge(Vertex source,
java.util.Map<Vertex,Vertex> identitySet)
Merge the vertex into this network from an import.
|
Vertex |
importVertex(Vertex source,
java.util.Map<Vertex,Vertex> identitySet)
Find the vertex matching the source, or create a new one.
|
boolean |
isReadOnly() |
boolean |
isShortTerm() |
void |
merge(Network network)
Merge the vertices and relations of the network into this network.
|
void |
merge(Vertex sourceVertex)
Merge the vertex into this network.
|
void |
parseFragment(Vertex fragment,
java.lang.String text,
boolean generated,
boolean whitespace)
Tokenize the fragment into its words and create a vertex representation.
|
void |
removeProperty(java.lang.String propertyName)
Remove the property setting to the current transaction.
|
void |
removeRelationship(Relationship relationship)
Remove the relationship from the network.
|
void |
saveProperty(java.lang.String propertyName,
java.lang.String value,
boolean startup)
Save the property setting to the current transaction.
|
void |
setBot(Bot bot)
Set the associated Bot instance.
|
void |
setShortTerm(boolean isShortTerm) |
java.lang.String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
clear, countAll, countAllLike, executeNativeQuery, executeQuery, findAll, findAll, findAllInstances, findAllLike, findAllLike, findAllQuery, findAllQuery, findAllQuery, findAllRelationshipsTo, findAllRelationshipsTo, findAllRelationshipsTo, findByData, findById, findByName, findByNativeQuery, findData, getCriteriaBuilder, getParent, removeVertex, removeVertexAndReferences, resume, save, search, setParent, size
public static final int MAX_TEXT
public static int MAX_SIZE
public boolean isReadOnly()
isReadOnly
in interface Network
public java.util.Map<java.lang.Object,Vertex> getVerticesByData()
public void saveProperty(java.lang.String propertyName, java.lang.String value, boolean startup)
saveProperty
in interface Network
public void removeProperty(java.lang.String propertyName)
removeProperty
in interface Network
public AbstractNetwork clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public abstract void addVertex(Vertex vertex)
Network
public Vertex createVertex()
createVertex
in interface Network
public Vertex createTemporyVertex()
createTemporyVertex
in interface Network
public Vertex createVertex(Vertex source)
createVertex
in interface Network
public Vertex createVertex(java.lang.Object data)
createVertex
in interface Network
public void merge(Network network)
public void merge(Vertex sourceVertex)
public Vertex importVertex(Vertex source, java.util.Map<Vertex,Vertex> identitySet)
public void importMerge(Vertex source, java.util.Map<Vertex,Vertex> identitySet)
importMerge
in interface Network
public void removeRelationship(Relationship relationship)
removeRelationship
in interface Network
public Vertex createMeta(Relationship relationship)
createMeta
in interface Network
public Vertex createInstance(Primitive type)
createInstance
in interface Network
public Vertex createInstance(Vertex type)
createInstance
in interface Network
public Vertex createWord(java.lang.String text)
createWord
in interface Network
public Vertex createName(java.lang.String text)
createName
in interface Network
public void associateCaseInsensitivity(java.lang.String word, Vertex meaning)
associateCaseInsensitivity
in interface Network
public void associateCaseInsensitivity(Vertex word)
associateCaseInsensitivity
in interface Network
public Vertex createParagraph(Vertex sentence)
createParagraph
in interface Network
public Vertex createParagraph(java.lang.String text)
createParagraph
in interface Network
public Vertex createSentence(java.lang.String text)
createSentence
in interface Network
public Vertex createPattern(java.lang.String text)
createPattern
in interface Network
public Vertex createPattern(java.lang.String text, SelfCompiler compiler)
createPattern
in interface Network
public Vertex createSentence(java.lang.String text, boolean generated)
createSentence
in interface Network
public Vertex createSentence(java.lang.String text, boolean generated, boolean reduction)
createSentence
in interface Network
public Vertex createTemplate(java.lang.String code)
createTemplate
in interface Network
public Vertex createFormula(java.lang.String code)
createFormula
in interface Network
public Vertex createSentence(java.lang.String text, boolean generated, boolean reduction, boolean whitespace)
createSentence
in interface Network
public void checkReduction(Vertex sentence)
checkReduction
in interface Network
public Vertex createFragment(java.lang.String text)
createFragment
in interface Network
public void parseFragment(Vertex fragment, java.lang.String text, boolean generated, boolean whitespace)
public Vertex createObject(java.lang.String name)
createObject
in interface Network
public Vertex createPrimitive(java.lang.String name)
createPrimitive
in interface Network
public Vertex createNewObject(java.lang.String name)
createNewObject
in interface Network
public Vertex createSpeaker(java.lang.String name)
createSpeaker
in interface Network
public Vertex createUniqueSpeaker(Primitive id, Primitive type, java.lang.String name)
createUniqueSpeaker
in interface Network
public Vertex createAnonymousSpeaker()
createAnonymousSpeaker
in interface Network
public Vertex createTimestamp()
createTimestamp
in interface Network
public Bot getBot()
public void setBot(Bot bot)
public boolean isShortTerm()
public void setShortTerm(boolean isShortTerm)