Skip to content

Commit b0ff0dd

Browse files
committed
Merge branch 'dev' of https://github.com/terminusdb/terminus-client into dev
2 parents f597ad8 + 6976245 commit b0ff0dd

File tree

3 files changed

+6551
-13886
lines changed

3 files changed

+6551
-13886
lines changed

lib/woql.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ WOQL.when = function(Query, Update){ return new WOQLQuery().when(Query, Update);
2525
/**
2626
* The Query in the Optional argument is specified as optional
2727
* @param {object} query - WOQL Query object
28+
* @example
29+
* WOQL.opt(WOQL.triple("v:optionalSubject", "v:optionalObject", "v:optionalValue"))
2830
* @return {object} WOQLQuery
2931
*/
3032
WOQL.opt = function(query){ return new WOQLQuery().opt(query); }
@@ -69,21 +71,49 @@ WOQL.start = function(start, query){ return new WOQLQuery().start(start, query);
6971
WOQL.select = function(...list){ return new WOQLQuery().select(...list); }
7072

7173
/**
72-
* Creates a logical OR of the arguments
74+
* Filter the query so only those triples that match any of the subqueries are included
7375
* @param queries - WOQL Query objects
7476
* @return {object} WOQLQuery
77+
*
78+
*
79+
* @example
80+
* // find triples that are of type scm:Journey, and have
81+
* // a start_station v:Start, and that start_station is labeled
82+
* // v:Start_Label
83+
*
84+
* WOQL.and(
85+
* WOQL.triple("v:Journey", "type", "scm:Journey"),
86+
* WOQL.or(
87+
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31007"),
88+
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31114")),
89+
* WOQL.triple("v:Journey", "scm:start_station", "v:Start"),
90+
* WOQL.triple("v:Start", "label", "v:Start_Label"))
91+
*
92+
* @see WOQLQuery().woql_or for WOQL.py version of the same function
7593
*/
7694
WOQL.or = function(...queries){ return new WOQLQuery().or(...queries); }
7795

7896
/**
79-
* Creates a logical AND of the arguments
97+
* Filter the query so only those triples that match all of the subqueries are included
8098
* @param queries - WOQL Query objects
8199
* @return {object} WOQLQuery
100+
*
101+
* @example
102+
* // find triples that are of type scm:Journey, and have
103+
* // a start_station v:Start, and that start_station is labeled
104+
* // v:Start_Label
105+
*
106+
* WOQL.and(
107+
* WOQL.triple("v:Journey", "type", "scm:Journey"),
108+
* WOQL.triple("v:Journey", "start_station", "v:Start"),
109+
* WOQL.triple("v:Start", "label", "v:Start_Label"))
110+
*
111+
* @see WOQLQuery().woql_and for WOQL.py version of the same function
82112
*/
83113
WOQL.and = function(...queries){ return new WOQLQuery().and(...queries); }
84114

85115
/**
86-
* Creates a logical NOT of the arguments
116+
* Include only triples that do not match the single contained query
87117
* @param queries - WOQL Query objects
88118
* @return {object} WOQLQuery
89119
*/

0 commit comments

Comments
 (0)