radial sugiyama positioning integration

This commit is contained in:
Oxy8
2026-03-23 11:13:27 -03:00
parent 6b9115e43b
commit 696844f341
51 changed files with 10089 additions and 364 deletions

View File

@@ -14,19 +14,32 @@ func runSelectionQuery(
queryID string,
selectedIDs []uint32,
includeBNodes bool,
) ([]uint32, error) {
) (selectionqueries.Result, error) {
def, ok := selectionqueries.Get(queryID)
if !ok {
return nil, fmt.Errorf("unknown query_id: %s", queryID)
return selectionqueries.Result{}, fmt.Errorf("unknown query_id: %s", queryID)
}
idToNode := make(map[uint32]selectionqueries.NodeRef, len(snapshot.Nodes))
keyToID := make(map[string]uint32, len(snapshot.Nodes))
predicateIDByIRI := make(map[string]uint32)
for _, n := range snapshot.Nodes {
nr := selectionqueries.NodeRef{ID: n.ID, TermType: n.TermType, IRI: n.IRI}
idToNode[n.ID] = nr
keyToID[n.TermType+"\x00"+n.IRI] = n.ID
}
if snapshot.Meta != nil {
for predID, iri := range snapshot.Meta.Predicates {
if iri == "" {
continue
}
predicateIDByIRI[iri] = uint32(predID)
}
}
return def.Run(ctx, sparql, selectionqueries.Index{IDToNode: idToNode, KeyToID: keyToID}, selectedIDs, includeBNodes)
return def.Run(ctx, sparql, selectionqueries.Index{
IDToNode: idToNode,
KeyToID: keyToID,
PredicateIDByIRI: predicateIDByIRI,
}, selectedIDs, includeBNodes)
}