Howdy
I'm a new user of SMW, and would love to assist with development however I
can. Currently, I'm writing a simple extension to integrate (as a special
page) the rdfapi-php netapi SPARQL endpoint. I've succeeded in configuring
the netapi endpoint (and wouldn't mind working on some of the documentation
regarding that). Additionally, my extension is working (though somewhat
incomplete) and I'd love to make it available to the community soon.
I wanted to make note of two issues that effect my projects, and could
potentially cause issues for others. The first involves the
'enableSemantics' function in SMW_GlobalFunctions.php when a full domain is
provided, and how it effects the behavior of initBaseURIs in
SMW_Exporter.php.
For example:
LocalSettings.php:
enableSemantics('https://example.com/testwiki/index.php/', true);
When initBaseURIs is called, and the following block of code is processed:
if (''==$smwgNamespace) {
$resolver = Title::makeTitle( NS_SPECIAL,
'URIResolver');
$smwgNamespace = $resolver->getFullURL() . '/';
}
if ($smwgNamespace[0] == '.') {
$resolver = Title::makeTitle( NS_SPECIAL,
'URIResolver');
$smwgNamespace = "http://" . substr($smwgNamespace,
1) . $resolver->getLocalURL() . '/';
}
The condition in which $smwgNamespace represents a full domain is not
handled at all. My workaround was to use the first if statement as an else
block for the second if statement.
if ($smwgNamespace[0] == '.') {
$resolver = Title::makeTitle( NS_SPECIAL,
'URIResolver');
$smwgNamespace = "http://" . substr($smwgNamespace,
1) . $resolver->getLocalURL() . '/';
} else {
$resolver = Title::makeTitle( NS_SPECIAL,
'URIResolver');
$smwgNamespace = $resolver->getFullURL() . '/';
}
This way, the Special:URIResolver segment is still appended properly.
My second issue was with the model and base URI creation mechanism in
SMW_RAPStore2.php (and SMW_RAPStore.php). If you're running a wiki with a
script path, shouldn't this be attached to the model/base URIs? (I'm new to
the semantic web, so my apologies if this is a misunderstanding on my part)
To get what I wanted here (the script path appended to the URI), I made the
following changes:
includes/storage/SMW_RAPStore2.php:
public function SMWRAPStore2() {
global $smwgRAPPath,$wgServer, $wgScriptPath; // <-- Added
$wgScriptPath
// Modified uri building procedure to include script path.
$this->modeluri = SMWExporter::expandURI($wgServer .
$wgScriptPath . "/model");
$this->baseuri = SMWExporter::expandURI($wgServer .
$wgScriptPath . "/id");
}
This way http://example.com/wiki1 and http://example.com/wiki2 don't have
the same model uri (which may be annoying even if they aren't sharing a RAP
database).
Please let me know if anything I've mentioned here is asinine or does not
belong on this mailing list.
Thanks,
Jason Lawrence
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel