From 67b683994b51d9e9fd069e639b5ac7d095c23973 Mon Sep 17 00:00:00 2001 From: Aravind Rao Date: Tue, 18 Jul 2017 14:53:45 -0700 Subject: [PATCH] Changes to CONSTRUCT docs. --- docs/bql.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/bql.md b/docs/bql.md index 64acc745..bc93099b 100644 --- a/docs/bql.md +++ b/docs/bql.md @@ -406,8 +406,8 @@ with the driver implementation. ## Building new facts out of existing facts in graphs -Some cases you want to create new facts--insert new triples---into a graph or -graphs based on the already existing facts. Constructing new facts requires +In some cases you want to create new facts--insert new triples---into a graph or +graphs based on already existing facts. Constructing new facts requires two steps: (1) querying for the information that is going to be used to create new facts, and (2) how those new facts are going to be created. An illustrative example is: @@ -423,12 +423,12 @@ illustrative example is: }; ``` -The above statement would copy all facts from graph `?src` to graph `?dst`. +The above statement would copy all facts from graph `?src` to graph `?dest`. The where clause will bind to all available predicates. Each binding will -then be used on the construct part to create the new triples. +then be used in the construct part to create the new triples. -A more elaborated example would be to create the a new fact `grandparent` into -the destination graphs by properly extracting graph patters via the where +A more elaborate example would be to create a new fact `grandparent` into +the destination graphs by properly extracting graph patterns via the where clause. ``` @@ -447,9 +447,9 @@ The above statement would add into graph `?dest` one triple for each binding of `?ancestor` and `?grandchildren` found in the `?src` graph. The `CONSTRUCT` statement supports using multiple graphs for `INTO` and `FROM` -clauses. All binding froms all graphs in the `FROM` clause are going to be -gathered together. The new facts will be insert in all the indicated graphs -in the `INTO` list. +clauses. All bindings from all graphs in the `FROM` clause are going to be +gathered together. The new facts will be inserted into all the graphs +indicated in the `INTO` list. Also, you can create multiple new facts based on the bindings. @@ -468,7 +468,7 @@ Also, you can create multiple new facts based on the bindings. Sometimes, inserting individual triples is not enough to express some facts. Some concepts require reification to be able to be expressed. `CONSTRUCT` -support reification in two different flavors. +supports reification in two different flavors. ``` CONSTRUCT { @@ -487,10 +487,10 @@ support reification in two different flavors. This query would create only a new reified fact if both family members live in the exact same city. Please note the `;` syntax. All partial -statements after it would be attached to the reified statement. +statements after it will be attached to the reified statement. -Another way to express the same fact is to used the explicit blank note -notation. `CONSTRUCT` supports +Another way to express the same fact is to use the explicit blank node +notation. `CONSTRUCT` supports the following. ``` CONSTRUCT { @@ -510,10 +510,10 @@ notation. `CONSTRUCT` supports }; ``` -The above query is equivalent to the above one, but it explicitly does the +The above query is equivalent to the query above it, but it explicitly does the reification by using `_:v`, which express a unique blank node linking the -reification together. `CONSTRUCT` clause supports creating an arbitrary +reification together. The `CONSTRUCT` clause supports creating an arbitrary number of blank nodes. The syntax is always the same, they all start with -the prefix `_:` followed by a logical ID. On insertion of each new fact +the prefix `_:` followed by a logical ID. On insertion of each new fact, BQL guarantees a new unique blank node will be generated by each of them. Example of multiple blank nodes generated at once are `_:v0`, `_:v1`, etc.