Defining the resultwith Block

The main code for a gfear script is placed in the with block of the result statement.

The result statement defines a name for the result, and the Uri of the entity type that will materialized from the execution of the gfear script. The result statement is effectively the same as a create entity statement with some syntactic sugar to denote that the entity created with the result statement is the entity that is returned once the gfear script is executed.

The below example defines a result statement and associated with block for a foaf:Person. Some code has been omitted for brevity.

...
ontology("http://xmlns.com/foaf/0.1/", "foaf");
...

result person as foaf:Person with
{
    ...
}

The with block of a result statement can optionally have an identified by clause attached to it. This will be used to identify and update any existing entities within the materialized graph with new properties, or create the entity with all created properties from the gfear script. See Identified By for more details on identified by clause.