Empty serializations and logs

17 views
Skip to first unread message

Tarje Lavik

unread,
Sep 16, 2013, 10:34:23 AM9/16/13
to lods...@googlegroups.com
Hi!
Not much happening here, but here goes :-).

I have been prototyping a new special collection website using LODspeakr and it work great so we would like to use it in production later this year. You can see the site here: http://data.ub.uib.no (in norwegian). We will develop this further, but we have come a long way in a short time with LODspeakr since starting using it last month.

But we have problems with serialization in json, ttl, ect. When building services and types the html-views works great, but the other formats are empty. There is also trouble with the log-files, which are empty except for timestamps.

Fine type (event:Event):

Empty json:

We have not been able to figure out what might be wrong, but suspect misconfiguration of permissions and/or apache. Have you experienced this or have any hint?

Thanks!

Tarje Lavik
University of Bergen Library
Section for digital systems and services

Alvaro Graves

unread,
Sep 16, 2013, 10:13:59 PM9/16/13
to Tarje Lavik, lods...@googlegroups.com

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.

Best,
Alvaro Graves-Fuenzalida
Web: http://graves.cl - Twitter: @alvarograves

Tarje Lavik

unread,
Sep 17, 2013, 5:52:06 AM9/17/13
to lods...@googlegroups.com, Tarje Lavik, alv...@graves.cl
Hi, thx for quick reply!
I am troubled by the fact that we haven't got LODspeakr working properly. I was hoping to avoid creating custom queries for the content types.

I made a gist with some of the log here: https://gist.github.com/tarjelavik/6592055

For the type event:Event we only have two queries:

Main: 
SELECT ?label WHERE 
{
<{{uri}}> skos:prefLabel ?label .
}  

Parts:
SELECT * WHERE 
{
{ SELECT DISTINCT ?imgUri ?image ?title WHERE 
{
<{{uri}}> ?p ?imgUri .
?imgUri ubbont:hasRepresentation/ubbont:hasURI ?image . 
?imgUri dct:identifier ?identifier .
    OPTIONAL 
{ ?imgUri dct:title ?title . }
    }
LIMIT 100 

    ?imgUri ubbont:showWeb true .
}  

For all the other types and services the .json is empty, as is the default rdfs:Resource. So i do not believe it is the queries that is the problem.

Sincerely, 
Tarje

Alvaro Graves

unread,
Sep 17, 2013, 10:27:33 AM9/17/13
to Tarje Lavik, lods...@googlegroups.com
Hi Tarje,

I see you are using SPARQL 1.1 queries. Currently LODSPeaKr relies on ARC2 for parsing SPARQL queries, but ARC2 only supports SPARQL 1.0. I always wanted to try some of the forks of ARC2 that supposedly supports SPARQL 1.1. I'll try this weekend and wil let you know if it works.

Alvaro Graves-Fuenzalida
Web: http://graves.cl - Twitter: @alvarograves


Tarje Lavik

unread,
Sep 17, 2013, 1:09:21 PM9/17/13
to lods...@googlegroups.com, Tarje Lavik, alv...@graves.cl
Great! It would be great if LODspeakr supported 1.1 of course, but regarding our problem there seems to me that there is something else i have done wrong. Wouldn't the default view e.g. rdfs:Resource give me some json?

This uses rdfs:Resource, but the json is still empty:

We will do some tests and find the error. I tested LODspeakr on my home computer, and both the logs and serialization worked, so we must have done something wrong on our RHEL server.

Anyhow, looking forward to see the results from your weekend project :-).

Sincerely, Tarje
Reply all
Reply to author
Forward
0 new messages