Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public sealed class Condition implements Node permits Type {
private final Operator operator;
private final Value value;


public Condition(Selector selector, Operator operator, Value value) {
this.selector = selector;
this.operator = operator;
Expand Down Expand Up @@ -101,7 +102,9 @@ public boolean implies(Node node, JsonLd jsonLd) {

@Override
public RdfSubjectType rdfSubjectType() {
return RdfSubjectType.noType();
return selector.domain().size() == 1 && selector instanceof Property p
? p.domainTypes.getFirst().rdfSubjectType()
: RdfSubjectType.noType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public non-sealed class Property extends PathElement {

protected Map<String, Object> definition;
protected List<String> domain;
public List<Type> domainTypes;
protected List<String> range;
protected String inverseOf;
protected String langAlias;
Expand All @@ -67,6 +68,7 @@ public Property(String name, JsonLd jsonLd) {
protected Property(Map<String, Object> definition, JsonLd jsonLd) {
this.definition = definition;
this.domain = getDomain(jsonLd);
this.domainTypes = domain.stream().map(t -> new Type(t, jsonLd)).toList();
this.range = getRange(jsonLd);
this.inverseOf = getInverseOf(jsonLd);
this.indexKey = (String) definition.get("ls:indexKey"); // FIXME: This shouldn't have a different prefix (ls: vs librissearch:)
Expand Down
Loading