Right now you can't, most of SparqlQuery
is intentionally sealed because a lot of the properties and related classes like GraphPattern
represent the AST and when we originally designed the class we didn't want people to intentionally/accidentally modify the AST in ways that created broken queries.
There is a fluent-query branch in the works which will eventually provide a Fluent API for building queries but the developer behind that is currently on a month long vacation and I haven't seen any activity on it for a while. You can take a look at the Fluent Query wiki for some examples of what this API is going to look like.
If this is an important feature to you we can push this up the priorities but as an open source project we are heavily constrained by the limited resources of our small developer team.
We could likely integrate what we have so far into our 1.0.0 release but our recent release focus has been on bug fixes and stability to make the 1.0.0 a stable production ready release, introducing a new and relatively untested feature goes somewhat against this. Also the API does not yet cover all of SPARQL so would be incomplete and potentially unstable.