-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality for sorting facets/observations into a tree #1542
base: develop
Are you sure you want to change the base?
Conversation
This might be a too naive approach to how this should work? Hopefully it can be a start... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, otherwise LGTM! Let's try it out on e.g. dev2.
|
||
SearchUtils2(Whelk whelk) { | ||
this.queryUtil = new QueryUtil(whelk); | ||
this.disambiguate = new Disambiguate(whelk); | ||
this.jsonLd = whelk.getJsonld(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to pass on the JsonLd object, use Disambiguate.isSubclassOf()
instead.
@@ -123,6 +127,9 @@ private Map<String, Object> buildSliceByDimension(Map<Property, Map<PropertyValu | |||
var sliceNode = new LinkedHashMap<>(); | |||
var isRange = rangeProps.contains(property); | |||
var observations = getObservations(buckets, isRange ? queryTree.removeTopLevelPropValueWithRangeIfPropEquals(property) : queryTree, nonQueryParams); | |||
if (property.name().equals(Disambiguate.RDF_TYPE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use property.isType()
to catch both work and instance types (hasInstanceType
/instanceOfType
in addition to rdf:type
).
78992be
to
7d4befb
Compare
var children = findChildren(observation, observations); | ||
if (!children.isEmpty()) { | ||
queue.addAll(children); | ||
observation.put("children", children); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observation.put("children", children); | |
observation.put("_children", children); |
Since children
is not a defined property
ff9f414
to
4994254
Compare
This reverts commit c15d179.
…g multiple roots from different levels in the tree.
7a7884a
to
5718480
Compare
Maybe we can try this out on dev2 to see how it works in practice.