Skip to content
Merged
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
4 changes: 2 additions & 2 deletions docs/api/woql.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ when(true()).triple("a", "b", "c")
```

### path
#### WOQL.path(subject, pattern, object, resultVarName) ⇒ <code>WOQLQuery</code>
#### WOQL.path(subject, pattern, object, [resultVarName]) ⇒ <code>WOQLQuery</code>
Performs a path regular expression match on the graph

**Returns**: <code>WOQLQuery</code> - - A WOQLQuery which contains the path regular expression matching expression
Expand All @@ -1039,7 +1039,7 @@ Performs a path regular expression match on the graph
| subject | <code>string</code> | An IRI or variable that refers to an IRI representing the subject, i.e. the starting point of the path |
| pattern | <code>string</code> | (string) - A path regular expression describing a pattern through multiple edges of the graph Path regular expressions consist of a sequence of predicates and / or a set of alternatives, with quantification operators The characters that are interpreted specially are the following: | representing alternative choices , - representing a sequence of predcitates + - Representing a quantification of 1 or more of the preceding pattern in a sequence {min, max} - Representing at least min examples and at most max examples of the preceding pattern - Representing any predicate () - Parentheses, interpreted in the normal way to group clauses |
| object | <code>string</code> | An IRI or variable that refers to an IRI representing the object, i.e. ending point of the path |
| resultVarName | <code>string</code> | A variable in which the actual paths traversed will be stored |
| [resultVarName] | <code>string</code> | A variable in which the actual paths traversed will be stored |

**Example**
```js
Expand Down
4 changes: 3 additions & 1 deletion lib/query/woqlQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,9 @@ WOQLQuery.prototype.path = function(Subject, Pattern, Object, Path) {
if (typeof Pattern == 'string') Pattern = this.compilePathPattern(Pattern)
this.cursor['pattern'] = Pattern
this.cursor['object'] = this.cleanObject(Object)
this.cursor['path'] = this.varj(Path)
if(typeof Path !== 'undefined') {
this.cursor['path'] = this.varj(Path)
}
return this
}

Expand Down
2 changes: 1 addition & 1 deletion lib/woql.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ WOQL.true = function() {
* - Representing any predicate
* () - Parentheses, interpreted in the normal way to group clauses
* @param {string} object - An IRI or variable that refers to an IRI representing the object, i.e. ending point of the path
* @param {string} resultVarName - A variable in which the actual paths traversed will be stored
* @param {string} [resultVarName] - A variable in which the actual paths traversed will be stored
* @returns {WOQLQuery} - A WOQLQuery which contains the path regular expression matching expression
* @example
* let [person, grand_uncle, lineage] = vars("person", "grand uncle", "lineage")
Expand Down