Skip to content

Prologue and Invocation

Zachary Whitley edited this page Mar 30, 2017 · 1 revision

How to run from command line

  • Syntax:
java -Dfile.encoding=UTF-8 -jar xsparql-cli-jar-with-dependencies.jar [XSPARQL file] [variable="value"] [-f redirect output to file]
  • Don't forget to set the data-file encoding. XSPARQL will use your system locale encoding if left unspecified. If the file has different encoding than you system locale, than XSPAQL will not notify you. As a result in the output there will be broken characters (Issue page)

Needed when producing turtle

By default, the XSPARQL implementation unnecessarily encodes XML special characters, namely URL delimiters < and >.

In order to avoid this for the turtle output insert the following line in the beginning of the XSPARQL file.

declare option saxon:output "method=text";

Base URI is carried to RDF

The current syntax for inserting a base URI is as follows:

declare base-uri "http://example.org#";

The next line must be a XQuery command (eg "let" or "for .. in"), it cannot be a SPARQL command (eg "for .. from"). If necessary, use a fake "let".