Skip to content

Commit 750486a

Browse files
Add "any" predicate
1 parent 8ccd363 commit 750486a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/query/woqlCore.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ function compilePredicate(pp, q) {
711711
if (pp.indexOf('<') !== -1 && pp.indexOf('>') !== -1) {
712712
let pred = pp.slice(1, pp.length - 1);
713713
// eslint-disable-next-line no-multi-assign,no-constant-condition
714-
const cleaned = (pred = '*' ? 'owl:topObjectProperty' : q.cleanPathPredicate(pred));
714+
const cleaned = (pred = '.' ? null : q.cleanPathPredicate(pred));
715715
return {
716716
'@type': 'PathOr',
717717
or: [{
@@ -725,18 +725,15 @@ function compilePredicate(pp, q) {
725725
};
726726
} if (pp.indexOf('<') !== -1) {
727727
const pred = pp.slice(1, pp.length);
728-
// let cleaned = pred === '*' ? 'owl:topObjectProperty' : q.cleanPathPredicate(pred)
729-
const cleaned = q.cleanPathPredicate(pred);
728+
const cleaned = (pred = '.' ? null : q.cleanPathPredicate(pred));
730729
return { '@type': 'InversePathPredicate', predicate: cleaned };
731730
} if (pp.indexOf('>') !== -1) {
732731
const pred = pp.slice(0, pp.length - 1);
733-
// let cleaned = pred === '*' ? 'owl:topObjectProperty' : q.cleanPathPredicate(pred)
734-
const cleaned = q.cleanPathPredicate(pred);
732+
const cleaned = (pred = '.' ? null : q.cleanPathPredicate(pred));
735733
return { '@type': 'PathPredicate', predicate: cleaned };
736734
}
737-
// let pred = pp === '*' ? 'owl:topObjectProperty' : q.cleanPathPredicate(pp)
738-
const pred = q.cleanPathPredicate(pp);
739-
return { '@type': 'PathPredicate', predicate: pred };
735+
const cleaned = (pp = '.' ? null : q.cleanPathPredicate(pp));
736+
return { '@type': 'PathPredicate', predicate: pp };
740737
}
741738

742739
/**

0 commit comments

Comments
 (0)