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