Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

perf: add doc loader for normalizeFilteredDataset #3551

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/doc/signature/jsonld/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,19 @@ func (p *Processor) removeMatchingInvalidRDFs(view string, opts *processorOpts)
logger.Debugf("Found invalid RDF dataset, Canonicalizing JSON-LD again after removing invalid data ")

// all invalid RDF dataset from view are removed, re-generate
return p.normalizeFilteredDataset(filteredView)
return p.normalizeFilteredDataset(filteredView, opts)
}

// normalizeFilteredDataset recreates json-ld from RDF view and
// returns normalized RDF dataset from recreated json-ld.
func (p *Processor) normalizeFilteredDataset(view string) (string, error) {
func (p *Processor) normalizeFilteredDataset(view string, opts *processorOpts) (string, error) {
ldOptions := ld.NewJsonLdOptions("")
ldOptions.ProcessingMode = ld.JsonLd_1_1
ldOptions.Algorithm = p.algorithm
ldOptions.Format = format
if opts != nil {
ldOptions.DocumentLoader = opts.documentLoader
}

proc := ld.NewJsonLdProcessor()

Expand Down