Skip to content

feat(search): resource path queries over any number of hops - #220

Merged
kiivihal merged 1 commit into
mainfrom
feat/resource-path-queries
Nov 16, 2026
Merged

kiivihal merged 1 commit into
mainfrom
feat/resource-path-queries

Conversation

@kiivihal

Copy link
Copy Markdown
Member

The path DSL of ikuzo/rdf/index ([class]predicate->…) now also queries the v2 index, over any number of hops, with several conditions on the same linked resource.

  • fragments.ParseResourcePath + ResourcePath.ValueQuery/ResourceQuery + EntryQuery: one nested query on resources, a context condition per hop (Level, SearchLabel, SubjectClass), the class of the resource at the end, and its literal or URI. Generalises QueryFilter's single Level2 hop (its Level1 was never queried).
  • DSL extension: alternatives in a class, [schema:Person|schema:Organization], in parsing, namespace expansion and graph traversal; documented in path_query_syntax.md.

Checked on the NDE index (Haags Historisch Museum, work → Role → Person):

path records
[]schema:creator->[schema:Role]schema:creator->[schema:Person]schema:name = Sphinx 4
same with [schema:Organization] 1
same with [schema:Person|schema:Organization] 5 (= hand-written query)
same Role: name fabrikanten + creator Sphinx 4
same Role: name fotografen + creator Sphinx 0

Full test suite green locally (61 packages). Used by nde-integration-layer for CQL2 path properties.

🤖 Generated with Claude Code

The path DSL of ikuzo/rdf/index ([class]predicate->…) now also queries the
v2 index. fragments.ParseResourcePath reads a path into a ResourcePath, and
ValueQuery/ResourceQuery/EntryQuery turn it into one nested query on
resources: a context condition per hop (Level, SearchLabel, SubjectClass),
the class of the resource at the end, and its literal or URI. Conditions
in one ResourceQuery hold for the same linked resource. This generalises
QueryFilter's single Level2 hop, whose Level1 was never queried.

The DSL gets alternatives in a class, [schema:Person|schema:Organization],
in parsing, namespace expansion and graph traversal.

On the NDE index (HHM): Sphinx as name of the person behind a Role is 4
records, as organisation 1, with Person|Organization 5, the same as a
hand-written query; "same Role as fabrikanten" 4, "as fotografen" 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.50%. Comparing base (e6ed6ef) to head (74d6f33).

Files with missing lines Patch % Lines
hub3/fragments/path.go 97.77% 1 Missing ⚠️
ikuzo/rdf/index/path_query.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #220      +/-   ##
==========================================
+ Coverage   36.41%   36.50%   +0.09%     
==========================================
  Files         412      413       +1     
  Lines       38176    38230      +54     
==========================================
+ Hits        13901    13957      +56     
+ Misses      24273    24271       -2     
  Partials        2        2              
Flag Coverage Δ
unittests 36.50% <96.66%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kiivihal
kiivihal merged commit 6fafef9 into main Nov 16, 2026
6 checks passed
@kiivihal
kiivihal deleted the feat/resource-path-queries branch November 16, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant