AKSW/Erfurt — pull request #41 by k00ni (2012-12-12 13:49:09+00:00)
Title: add Erfurt/Sparql/ResultHelper.php

The main functionality of this class is to transform a given sparqlQuery result (from the function sparqlQuery) into a "real" associative array, which means that for instance the following sparqlQuery result:

```
array(6) {
[0]=>
array(3) {
["s"]=>
string(31) "http://data.lod2.eu/scoreboard/"
["p"]=>
string(42) "http://www.w3.org/2000/01/rdf-schema#label"
["o"]=>
string(6) "Foobar"
}
[1]=>
array(3) {
["s"]=>
string(31) "http://data.lod2.eu/scoreboard/"
["p"]=>
string(38) "http://usefulinc.com/ns/doap#shortdesc"
["o"]=>
string(28) "This is a short description."
}
...
}
```

will look like this:

```
array(1) {
["http://data.lod2.eu/scoreboard/"]=>
array(6) {
["rdfs:label"]=>
array(1) {
[0]=>
string(6) "Foobar"
}
["doap:shortdesc"]=>
array(1) {
[0]=>
string(28) "This is a short description."
}
...
}
```

As you can see the subject is key in the root array, the predicate is key in the secondary subarray. Objects are elements of a certain predicate-key array. In the example you see rdfs: instead of the whole rdfs-Uri. Thats another function in the class, which replaces the whole uri's with their prefix, but only on demand!