It's definitely not a hack, it is designed this way. When you do a stardog data add via the CLI, behind the scenes it is executing these 3 steps. Databases executing write operations within transactions is the standard. It allows you to rollback without affecting the end result if a mistake is made.
This is exactly right. The URL that you posted, however, is the endpoint that accepts SPARQL update queries. To use the graph store protocol, you would need to POST to hostname:port/DBName?graph=graph_uri
And if I don't specify "graph=graph_uri" - what would happen?
Let's say I want to achieve the same results as if I would do stardog data add db-name file.jsonld - would that be loaded into some kind of default graph? What is the "graph_uri" for default graph?
Hope you don't mind my questions - I have never done it before...
For the graph store protocol (according to the spec), you always need to provide a graph uri, though for the default graph you merely have to POST to hostname:port/DBName?default.
And yes, that would behave exactly like a stardog data add without specifying a graph URI
In this specific case, since you're using an RDF file format that supports graphs, you can ignore the graph/default query string stuff altogether and just POST hostname:port/DBName. The graphs in the RDF file will be respected.