ProvSQL SQL API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
Circuit gate manipulation

Low-level functions for creating and querying provenance circuit gates. More...

Functions

VOID provsql.create_gate (UUID token, PROVENANCE_GATE type, UUID[] children=NULL)
 Create a new gate in the provenance circuit.
 
PROVENANCE_GATE provsql.get_gate_type (UUID token)
 Return the gate type of a provenance token.
 
UUID[] provsql.get_children (UUID token)
 Return the children of a provenance gate.
 
VOID provsql.set_prob (UUID token, DOUBLE PRECISION p)
 Set the probability of an input gate.
 
DOUBLE PRECISION provsql.get_prob (UUID token)
 Get the probability associated with an input gate.
 
VOID provsql.set_infos (UUID token, INT info1, INT info2=NULL)
 Set additional INTEGER values on provenance circuit gate.
 
RECORD provsql.get_infos (UUID token, OUT INT info1, OUT INT info2)
 Get the INTEGER info values associated with a circuit gate.
 
VOID provsql.set_extra (UUID token, TEXT data)
 Set extra TEXT information on provenance circuit gate.
 
TEXT provsql.get_extra (UUID token)
 Get the TEXT-encoded extra data associated with a circuit gate.
 
BIGINT provsql.get_nb_gates ()
 Return the total number of gates in the provenance circuit.
 

Detailed Description

Low-level functions for creating and querying provenance circuit gates.

Function Documentation

◆ create_gate()

VOID provsql.create_gate ( UUID  token,
PROVENANCE_GATE  type,
UUID[]  children = NULL 
)

Create a new gate in the provenance circuit.

Parameters
tokenUUID identifying the new gate
typegate type (see PROVENANCE_GATE)
childrenoptional array of child gate UUIDs
Source code
provsql.sql line 58

◆ get_children()

UUID[] provsql.get_children ( UUID  token)

Return the children of a provenance gate.

Source code
provsql.sql line 70

◆ get_extra()

TEXT provsql.get_extra ( UUID  token)

Get the TEXT-encoded extra data associated with a circuit gate.

Source code
provsql.sql line 136

◆ get_gate_type()

PROVENANCE_GATE provsql.get_gate_type ( UUID  token)

Return the gate type of a provenance token.

Source code
provsql.sql line 65

◆ get_infos()

RECORD provsql.get_infos ( UUID  token,
OUT INT  info1,
OUT INT  info2 
)

Get the INTEGER info values associated with a circuit gate.

Source code
provsql.sql line 112

◆ get_nb_gates()

BIGINT provsql.get_nb_gates ( )

Return the total number of gates in the provenance circuit.

Source code
provsql.sql line 141

◆ get_prob()

DOUBLE PRECISION provsql.get_prob ( UUID  token)

Get the probability associated with an input gate.

Source code
provsql.sql line 85

◆ set_extra()

VOID provsql.set_extra ( UUID  token,
TEXT  data 
)

Set extra TEXT information on provenance circuit gate.

This function sets TEXT-encoded data associated to a circuit gate, used in different ways by different gate types:

  • for project, it is a TEXT-encoded ARRAY of two-element ARRAYs that indicate mappings between input attribute (first element) and output attribute (second element)
  • for value and agg, it is the TEXT-encoded (base for value, computed for agg) scalar value
Parameters
tokenUUID of the circuit gate
dataTEXT-encoded information
Source code
provsql.sql line 131

◆ set_infos()

VOID provsql.set_infos ( UUID  token,
INT  info1,
INT  info2 = NULL 
)

Set additional INTEGER values on provenance circuit gate.

This function sets two INTEGER values associated to a circuit gate, used in different ways by different gate types:

  • for mulinput, info1 indicates the value of this multivalued variable
  • for eq, info1 and info2 indicate the attribute index of the equijoin in, respectively, the first and second columns
  • for agg, info1 is the oid of the aggregate function and info2 the oid of the aggregate result type
  • for cmp, info1 is the oid of the comparison operator
Parameters
tokenUUID of the circuit gate
info1first INTEGER value
info2second INTEGER value
Source code
provsql.sql line 106

◆ set_prob()

VOID provsql.set_prob ( UUID  token,
DOUBLE PRECISION  p 
)

Set the probability of an input gate.

Parameters
tokenUUID of the input gate
pprobability value in [0,1]
Source code
provsql.sql line 80