Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result RDF::Query::Solution for RDF/xml #47

Closed
ranielli opened this issue Apr 25, 2014 · 1 comment
Closed

Result RDF::Query::Solution for RDF/xml #47

ranielli opened this issue Apr 25, 2014 · 1 comment

Comments

@ranielli
Copy link

I have a qurey :
result = sparql.query("SELECT * WHERE { ?s ?p ?o }")
result is "RDF::Query::Solution"

I need de result in RDF/XML, any suggest?

@gkellogg
Copy link
Member

The SELECT operator returns a solution set, not an RDF graph, so it can't be serialized to RDF/XML. You may want to do a CONSTRUCT, which can be serialized to RDF/XML.

From the readme:

query = sparql.construct([:s, :p, :o]).where([:s, :p, :o]).limit(10)

query.each_statement do |statement|
  puts statement.inspect
end

You should also be able to do the following:

query.result.to_rdf

Note, there is a mailing list where you can ask questions, rather than raising issues, which might be more appropriate. Send questions or comments to public-rdf-ruby@w3.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants