org.pandora.api.knowledge
Interface Network

All Known Implementing Classes:
AbstractNetwork, BasicNetwork, DatabaseNetwork

public interface Network

An interconnected set of vertices, representing and knowledge-space. Define methods for creating, removing and finding vertices.


Method Summary
 void associateCaseInsensitivity(java.lang.String word, Vertex meaning)
          Associate alternative cases of the word with the meaning.
 void clear()
          Clear all vertices from the network.
 Vertex createInstance(Primitive type)
          Create a new instance of the type.
 Vertex createInstance(Vertex type)
          Create a new instance of the type.
 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 createSentence(java.lang.String text)
          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 createTimestamp()
          Create a timestamp based on the current nanos.
 Vertex createVertex()
          Create a new vertex in this network, assign the id.
 Vertex createVertex(java.lang.Object data)
          Create a new vertex in this network with the data.
 Vertex createVertex(Vertex vertex)
          Return the matching registered vertex, or register if missing.
 Vertex createWord(java.lang.String text)
          Tokenize the text into its words and create a vertex representation of the word or compound word.
 java.util.List<Vertex> findAll()
          Return all vertices.
 java.util.List<Vertex> findAllLike(java.lang.String filter)
          Return all vertices matching the filter.
 java.util.List findAllQuery(java.lang.String query)
          Return all vertices matching the query.
 java.util.List findAllQuery(java.lang.String query, int max)
          Return all vertices matching the query.
 java.util.List<Relationship> findAllRelationshipsTo(Vertex vertex)
          Find all relationships related to the vertex or of the vertex type.
 Vertex findByData(java.lang.Object data)
          Return the vertex with the given data.
 Vertex findById(java.lang.Number id)
          Return the vertex with the given id.
 Vertex findByName(java.lang.String name)
          Return the vertex with the given name.
 Pandora getPandora()
          Return the associated Pandora instance.
 Network getParent()
          Return the parent network.
 void importMerge(Vertex source, java.util.Map<Vertex,Vertex> identitySet)
          Merge the vertex into this network from an import.
 void merge(Network network)
          Merge the vertices and relations of the network into the source network.
 void merge(Vertex source)
          Merge the vertex into this network.
 void removeRelationship(Relationship relationship)
          Remove the relationship from the network.
 void removeVertex(Vertex vertex)
          Remove the vertex from the network.
 void removeVertexAndReferences(Vertex vertex)
          Remove the vertex and all references to it from the network.
 void resume()
          Resume after a merge/save.
 void save()
          Merge the memory into the long term.
 void setPandora(Pandora pandora)
          Set the associated Pandora instance.
 void setParent(Network parent)
          Set the parent network.
 int size()
          Return the total number of vertices stored.
 

Method Detail

resume

void resume()
Resume after a merge/save.


save

void save()
Merge the memory into the long term. This is similar to a transactional commit. The changes should also be persisted, as the long term should always just be a cache of the storage.


createVertex

Vertex createVertex()
Create a new vertex in this network, assign the id.


createVertex

Vertex createVertex(Vertex vertex)
Return the matching registered vertex, or register if missing.


createVertex

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 return as the data must be unique. If new a new vertex is created and a unique id assigned.


createTimestamp

Vertex createTimestamp()
Create a timestamp based on the current nanos.


removeVertexAndReferences

void removeVertexAndReferences(Vertex vertex)
Remove the vertex and all references to it from the network.


removeVertex

void removeVertex(Vertex vertex)
Remove the vertex from the network. Note that the vertex must be no longer referenced by any other vertex in the network.


removeRelationship

void removeRelationship(Relationship relationship)
Remove the relationship from the network. Note that the relationship must be no longer referenced by any other vertex in the network.


findAll

java.util.List<Vertex> findAll()
Return all vertices.


findAllLike

java.util.List<Vertex> findAllLike(java.lang.String filter)
Return all vertices matching the filter.


findAllQuery

java.util.List findAllQuery(java.lang.String query)
Return all vertices matching the query.


findAllQuery

java.util.List findAllQuery(java.lang.String query,
                            int max)
Return all vertices matching the query.


findAllRelationshipsTo

java.util.List<Relationship> findAllRelationshipsTo(Vertex vertex)
Find all relationships related to the vertex or of the vertex type.


findByData

Vertex findByData(java.lang.Object data)
Return the vertex with the given data.


findByName

Vertex findByName(java.lang.String name)
Return the vertex with the given name.


findById

Vertex findById(java.lang.Number id)
Return the vertex with the given id.


getParent

Network getParent()
Return the parent network. A network is essentially a nested-transactional sub-graph of the parent.


setParent

void setParent(Network parent)
Set the parent network. A network is essentially a nested-transactional sub-graph of the parent.


merge

void merge(Network network)
Merge the vertices and relations of the network into the source network.


merge

void merge(Vertex source)
Merge the vertex into this network.


importMerge

void importMerge(Vertex source,
                 java.util.Map<Vertex,Vertex> identitySet)
Merge the vertex into this network from an import. This is used from importing another memory.


size

int size()
Return the total number of vertices stored.


associateCaseInsensitivity

void associateCaseInsensitivity(java.lang.String word,
                                Vertex meaning)
Associate alternative cases of the word with the meaning.


clear

void clear()
Clear all vertices from the network.


createInstance

Vertex createInstance(Primitive type)
Create a new instance of the type.


createInstance

Vertex createInstance(Vertex type)
Create a new instance of the type.


createWord

Vertex createWord(java.lang.String text)
Tokenize the text into its words and create a vertex representation of the word or compound word.


createSentence

Vertex createSentence(java.lang.String text)
Tokenize the sentence into its words and create a vertex representation.


createObject

Vertex createObject(java.lang.String name)
Create the word, and its meaning. If the word or meaning exist, use the existing one.


createNewObject

Vertex createNewObject(java.lang.String name)
Create the word, and a new meaning.


createSpeaker

Vertex createSpeaker(java.lang.String name)
Find or create the speaker with the name.


getPandora

Pandora getPandora()
Return the associated Pandora instance.


setPandora

void setPandora(Pandora pandora)
Set the associated Pandora instance.