Skip to content
Merged
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
34 changes: 31 additions & 3 deletions lib/woql.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,49 @@ WOQL.start = function(start, query){ return new WOQLQuery().start(start, query);
WOQL.select = function(...list){ return new WOQLQuery().select(...list); }

/**
* Creates a logical OR of the arguments
* Filter the query so only those triples that match any of the subqueries are included
* @param queries - WOQL Query objects
* @return {object} WOQLQuery
*
*
* @example
* // find triples that are of type scm:Journey, and have
* // a start_station v:Start, and that start_station is labeled
* // v:Start_Label
*
* WOQL.and(
* WOQL.triple("v:Journey", "type", "scm:Journey"),
* WOQL.or(
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31007"),
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31114")),
* WOQL.triple("v:Journey", "scm:start_station", "v:Start"),
* WOQL.triple("v:Start", "label", "v:Start_Label"))
*
* @see WOQLQuery().woql_or for WOQL.py version of the same function
*/
WOQL.or = function(...queries){ return new WOQLQuery().or(...queries); }

/**
* Creates a logical AND of the arguments
* Filter the query so only those triples that match all of the subqueries are included
* @param queries - WOQL Query objects
* @return {object} WOQLQuery
*
* @example
* // find triples that are of type scm:Journey, and have
* // a start_station v:Start, and that start_station is labeled
* // v:Start_Label
*
* WOQL.and(
* WOQL.triple("v:Journey", "type", "scm:Journey"),
* WOQL.triple("v:Journey", "start_station", "v:Start"),
* WOQL.triple("v:Start", "label", "v:Start_Label"))
*
* @see WOQLQuery().woql_and for WOQL.py version of the same function
*/
WOQL.and = function(...queries){ return new WOQLQuery().and(...queries); }

/**
* Creates a logical NOT of the arguments
* Include only triples that do not match the single contained query
* @param queries - WOQL Query objects
* @return {object} WOQLQuery
*/
Expand Down