I am querying an Allegrograph database with Prolog and performing this query:

@prolog_query = "(select(?id ?s ?p ?o) (q ?s ?p ?id ))"
@result_data = repository.query.perform @prolog_query

Luckily I am testing with a small data set, but I still get a big dump of data on the screen. I am using Ruby. How can I parse the @result_data array to extract the data out of the correct columns?

asked 09 May '11, 16:43

Genadinik's gravatar image

accept rate: 66%

edited 09 May '11, 16:45

i think you are using agraph. Result is a hash.

if it were a sparql query like SELECT ?s ?p ?o WHERE {?s ?p ?o} limit 1

result is ;

{"names"=>["s", "p", "o"], "values"=>[["<http://dbpedia.org/ontology/Work>", "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>", "<http://www.w3.org/2000/01/rdf-schema#Resource>"]]}
permanent link

answered 28 Jan '13, 10:14

%C3%87a%C4%9Fda%C5%9F%20Ol's gravatar image

Çağdaş Ol
accept rate: 0%

edited 28 Jan '13, 10:19

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

Question tags:


question asked: 09 May '11, 16:43

question was seen: 2,774 times

last updated: 28 Jan '13, 10:19