Skip to content

Commit

Permalink
Merge pull request #78 from palimarrao/edit_bql_docs
Browse files Browse the repository at this point in the history
Changes to CONSTRUCT docs.
  • Loading branch information
xllora authored Jul 18, 2017
2 parents 8f86372 + 67b6839 commit c124872
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions docs/bql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.

```
Expand All @@ -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.

Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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.

0 comments on commit c124872

Please sign in to comment.