Channel #semsol: Logs

This is a public chat log generated from the #semsol IRC channel.

11:55:35 tonysan: hi there
11:58:30 tonysan: I have a question
11:59:06 tonysan: After I retrieved some data with SPARQL, how do I output them as RDF/XML ?
12:00:18 kwijibo: tonysan: it dpends what kind of query you did
12:00:49 kwijibo: if you did a construct or a describe, you use the arc serialisers to convert the phpp structure to rdf/xml
12:00:59 tonysan: I use DESCRIBE
12:01:45 kwijibo: see the docs about the serialisers then, that'll explain it all
12:02:39 tonysan: Thanks!
12:03:23 bengee: $rdfxml = $store->toRDFXML($describe_query_result_here)
12:04:11 bengee: or maybe $describe_query_result['result']
12:08:35 tonysan: Thanks again, that helps a lot :)
12:09:38 bengee: bengee quaff:owesAnotherBeerTo <#kwijibo>
12:10:40 bengee: oh, wouldn't a social network, just based on the quaff vocabulary be fun?
12:11:06 bengee: maybe + foaf:depiction ;)
12:15:35 tonysan: I got a problem, the output from toRDFXML is not XML :D
12:15:48 tonysan: I am pretty sure I missed something
12:16:10 bengee: hmm
12:16:28 bengee: $q = 'DESCRIBE ...';
12:16:42 bengee: $index = $store->query($q, 'raw');
12:16:59 bengee: $rdfxml = $store->toRDFXML($index);
12:17:07 bengee: that *should* work
12:17:23 bengee: if you omit the "raw" parameter, it'd be:
12:17:44 bengee: $result = $store->query($q);
12:17:57 bengee: $index = $result['result'];
12:18:19 tonysan: that doesn't work, but the values are correct
12:18:43 tonysan: Just not in a XML format
12:19:03 tonysan: Do I need to set 'sem_html_formats' => 'rdfa microformats', ?
12:19:27 bengee: no, that's just for parsing HTML
12:19:36 tonysan: My setup is very simple
12:19:46 tonysan: I have 3 triples in the db
12:20:21 tonysan: a php script which I am working on
12:20:58 tonysan: wait a minute...
12:21:36 tonysan: echo $rdfxml
12:21:43 tonysan: is that the problem?
12:23:04 bengee: what does the toRDFXML output look like?
12:23:16 bengee: isn't it xml-ish?
12:24:50 tonysan: no
12:25:06 tonysan: just the values (o)
12:25:15 bengee: could you paste the result here?
12:25:31 tonysan: my triples
12:25:44 bengee: and maybe a print_r($index)
12:26:09 tonysan: Array ( [query_type] => describe [result] => Array ( [http://localhost/arc/#foo] => Array ( [http://localhost/arc/bar] => Array ( [0] => Array ( [value] => baz [type] => literal ) [1] => Array ( [value] => ba [type] => literal ) ) ) ) [query_time] => 0.0390329360962 )
12:26:15 tonysan: that is the print_r
12:26:21 tonysan: baz ba
12:26:29 tonysan: that is the $rdfxml
12:27:06 bengee: ok, $index['result'] is what you have to pass to toRDFXML() in that case
12:28:10 tonysan: I switched back to non-raw method
12:28:47 tonysan: I passed $index['result'], still won't work...
12:28:50 bengee: just guessing, but you don't view the result in a web browser, do you?
12:29:07 tonysan: Oh...
12:29:48 tonysan: you got it...
12:30:02 bengee: you may want to add a header("Content-Type: text/plain")
12:30:10 bengee: for debugging
12:30:12 tonysan: Sorry for this really dumb everything :/
12:30:33 bengee: heh, at least not a bug in arc then ;)
12:31:13 tonysan: Do you have a function reference like php.net?
12:31:27 bengee: unfortunately not
12:32:10 bengee: only recently started to add inline documentation, still have to complete them and generate docs from that
12:32:59 tonysan: That'll help a lot
12:33:23 tonysan: Thanks for your help :)
12:33:31 bengee: np