I'm running a version of Semantic Media Wiki and I'd like to be able to query the data externally, from another php script. Right now I'm doing the fairly complex task of dumping the RDF (which takes a good 2-3 minutes), and using ARC2 to run a SPARQL query on it from my app. It gets me the data I need, but I'm left with the problem of keeping the ARC2 cache of the RDF data up to date with the Semantic Media Wiki. This will probably involve running a cron to dump the RDF every so often (or, possibly, on every "save changes" action) and then updating the ARC2 store of the RDF data. Obviously not a quick way of keeping the data synchronized.
I would obviously like to query the Semantic Media Wiki directly without having to do the conversion to RDF, and think it's possible, but I am unsure as of where to start. I'm poking around in includes/storage but it's not straightforward to me how I invoke a query against the SMW from an external PHP application using any of these scripts. I have a feeling it may only be a matter of including these storage files into my application and then running the right function with a query -- but I want to make sure I'm on the right track. Is this a good idea?
Alright, thanks in advance,