|
|
__init__(self,
storages,
name,
inst)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
string or None
|
setContext(self,
un,
password)
Changes the security context of the database. |
|
|
|
string
|
addContext(self,
uuid,
password,
save=True)
Create/Modify a context for the given neuron. |
|
|
|
boolean
|
removeContext(self,
uuid,
save=True)
Remove the context for the given id. |
|
|
|
string
|
getDBName(self)
Returns the name of the database |
|
|
|
number
|
findVerbCount(self,
uuid)
Return the number of links in which uuid is the verb |
|
|
|
number
|
findObjectCount(self,
uuid)
Return the number of links in which uuid is the object |
|
|
|
number
|
findSubjectCount(self,
uuid)
Return the number of links in which l is the subject |
|
|
|
string or None
|
authenticate(self,
username,
password)
Authenticate the username and password |
|
|
|
dict
|
stats(self)
Return some statistics about the database |
|
|
|
|
|
|
|
|
|
|
undump(self,
fn)
INCOMPLETE: Undump the database from a file dumped by the dump method |
|
|
|
string
|
dump(self,
fn=None)
INCOMPLETE: Dump the database to a file fn. |
|
|
|
boolean
|
pack(self)
Reorder and reorganize the data-files to save space. |
|
|
|
string
|
isAlive(self)
Check if the RPC mechanism is working |
|
|
|
boolean
|
close(self)
Safely close the database |
|
|
|
string
|
addSnapshot(self,
name=str(time.time()))
Create a snapshot called name |
|
|
|
boolean
|
commit(self,
Msg='',
User='hk')
Commit changes made since the start of the transaction. |
|
|
|
boolean
|
|
|
boolean
|
rollback(self)
Abort current transaction and start a new one |
|
|
|
list
|
checkAllCapabilities(self,
resourceUUID)
Returns a list of capabilities that the actor for the current context
has on the resource represented by resourceUUID. |
|
|
|
|
checkCapability(self,
v,
o)
Returns True if we have the v capability for o. |
|
|
|
dict
|
getCapability(self,
s)
Returns a dictionary of capabilities for the actor s. |
|
|
|
|
addCapability(self,
s,
v,
o,
save=True)
Give s the v capability on o if and only if the actor for the current
context also has the capability. |
|
|
|
|
removeCapability(self,
s,
v,
o,
save=True)
Revoke the v capability on o from s if and only if the actor for the
current context also has the capability. |
|
|
|
boolean
|
checkPolicy(self,
v,
o)
Return True if the actor for the current context has access for the v
policy on resource o. |
|
|
|
dict
|
getPolicy(self,
o)
Returns the policy dictionary for the resource o. |
|
|
|
|
setPolicy(self,
o,
v,
policyString,
save=False)
Set the v policy for resource o. |
|
|
|
|
removePolicy(self,
o,
v=None,
save=False)
Resets the v policy for the resource o to the default policy. |
|
|
|
|
checkSecurity(self,
v,
o)
Check if the actor for the current context has access to o (either
via capabilities or the policy for o). |
|
|
|
|
|
|
list
|
getLink(self,
uuid,
m,
deleted=False)
Return a list of uuids of links where the neuron represented by uuid
is participating as m. |
|
|
|
boolean
|
validateName(self,
x)
Return True if x is a valid name/alias for a meme. |
|
|
|
Meme
|
addMeme(self,
name,
save=True)
Create a new meme with name name. |
|
|
|
Dictionary (if key is None) or the type of the metadata value.
|
getMeta(self,
uuid,
key=None)
Gets the metadata dictionary for the neuron referenced by uuid. |
|
|
|
string
|
setMeta(self,
uuid,
d,
save=True)
Sets the metadata dictionary for a neuron referenced by uuid to the
dictionary d. |
|
|
|
boolean
|
removeMeta(self,
uuid,
key=None,
save=False)
Removes metadata from the neuron referenced by uuid. |
|
|
|
string
|
setBinary(self,
uuid,
data,
save=True)
Add binary data contained in data to uuid. |
|
|
|
string
|
getBinary(self,
uuid)
Retrieve the file stored as binary data for meme uuid. |
|
|
|
boolean
|
removeBinary(self,
uuid,
save=True)
Removes the binary data associated with the neuron referenced by
uuid. |
|
|
|
string or None
|
getIcon(self,
uuid)
Returns the Icon data for the neuron referenced by uuid if it exists
or None otherwise |
|
|
|
string
|
setIcon(self,
uuid,
data,
save=True)
Set the icon for u to be the data in data. |
|
|
|
boolean
|
removeIcon(self,
uuid,
save=True)
Remove the icon for the neuron referenced by uuid. |
|
|
|
list of strings
|
getIds(self,
name)
Return all the uuids for a given name. |
|
|
|
list
|
getNeuron(self,
x)
Returns a list of neurons having the given name or uuid or list of
names or ids. |
|
|
|
string if uuid is a string, list if uuid is list of uuids
|
getName(self,
uuid)
Return the name of the neuron with the given uuid. |
|
|
|
list
|
getAlias(self,
uuid,
_flatten=True)
Returns a list of aliases for the neuron with the given uuid. |
|
|
|
neurons.L
|
addLink(self,
s,
v,
o,
save=True)
Create a new link with subject s, verb v and object o. |
|
|
|
boolean
|
isOrphan(self,
uuid)
Returns True if the neuron referenced by uuid is not a member of any
links. |
|
|
|
boolean
|
removeLink(self,
uuid,
save=True)
Remove the link with the given uuid. |
|
|
|
neurons.M
|
setName(self,
uuid,
name,
save=True)
Rename the neuron with the given uuid to name. |
|
|
|
The type of name (strings are assumed to be utf-8 and decoded to
unicode) or list (if uuid is a list)
|
addAlias(self,
uuid,
name,
save=True)
Add an alias name, to the neuron with the given uuid. |
|
|
|
boolean
|
removeAlias(self,
uuid,
name,
save=True)
Remove an the <name> alias to the neuron with the given uuid. |
|
|
|
string
|
addView(self,
uuid,
q,
columns=None,
save=True)
Create a view based on the the query q |
|
|
|
string
|
setView(self,
uuid,
q,
new_name=None,
new_columns=None,
save=True)
Update the view with uuid to be based on the the query q |
|
|
|
list or list of lists (if name is a list)
|
getView(self,
name)
Return a list of dictionaries containing definitions for the view. |
|
|
|
boolean
|
removeView(self,
uuid,
save=False)
Removes the view definitions associated with uuid |
|
|
|
list
|
runView(self,
uuid)
Run the view and return the results |
|
|
|
list
|
query(self,
q,
notLinks=False,
target=None)
Run a query on the database. |
|
|
|
boolean
|
removeObject(self,
uuid,
save=True)
This method removes an object by removing the links to all its
attributes. |
|
|
|
string
|
addObject(self,
obj,
name=None,
save=True)
Save the object obj to disk. |
|
|
|
|
|
|
string
|
setObject(self,
uuid,
obj,
save=True)
Update the object referenced by uuid using the dictionary obj. |
|
|
idea.Idea
|
getObject(self,
uuid)
Returns the Idea object with the given uuid. |
|
|
|
number
|
bulkInsert(self,
filename,
column_headers,
typ=None,
typ_verb=None,
field_delimiter=",",
enclosing_char='"',
escape_char="\\",
line_prefix="",
line_delimiter="\r\n",
ignore_lines=0)
Insert a csv file into the database. |
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|