Well, I just released a new version of Semantic Drilldown, 0.5.6, that gets around this problem: SD's if-statements all checked for 'SMWSQLStore2' before, but now they all check for 'SMWSQLStore', so any value that's not that will be handled as if it were SMWSQLStore2. (And I'm eventually planning to get rid of support for the old SMWSQLStore altogether in SD, which will make it even less of an issue.) It might still be a good idea to change the $smwgDefaultStore setup in some way, but for now this particular problem is fixed.

-Yaron


On Sat, Apr 4, 2009 at 2:47 PM, Markus Krötzsch <markus@semantic-mediawiki.org> wrote:
On Dienstag, 24. März 2009, Yaron Koren wrote:
> Well, this is already beyond my knowledge level. Any SMW developers care to
> comment?

Sure. First of all: relax, it's just software! ;-)


I agree with Yaron that it is somewhat confusing if an extension sets a user-
level "configuration option" internally. On the other hand, I agree with Kai
that this is a much cleaner solution than any of the current alternatives.
Before this was done, Halo did require (or automatically apply) patches to SMW
code. Setting the storage engine is certainly a more friendly (and easier to
revert) behaviour.

I also do not think that the problem would go away by moving this function to
a hook as Michael suggested. In the end, any extension that replaces/extends
the storage engine always has more responsibility for not breaking the code
(and some higher risk of doing so). I do not see a way for Halo to not
replace/extend core storage functions. Also, Halo's store has to be used even
in SMW's (writing) operations (so adding parameters to smwfGetStore() would
not suffice), since otherwise Halo could not update its records that are
needed for SPARQL querying. Of course, one could conceive more advanced
extension mechanisms, e.g. by providing hooks on single storage methods.

If more extensions would start modifying the store on such a basic level,
there would of course be further problems and new incompatibilities (note,
however, that Halo does preserve the data that is available in SMW, so it does
not break other extensions that access the DB under the assumption that SMW's
store is used). This would be a point where we would start thinking about more
general extension architectures.

For now I mostly view this as a documentation problem: any user who installs
Halo should be aware that it is a prerequisite to use the current Halo store
as the storage engine. Instead of setting this automatically, one could
require the user to do this, and issue a warning/error if not. But I doubt
that this would make Halo much more easy to deploy.

Cheers,

Markus

>
> -Yaron
>
> On Tue, Mar 24, 2009 at 10:59 AM, Kai Kühn <kuehn@ontoprise.de> wrote:
> > We want SMW to use our implementation of the SMW storage layer
> > interface. The SMWHalo storage layer implementation delegates all calls
> > to the default implementation and extend some of them. But we need to
> > make sure that SMW will instantiate our implementation, thats why we
> > change $smwgDefaultStore (SMW_GlobalFunctions.php l. 589 ff):
> >
> > function &smwfGetStore() {
> >        global $smwgMasterStore, $smwgDefaultStore, $smwgIP;
> >
> >          ....
> >
> >        if ($smwgMasterStore === NULL) {
> >            $smwgMasterStore = new $smwgDefaultStore();
> >        }
> >        return $smwgMasterStore;
> >    }
> >
> >
> > Kai
> >
> > Yaron Koren schrieb:
> > > I don't understand - if you need to somehow indicate something about
> > > Halo's own data storage, why not create a separate variable for it?
> > > You're not actually modifying SMW's own data storage, I assume.
> > >
> > > -Yaron
> > >
> > >
> > > On Tue, Mar 24, 2009 at 10:14 AM, Kai Kühn <kuehn@ontoprise.de
> > > <mailto:kuehn@ontoprise.de>> wrote:
> > >
> > >     Other extensions do not extend SMW's storage layer. For example, we
> > >     added a triplestore. Do you know a way to extend SMW's storage
> > > layer without changing that variable or patching SMW in any way?
> > >
> > >     Kai
> > >
> > >     Yaron Koren schrieb:
> > >     > That's ridiculous - extensions shouldn't modify global variables
> > >
> > >     that
> > >
> > >     > the user can set, especially not ones defined by other
> > >     > extensions.
> > >     >
> > >     > -Yaron
> > >     >
> > >     >
> > >     > On Tue, Mar 24, 2009 at 9:24 AM, Kai Kühn <kuehn@ontoprise.de
> > >
> > >     <mailto:kuehn@ontoprise.de>
> > >
> > >     > <mailto:kuehn@ontoprise.de <mailto:kuehn@ontoprise.de>>> wrote:
> > >     >
> > >     >     SMWHalo changes $smwgDefaultStore to SMWHaloStore2, because
> > >     > it adds some
> > >     >     functionality to the update process. Change SD that it
> > >     > accepts SMWHaloStore2 as a wrapper around SMWStoreSQL2. It's
> > >     > fully
> > >
> > >     compatible.
> > >
> > >     >     Kai
> > >     >
> > >     >     Yaron Koren schrieb:
> > >     >     > With some testing and private discussion, Valerio and I
> > >     >
> > >     >     uncovered the
> > >     >
> > >     >     > problem: the Halo extension seems to be either unsetting
> > >
> > >     or changing
> > >
> > >     >     > the value of the "$smwgDefaultStore" variable, which SD
> >
> > relies
> >
> > >     >     on. If
> > >     >
> > >     >     > anyone from Halo is reading this, please be aware of the
> > >     >     > bug.
> > >     >     >
> > >     >     > -Yaron
> >
> > ------------------------------------------------------------------------
> >
> >
> >
> >
> > -------------------------------------------------------------------------
> >-----
> >
> > >     >     > Apps built with the Adobe(R) Flex(R) framework and Flex
> > >     >
> > >     >     Builder(TM) are
> > >     >
> > >     >     > powering Web 2.0 with engaging, cross-platform
> > >     >     > capabilities.
> > >     >
> > >     >     Quickly and
> > >     >
> > >     >     > easily build your RIAs with Flex Builder, the
> >
> > Eclipse(TM)based
> >
> > >     >     development
> > >     >
> > >     >     > software that enables intelligent coding and step-through
> > >
> > >     debugging.
> > >
> > >     >     > Download the free 60 day trial.
> > >
> > >     http://p.sf.net/sfu/www-adobe-com
> >
> > ------------------------------------------------------------------------
> >
> > >     >     > _______________________________________________
> > >     >     > Semediawiki-devel mailing list
> > >     >     > Semediawiki-devel@lists.sourceforge.net
> > >
> > >     <mailto:Semediawiki-devel@lists.sourceforge.net>
> > >
> > >     >     <mailto:Semediawiki-devel@lists.sourceforge.net
> > >
> > >     <mailto:Semediawiki-devel@lists.sourceforge.net>>
> >
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
> >
> > >     >     --
> > >     >     Kai Kühn
> > >     >     Professional Services
> > >     >     ontoprise GmbH - know how to use Know-how
> > >     >     ---
> > >     >     ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im
> > >     >     Projekt Halo
> > >     >     http://www.ontoprise.de/index.php?id=33
> > >     >     ---
> > >     >     Amalienbadstraße 36 (Raumfabrik 29); 76227 Karlsruhe
> > >     >     Tel.: +49 (0) 721 509 809 48; Fax: +49 (0) 721 509 809 11
> > >     >     eMail: kuehn@ontoprise.de <mailto:kuehn@ontoprise.de>
> > >
> > >     <mailto:kuehn@ontoprise.de <mailto:kuehn@ontoprise.de>>;  www:
> > >     >     http://www.ontoprise.de
> > >     >     Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 109540
> > >     >     Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing.
> > >
> > >     Hans-Peter
> > >
> > >     >     Schnurr
> >
> > -------------------------------------------------------------------------
> >-----
> >
> > >     >     Apps built with the Adobe(R) Flex(R) framework and Flex
> > >     >     Builder(TM) are
> > >     >     powering Web 2.0 with engaging, cross-platform capabilities.
> > >     >     Quickly and
> > >     >     easily build your RIAs with Flex Builder, the
> > >     > Eclipse(TM)based development
> > >     >     software that enables intelligent coding and step-through
> > >
> > >     debugging.
> > >
> > >     >     Download the free 60 day trial.
> > >
> > >     http://p.sf.net/sfu/www-adobe-com
> > >
> > >     >     _______________________________________________
> > >     >     Semediawiki-devel mailing list
> > >     >     Semediawiki-devel@lists.sourceforge.net
> > >
> > >     <mailto:Semediawiki-devel@lists.sourceforge.net>
> > >
> > >     >     <mailto:Semediawiki-devel@lists.sourceforge.net
> > >
> > >     <mailto:Semediawiki-devel@lists.sourceforge.net>>
> > >
> > >     >
> > >     > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
> > >
> > >     --
> > >     Kai Kühn
> > >     Professional Services
> > >     ontoprise GmbH - know how to use Know-how
> > >     ---
> > >     ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im
> > >     Projekt Halo
> > >     http://www.ontoprise.de/index.php?id=33
> > >     ---
> > >     Amalienbadstraße 36 (Raumfabrik 29); 76227 Karlsruhe
> > >     Tel.: +49 (0) 721 509 809 48; Fax: +49 (0) 721 509 809 11
> > >     eMail: kuehn@ontoprise.de <mailto:kuehn@ontoprise.de>;  www:
> > >     http://www.ontoprise.de
> > >     Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 109540
> > >     Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter
> > >     Schnurr
> >
> > -------------------------------------------------------------------------
> >-----
> >
> > >     Apps built with the Adobe(R) Flex(R) framework and Flex
> > >     Builder(TM) are
> > >     powering Web 2.0 with engaging, cross-platform capabilities.
> > >     Quickly and
> > >     easily build your RIAs with Flex Builder, the Eclipse(TM)based
> > >     development
> > >     software that enables intelligent coding and step-through
> > > debugging. Download the free 60 day trial.
> > > http://p.sf.net/sfu/www-adobe-com
> > > _______________________________________________
> > >     Semediawiki-devel mailing list
> > >     Semediawiki-devel@lists.sourceforge.net
> > >     <mailto:Semediawiki-devel@lists.sourceforge.net>
> > >     https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
> >
> > --
> > Kai Kühn
> > Professional Services
> > ontoprise GmbH - know how to use Know-how
> > ---
> > ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt
> > Halo http://www.ontoprise.de/index.php?id=33
> > ---
> > Amalienbadstraße 36 (Raumfabrik 29); 76227 Karlsruhe
> > Tel.: +49 (0) 721 509 809 48; Fax: +49 (0) 721 509 809 11
> > eMail: kuehn@ontoprise.de;  www: http://www.ontoprise.de
> > Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 109540
> > Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter
> > Schnurr
> >
> >
> >
> > -------------------------------------------------------------------------
> >----- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
> > are powering Web 2.0 with engaging, cross-platform capabilities. Quickly
> > and easily build your RIAs with Flex Builder, the Eclipse(TM)based
> > development software that enables intelligent coding and step-through
> > debugging. Download the free 60 day trial.
> > http://p.sf.net/sfu/www-adobe-com
> > _______________________________________________
> > Semediawiki-devel mailing list
> > Semediawiki-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    markus@semantic-mediawiki.org