[Nepomuk] Soprano - NRLModel

Vishesh Handa handa.vish at gmail.com
Mon Jul 19 01:31:02 CEST 2010


I was going through the code and I noticed some stuff.

** NrlModel::setEnableQueryPrefixExpansion* isn't implemented correctly.
Please see the attached patch.

* I was looking through Nepomuk Storage and Soprano code to figure out why
the ontologies aren't loaded the first time Nepomuk is run. It turns out
that they are loaded, but the prefixes aren't. The problem is that the
NRLModel sets the prefixes only when *
NRLModel::setEnableQueryPrefixExpansion* is called. Currently it is called
in *Nepomuk::Repository* immediately after the creation of the virtuoso
backend. The ontologies are loaded after the creation of the model and are
therefore not added to the query expansion hash. The way I see it there are
3 solutions -

1. Forget it entirely. It's a minor annoyance, and I can just restart
Nepomuk to get it to work.
2. Implement some kind of slot that refreshes the query expansion hash. This
would be a little messy as the* Nepomuk::Respository *is a SignalCacheModel
which internally uses a NRL Model on top of the virtuoso model. And there is
the fact that Nepomuk::Core isn't aware of the existence of the NRLModel and
I don't think *Nepomuk::Respository* should advertise it.
3. Implement *NRLModel::addStatement* to check for the addition of
statements with nao:hasDefaultNamespaceAbbreviation and accordingly update
the prefix hash. This method has the added advantage that if a new Ontology
is installed or an existing one is updated, it's namespace abbreviation is
updated as well.

* I like what *NRLModel::addNrlStatement* is doing but it isn't really used
anywhere. In order for it to be used one would have to implement
addStatement() and call it over there. Maybe we could do that? It would fix
some cardinality issues I've found. Or we could just forget about it and
leave it up to the client to check if the cardinality is valid. If it's
decided that we are going to use it, we should probably implement some form
of a cache so as to not slow down Nepomuk by querying the system every time
a statement is added.

- Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100719/1f930d6e/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NrlModel_QueryExpansion.diff
Type: text/x-patch
Size: 544 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100719/1f930d6e/attachment.diff 


More information about the Nepomuk mailing list