Last email before people start suspecting me of spamming the list :)

My assumption was correct. The store is working fine when I submit a well formed SPARQL query that does not return the whole store.

To summarize - if you want to set up a SPARQL endpoint for your SMW:

- follow the instructions on SMW SPARQL page
    - The RAP model and object are created automatically with the URLs :
         - http://servername/model
         - http://servername/id
- make sure your Apache server is set up correctly
       - Enable mod_rewrite and allow it to run by enabling 'Allow Override' in your main folder
       - Add URL mappings for the netapi (for the mod rewrtie) and the Special:URIResolver pages (for the /id folder)
- DO NOT try to load the main store URL directly. It will probably time out.
- Use a good SPARQL client to test your store.
       - I used Twinkle - http://www.ldodds.com/projects/twinkle/
- Start with the most basic query - retrieve a single page - and work your way up
- The base URL should be : http://servername/wiki/Special:URIResolver/ and not whatever mapping you defined in Apache

I will add this to my list of Referata tips when I get a chance to review it in more details.

- Laurent


From: "Laurent Alquier" <laurent@alquier.org>
Sent: Wednesday, July 29, 2009 9:22 AM
To: semediawiki-user@lists.sourceforge.net
Subject: Re: [Semediawiki-user] SMW and SPARQL endpoint (RAP) - part 2


For what is worth, I figured out both issues. I am stuck a little further down the line it seems :)

Mapping /id to the Special:URIResolver was trivial.

My other issue turned out to be a symptom of a request time out PHP error, incorrectly parsed by the XML parser.

I will assume for now that I am getting time out errors because I am sending invalid SPARQL queries which, in return, try to bring back ALL triples in the store.

I will focus on finding out a simple query to test that assumption.

- Laurent


From: "Laurent Alquier" <laurent@alquier.org>
Sent: Wednesday, July 29, 2009 3:42 AM
To: semediawiki-user@lists.sourceforge.net
Subject: Re: [Semediawiki-user] SMW and SPARQL endpoint (RAP) - part 2


Could someone familiar with the server configuration of 'semantic-mediawiki.org' take a look at this ?

Making progress since yesterday. I found out 'Allow Override' was turned off in my Apache configuration - no wonder the URL Rewrite did not work as intended :)

I installed a local SPARQL client (Twinkle) and tested it on queries against DBpedia to make sure it is working correctly.

Last step - building a SPARQL query against my triple store.

Two issues remain at the moment :

1- If I try opening the URL of the model as defined by RAP - http://servername/rdfapi-php/netapi/model' - I get an error about invalid XML (related to a font 'color=#ff0000' parameter).

It looks like it is trying to retrieve triples from the model but the error is telling me something is still wrong.

2- RAP defined two URLs.

http://servername/model - for the model as stored in RAP
http://servername/id - for objects.

The idea being, the URL : 'http://servername/id/Property-3AHas_location' should be translated into: 'http://servername/wiki/Property:Has_location'.

For example, this is working on the SMW site with URLs on this page: http://semantic-mediawiki.org/wiki/SPARQL

What I am missing is how to map the object URL to enable the translation.

In my configuration, 'http://servername/id/Property-3AHas_location'  returns 'Page not found'.

Almost there....

- Laurent





From: "Laurent Alquier" <laurent@alquier.org>
Sent: Tuesday, July 28, 2009 2:38 PM
To: semediawiki-user@lists.sourceforge.net
Subject: [Semediawiki-user] SMW and SPARQL endpoint (RAP) - part 2



Hi again

I thought I would give another shot at setting up a SPARQL endpoint for my SMW.

First I looked at SMW+ Jena connector. The video tutorial on the SMW+ forum is very appealing - very simple - but as far as I can tell, it still requires a running installation of SMW+ and I am not ready to make the switch yet for several reasons.

So I took another look at my failed attempt at using RAP.

The good news is that I was able to set up RAP and populate it with triples without errors (using a full refresh). I checked with MySQL query browser and the triples are there. So far so good,

I even figured out what values to give RAP's netapi module as far as 'model' and 'URI' go (the documentation on SMW page is very light on details on that point).

The problem is that I am still missing some configuration regarding setting up the actual SPARQL endpoint.

The server keeps giving me 'Not found' error when I try to access resources directly. SPARQL queries are not going anywhere.

Does anybody know someone who got 'PHP netapi' correctly configured to run with Apache and SMW ?

I am willing to write a tutorial or a tip on Referata with the results of my experience if anyone is interested.

- Laurent