4. SPARQL Protocol
4.1. Can I receive the results of SPARQL queries as RDF?
The SPARQL protocol requires that the results of SPARQL CONSTRUCT and DESCRIBE queries be RDF graphs.
SELECT and ASK queries, on the other hand, usually have their results returned as XML (or sometimes as JSON). However, as part of the group’s test suite, the DAWG includes an RDF vocabulary which can be used to represent the results of SELECT or ASK queries in RDF.
4.2. Can I receive the results of SPARQL queries as XML?
The DAWG defines an XML serialization format, the SPARQL Query Results XML Format, which is used to return the results of SPARQL SELECT and ASK queries. The SPARQL protocol requires that the results of SPARQL CONSTRUCT and DESCRIBE queries be RDF graphs, which can be represented using the XML-based RDF/XML syntax.
4.3. Can I receive the results of SPARQL queries as JSON?
JSON is a lightweight serialization format which is a subset of JavaScript’s literal-object notation. It is a useful format to use for SPARQL results when a Web client is issuing the queries and processing the results. The DAWG has published a Note defining a JSON format that closely follows the SPARQL Query Results XML Format, and which can be used to return the results of SPARQL SELECT and ASK queries.