Ejemplo n.º 1
0
Archivo: types.go Proyecto: timtadh/sfp
func DeserializeSubGraph(bytes []byte) *subgraph.SubGraph {
	sg, err := subgraph.LoadSubGraph(bytes)
	if err != nil {
		panic(err)
	}
	return sg
}
Ejemplo n.º 2
0
func LoadSubgraphPattern(Dt *Digraph, label []byte) (*SubgraphPattern, error) {
	pat, err := subgraph.LoadSubGraph(label)
	if err != nil {
		return nil, err
	}
	return NewSubgraphPattern(Dt, pat), nil
}
Ejemplo n.º 3
0
func LoadEmbListNode(dt *Digraph, label []byte) (*EmbListNode, error) {
	sg, err := subgraph.LoadSubGraph(label)
	if err != nil {
		return nil, err
	}
	has, _, exts, embs, overlap, unsupEmbs, err := loadCachedExtsEmbs(dt, sg)
	if err != nil {
		return nil, err
	}
	if !has {
		return nil, errors.Errorf("Node was not saved: %v", &SubgraphPattern{Dt: dt, Pat: sg})
	}

	n := &EmbListNode{
		SubgraphPattern: SubgraphPattern{Dt: dt, Pat: sg},
		extensions:      exts,
		embeddings:      embs,
		overlap:         overlap,
		unsupEmbs:       unsupEmbs,
	}
	return n, nil
}