The CONSTRUCT Clause
Syntax, purpose and examples of the CONSTRUCT clause
There are three main differences between a standard SPARQL CONSTRUCT clause and the way it is used in CGE in a CONSTRUCT-INVOKE-PRODUCING combination. These differences are described below:
- As mentioned above, the CONSTRUCT-INVOKE-PRODUCING combination always appears nested within the WHERE clause of a SELECT query.
- While a standard SPARQL CONSTRUCT query returns an RDF graph to the user, the CONSTRUCT clause of a CONSTRUCT-INVOKE-PRODUCING combination does not return anything to the user; instead the constructed graph is passed to the graph algorithm as input, and then discarded after the graph algorithm completes execution.
- Because the output of the nested CONSTRUCT clause is eventually discarded, CGE relaxes some of the rules for constructing RDF graphs. In particular, since some graph algorithms expect weighted edges. CGE allows predicates to be literals inside a nested CONSTRUCT clause.