Hi all,

I've done my java program using jena lib. I want my "ResultSet" (sparql result) to be extremely RDF syntax (pure RDF) not RDF/XML format can anyone guide me ?

asked 25 Jan '11, 09:44

mai%204's gravatar image

mai 4
accept rate: 0%

RDF is a data model; there is no RDF syntax per se. There are various RDF serializations, or syntaxes for representing RDF in a file. RDF/XML is the only one that is a W3C standard for now, but Turtle, a subset of another one called N3, is becoming more popular and looks like it's moving towards standard status. N-Triples is another that is simple but verbose, and not as popular as Turtle (or even RDF/XML), and there are various discussions about JSON-based syntaxes to represent RDF triples.


answered 25 Jan '11, 13:03

bobdc's gravatar image

accept rate: 14%

If you're talking about serialising SPARQL results...

It's important to note that SELECT/ASK queries do not return RDF.

For SELECT/ASK queries—which return tuples of results—the standard serialisation is XML. JSON format results are also widely implemented. Various engines usually default to HTML tables for human viewing.

For CONSTRUCT/DESCRIBE queries—which return RDF graphs—you can use any format syntax you like, preferably the one suited to the Accept-header of the requestor. Along these lines, bobdc's gives you the details: you should support a good mix of syntaxes (shouldn't be too hard to implement all of the appropriate writers, even if the output doesn't look too pretty), particularly RDF/XML, Turtle and N-Triples. (An RDFa result might also be interesting for those requesting HTML.)

...the faster the W3C standardise Turtle and N-Triples, the better. (Better late than never.)


answered 25 Jan '11, 17:48

Signified's gravatar image

Signified ♦
accept rate: 38%


N-Triples is technically already standardised in RDF Test Cases - http://www.w3.org/TR/rdf-testcases/#ntriples. But yes they definitely need to standardise Turtle

(26 Jan '11, 12:50) Rob Vesse ♦ Rob%20Vesse's gravatar image

Yep, I forgot good old Section 3 of RDF Test Cases. [Why W3C, why? :)]

(26 Jan '11, 19:31) Signified ♦ Signified's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 25 Jan '11, 09:44

Seen: 1,539 times

Last updated: 25 Jan '11, 17:48