Repository navigation
feat(search): keep summary with latLong in semantic item format - #217
Conversation
More-like-this items now have the same {meta, semantic, summary} as the
main item, so they get latLong as well. Built by
FragmentGraph.SemanticRelatedItem, which has a test.
|
Review: approve, with two changes. Checked: the summary is built before Changes:
On your other questions: keeping the summary is the right call. |
# Conflicts: # hub3/fragments/semantic_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #217 +/- ##
==========================================
+ Coverage 36.10% 36.14% +0.04%
==========================================
Files 412 412
Lines 38154 38157 +3
==========================================
+ Hits 13776 13793 +17
+ Misses 24376 24362 -14
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Why
The DIW asks hub3 for records with
itemFormat=semantic, and map coordinates never arrive in that format. The data is there: it is in Elasticsearch and it shows up in the default format.It gets lost on the way:
nave:DelvingResource.rdf:about, so in every Narthex-mapped record it is a blank node that no triple points at.GenerateSemanticbuilds the tree by walking outward from the entry URI, so it never reaches that node and drops it without a word.What changes
hub3/fragments/resource.go:ResultSummary.AddEntrygets alatLongcase, so an entry taggedlatLongfills insummary.latLong.hub3/server/http/handlers/search.go: bothsemanticpaths (search list and single record) now build the summary beforeResourcesis cleared, and keep it instead of setting it to nil. The summary is built from every resource in the record, so it reaches the blank node the tree walk misses.The result:
summary.latLongappears in semantic responses for every Narthex-mapped dataset, with no mapping changes needed.Payload.
Fields,JSONLD,ProtoBufandItemare still cleared, so the "reduce payload" intent stays. The summary is the one exception, and it is small.Alternatives considered
@graph: they would become visible, but the client would have to guess which record each one belongs to.rdf:aboutand link it withdcterms:spatial/@rdf:resource, asenb-111-objectenalready does): that is per-dataset work across hundreds of old mappings, and it can never fixnave:DelvingResource, because the record definition has no slot for one.Open questions
GenerateSemantic?search.gohalf, because hub3 has nothing that tests theitemFormatresponses. The proof so far is the live API on a local hub3.Testing
latLongends up insummary.latLong.go test ./hub3/fragments/ ./hub3/server/http/handlers/passes, rebased on the latestdev-v0.5.summary.latLongfor a Narthex-mapped dataset.