Hi Tarje,
It's good to know you are using LODSPeaKr for your project! I was wondering if you have any aggregated query? Something like SELECT SUM() or SELECT MAX(), etc? LDOSPeaKr tries to "translate" SELECT queries into "CONSTRUCT" queries, by replicating the triples available in the graph pattern. For example:
SELECT ?a ?e WHERE{
?a ?c ?b .
?b ?d ?e.
}
is translated into
CONSTRUCT {?a ?c ?b . ?b ?d ?e} WHERE{
?a ?c ?b .
?b ?d ?e.
}
In this way, LODSPeaKr complies with the principle of returning the same information (or as closest as possible) independent of the representation. Of course, this is not perfect, and in particular there is no equivalent way of finding a RDF version equivalen of aggregated values. There are a few thing you can do:
- Upgrade to the latest version of LODSPeaKr (git pull) just to make sure
- Run utils/lodspk.sh cache clear to clear the cache
- Make sure you there is at least one query that doesn't have aggregated values.
That should do it. If it doesn't work, that is probably a bug I need to fix. It would be interesting to query a URI in debug mode (setting utils/lodspk debug on). it could be useful to know what messages appear in the apache log. Actually if you could provide those messages it would be easier for me to fix an eventual bug.
An alternative solution is using custom queries for each content type. In LODSPeaKr you can create a series of queries for every content type, although that is discouraged in general. So for example you can create a folder called nt.queries/ that will contain all the queries that will be executed *only* when requested a URI and asking for N-Triples. Inside you can add a query such as
CONSTRUCT { <{{uri}}> ?p ?o}
WHERE { <{{uri}}> ?p ?o}
Finally, you can create softlinks json.queries, rdf.queries and ttl.queries pointing to nt.queries, thus providing the same content for all the machine-readable formats.
I'm curious of an eventual bug re. to the query conversion, please keep posted what you find.