Execute Updates on a Database Using the CGE update Command
Function, syntax, output and examples of the CGE update command, which can be used to execute a single query, as well as multiple queries at the same time.
The update command executes updates on a database. This command can be used to execute a single update or a sequence of updates. Executing an update returns a message indicating whether the update succeeded or failed.
- By providing list files, which contain lists of update files to be run.
- By providing the names of update files directly
- Via stdin (only if no updates are specified in other ways and the
--non-interactiveoption is not used)
The supported input methods have the precedence shown in the list above. Therefore, updates contained within any specified list files will be executed before any directly specified updates.
This command may only be used to execute SPARQL updates. If it is required to executed queries, use the query command. To execute a combination of queries and updates, use the sparql command.
Execution of Multiple Updates
If multiple updates need to be executed, they will be executed in the order specified, subject to the aforementioned precedence of list files over individual files. The command will print a success or failure message for each update.For more information, see the cge-cli-update(1) man page.
Examples
Execute an Update
$ cge-cli update --list updates.txt extra-update.ruThe above statement will execute all the queries specified in updates.txt file before executing the query specified in the extra-update.ru file.
Execute Multiple Updates
$ cge-cli update create-graph.ru drop-graph.ru