Hello,

I have tested the great new RDF store binding of SMW with Open Virtuoso.
Here some notes about it:

* I have used a Windows pre-built version of Open Virtuoso (Version:
06.01.3127, Build: Mar 30 2011) [1]
* No much was needed for the configuration. The template virtuoso.ini worked
for me.
* One needed to give sparql update rights to the sparql user of Open
Virtuoso. 
* In SMW, the corresponding setting for LocalSetting.php was:

<pre>
# Triple Store
$smwgDefaultStore = 'SMWSparqlStore';
$smwgSparqlDatabase = 'SMWSparqlDatabase';
// The following should be set to the URLs to reach the store:
$smwgSparqlQueryEndpoint = 'http://localhost:8890/sparql';
$smwgSparqlUpdateEndpoint = 'http://localhost:8890/sparql';
$smwgSparqlDataEndpoint = ''; // can be empty
</pre>

* However, this does not work directly: some problems came up and I needed
to add work-arounds. 
* Open Virtuoso HTTP interface either needs a default graph setting
(default-graph-uri) or needs to indicate the graph in the SPARQL query.
Therefore I added "IN GRAPH <http://localhost:8890/DAV>" or "FROM GRAPH
<http://localhost:8890/DAV>" in certain places to SMW_SparqlDatabase.php
(file attached).
* Also, Open Virtuoso HTTP interface does not use "insert" POST parameter
but "query" for both doQuery and doUpdate, so I changed the parameter,
accordingly.
* This seems to work. I created an annotated page and successfully queried
it using an ask query. 
* In order to better test the functionality, I have used the SMW system
tests [2], which we have been working on lately. The tests will be published
soon and the documentation updated. 
* Just to give a short overview of which might not be working with Open
Virtuoso at the moment, here a list of the test cases' output. Apparently,
we have problems with subproperties at Special:Ask and problems with
SearchByProperty:

<pre>
Testsuite SMWSeleniumTestSuite started.
Testsuite AvoidPropertyCreationTestCase started.
Testing testSetup ... OK
Testing testTest ... OK
Testing testTeardown ... OK
Testsuite AvoidPropertyCreationTestCase ended.
 OK: 3 Failed: 0
Testsuite CreatePropertyPageTestCase started.
Testing testSetup ... OK
Testing test_checkfactbox_CreatePropertyPage ... OK
Testing test_checkpropertypages_CreatePropertyPage ... OK
Testing test_redlink_CreatePropertyPage ... OK
Testing testTeardown ... OK
Testsuite CreatePropertyPageTestCase ended.
 OK: 5 Failed: 0
Testsuite DefineAllowedValuesTestCase started.
Testing testSetup ... OK
Testing test_checkmaybe_DefineAllowedValues ... OK
Testing test_checktooltip_DefineAllowedValues ... OK
Testing test_checkyes_DefineAllowedValues ... OK
Testing testTeardown ... OK
Testsuite DefineAllowedValuesTestCase ended.
 OK: 5 Failed: 0
Testsuite DefineTypeOfPropertyTestCase started.
Testing testSetup ... OK
Testing test_hastype_DefineTypeOfProperty ... OK
Testing test_verifynolink_DefineTypeOfProperty ... OK
Testing testTeardown ... OK
Testsuite DefineTypeOfPropertyTestCase ended.
 OK: 4 Failed: 0
Testsuite MakePropertySubpropertyOfAnotherOneTestCase started.
Testing testSetup ... OK
Testing test_factbox_MakePropertySubpropertyOfAnotherOne ... OK
Testing test_semanticsearch_MakePropertySubpropertyOfAnotherOne ... Error
Testing testTeardown ... OK
Testsuite MakePropertySubpropertyOfAnotherOneTestCase ended.
 OK: 3 Failed: 1
Testsuite PropertiesListedOnSpecialPageTestCase started.
Testing testSetup ... OK
Testing test_linkspresent_PropertiesListedOnSpecialPage ... OK
Testing test_numberofusage_PropertiesListedOnSpecialPage ... OK
Testing test_textpresent_PropertiesListedOnSpecialPage ... OK
Testing test_tooltipicon_PropertiesListedOnSpecialPage ... OK
Testing test_unusedpropertynotpresent_PropertiesListedOnSpecialPage ... OK
Testing testTeardown ... OK
Testsuite PropertiesListedOnSpecialPageTestCase ended.
 OK: 7 Failed: 0
Testsuite PropertyTypePageIsDefaultTestCase started.
Testing testSetup ... OK
Testing test_checkpropertylist_PropertyTypePageIsDefault ... OK
Testing test_verifylink_PropertyTypePageIsDefault ... OK
Testing testTeardown ... OK
Testsuite PropertyTypePageIsDefaultTestCase ended.
 OK: 4 Failed: 0
Testsuite SearchByPropertyWithNumericValueTestCase started.
Testing testSetup ... OK
Testing testTest ... Error
Testing testTeardown ... OK
Testsuite SearchByPropertyWithNumericValueTestCase ended.
 OK: 2 Failed: 1
Testsuite SearchByPropertyWithStringValueTestCase started.
Testing testSetup ... OK
Testing testTest ... Error
Testing testTeardown ... OK
Testsuite SearchByPropertyWithStringValueTestCase ended.
 OK: 2 Failed: 1
Testsuite ShowFactboxTestCase started.
Testing testSetup ... OK
Testing testTest ... OK
Testing testTeardown ... OK
Testsuite ShowFactboxTestCase ended.
 OK: 3 Failed: 0
Testsuite UnusedPropertiesOnSpecialPageTestCase started.
Testing testSetup ... OK
Testing test_propertyused_UnusedPropertiesOnSpecialPage ... OK
Testing test_propertynotused_UnusedPropertiesOnSpecialPage ... OK
Testing testTeardown ... OK
Testsuite UnusedPropertiesOnSpecialPageTestCase ended.
 OK: 4 Failed: 0
Testsuite WantedPropertiesOnSpecialPageTestCase started.
Testing testSetup ... OK
Testing test_numberofuses_WantedPropertiesOnSpecialPage ... Error
Testing test_showsproperty_WantedPropertiesOnSpecialPage ... Error
Testing testTeardown ... OK
Testsuite WantedPropertiesOnSpecialPageTestCase ended.
 OK: 2 Failed: 2
Testsuite SMWSeleniumTestSuite ended.
</pre>

* Without using the Open Virtuoso SPARQL endpoint, only one test case showed
errors. Apparently, the wanted properties special page does not work:

<pre>
Testsuite WantedPropertiesOnSpecialPageTestCase started.
Testing testSetup ... OK
Testing test_numberofuses_WantedPropertiesOnSpecialPage ... Error
Testing test_showsproperty_WantedPropertiesOnSpecialPage ... Error 
Testing testTeardown ... OK
Testsuite WantedPropertiesOnSpecialPageTestCase ended. OK: 2 Failed: 2
</pre>

I hope this gives you some hints of what code changes would be needed to
make Open Virtuoso work for SMW. Also, it gives you an example of where SMW
system tests are useful.

Best,

Benedikt

PS: Sesame 2.4 has got SPARQL update support, also [3]. Anyone already
having experiences to share, here?

[1]
http://heanet.dl.sourceforge.net/project/virtuoso/virtuoso/6.1.3/virtuoso-op
ensource-win32-20110330.zip 
[2] http://www.semantic-mediawiki.org/wiki/SMW_System_Testing_with_Selenium 
[3]
http://jeenbroekstra.blogspot.com/2011/05/sesame-240-with-sparql-11-query-su
pport.html

--
AIFB, Karlsruhe Institute of Technology (KIT)
Phone: +49 721 608-47946 
Email: benedikt.kaemp...@kit.edu
Web: http://www.aifb.kit.edu/web/Hauptseite/en 



-----Original Message-----
From: Markus Krötzsch [mailto:mar...@semantic-mediawiki.org] 
Sent: Monday, April 25, 2011 9:28 PM
To: Markus Krötzsch
Cc: Semantic MediaWiki developers
Subject: Re: [SMW-devel] New RDF store binding

On 22/04/11 12:37, Markus Krötzsch wrote:
> I am happy to announce that SMW now natively supports data
> synchronization with any SPARQL-capable RDF store. This email explains
> how this works, what the status is, and how interested users can test it
> with their own wikis and triples stores.
>
> It would be helpful if interested users could test the synchronization
> with their favourite stores (Virtuoso anybody?). Details are in the
> testing section below.

The implementation in SVN now also includes initial support for #ask via 
SPARQL. It still lacks support for ordering, counting, and some query 
features (concepts, namespace restrictions, special property queries, 
category/property hierarchies). The rest should work (although, 
unfortunately, 4Store crashes on some queries and yields wrong results 
on others; would be interested to see how Virtuoso does there).

Cheers,

Markus


>
>
>
> = Detailed Information =
>
>
> == Status ==
>
> The feature is part of the current SMW SVN trunk. This code is still
> unstable due to major internal changes that the new functions required.
> It is not recommended to use this code yet on sites that are used
> productively. In particular, SMW extensions may be break and sporadic
> errors may occur. The type Record is currently disabled. I will send
> another email later for extension developers.
>
>
> == Upgrade and Downgrade ==
>
> You can install the SVN version as usual. Running the setup
> (Special:SMWAdmin or SMW_setup.php script) is recommended. this deletes
> some data. Switching back to SMW 1.5.* rthen would require running setup
> again (to avoid errors), and doing a full data refresh (to make all
> stored data available again).
>
> You need Curl to be enabled in PHP for the SPARQL connection. This might
> require an additional package for you PHP distribution (in Linux). There
> are no other dependencies (in particular, we do not use ARC or any other
> PHP library for SPARQL support).
>
>
> == Setting up a SPARQL store ==
>
> SMW can synchronize its data with any SPARQL-capable store. This should
> work reliably for all editing operations, including page deletions and
> updates. To enable this in SMW, you must (obviously) have a running RDF
> store. Then add the following lines to your LocalSettings.php (after
> loading SemanticMediaWiki.php):
>
> $smwgDefaultStore = 'SMWSparqlStore';
> $smwgSparqlDatabase = 'SMWSparqlDatabase';
> $smwgSparqlQueryEndpoint = 'http://localhost:8080/sparql/';
> $smwgSparqlUpdateEndpoint = 'http://localhost:8080/update/';
> $smwgSparqlDataEndpoint = 'http://localhost:8080/data/';
>
> The last three lines should be the URLs under which your store provides
> its various services. The query endpoint is for read queries, the update
> endpoint is for SPARQL Update, the optional data endpoint is for the
> SPARQL HTTP Graph Management Protocol. You can set the data endpoint to
> '' if you do not want to use this service (anything that it does can
> also be done via SPARQL Update, but the simpler HTTP Protocol might be
> faster). Also, the code for the HTTP Protocol might be specific to
> 4Store, so it could be necessary to set it to '' if you use another store.
>
> This should suffice to make all your page edits to be mirrored in the
> default graph of your RDF store. The current implementation does not
> distinguish graphs yet, so you can only add to the default graph. You
> can try storing a page to see if it works. The URIs used in the store
> are the same as in the RDF you get via Special:ExportRDF. If this works,
> you can start a data update (Special:SMWAdmin) or run the update script
> (SMW_refreshData.php) to add all data to the store.
>
>
> == Testing and Contributing ==
>
> We want to support as many RDF stores as possible, and contributions are
> welcome. At the current stage, errors should be apparent in the above
> refreshing/updating stage (ideally done on the command line to see the
> output for all pages).
>
> Our current error handling is not extensively tested. Some errors are
> ignored silently (especially connection errors that appear to be
> temporary) while others are reported. If you find that the updates go
> not as expected, then please insert the following code into your
> LocalSettings.php:
>
> $wgExtensionFunctions[] = 'runSparqlTests';
> function runSparqlTests() {
>       $sdb = smwfGetSparqlDatabase();
>       print " Ping (query): " . ( $sdb->ping(
> SMWSparqlDatabase::EP_TYPE_QUERY ) ? 'yes' : 'no' ) . "\n";
>       print " Ping (update): " . ( $sdb->ping(
> SMWSparqlDatabase::EP_TYPE_UPDATE ) ? 'yes' : 'no' ) . "\n";
>       print " Ping (data): " . ( $sdb->ping(
SMWSparqlDatabase::EP_TYPE_DATA
> ) ? 'yes' : 'no' ) . "\n";
> }
>
> This tries to ping the services that you specified and dumps the result
> to the output (obviously, this should only be done on test sites).
>
> Developers are welcome to have a look at the code in
> ./includes/sparql/SMW_SparqlDatabase.php. This file realizes all basic
> communication via SPARQL, independent from the concrete RDF/SPARQL that
> is used in SMW. It can be used to issue arbitrary SPARQL queries.
> Compare it to MediaWiki's Database class. Special adjustments to
> individual stores (e.g. using some proprietary feature for COUNT
> queries) will be realized by subclassing SMWSparqlDatabase. Such
> subclasses could also use PHP APIs to communicate with a store. So
> developers who wish to contribute to the SMW triple store support would
> mostly work with this code. Likewise, extension developers who want to
> use SPARQL would typically talk to this code.
>
> The "sparql" directory also contains a SPARQL XML result parser and a
> container for representing them in PHP. Code that uses SPARQL never will
> be bothered with XML or other result formats. The internal presentation
> of URIs and literals is done with the objects in
> ./export/SMW_ExpElement.php. These objects will also provide a mapping
> back to wiki data, soon, to enable further processing in higher levels.
>
>
> == What is next? ==
>
> I will proceed to fully enable SPARQL-based #ask to replace the current
> SQL implementation. This will happen within the next few days. The RDF
> data stored by SMW has changed slightly and will further change,
> typically by adding more information that was currently missing. For
> example, redirects and sortkeys are now stored in RDF because they are
> needed for #ask.
>
> In the medium run, one could further move most/all storage activities
> from SQL to SPARQL. Currently, the SMWSparqlStore is a subclass of the
> SMWSQLStore2, so it keeps the whole SQL database underneath as before.
> With SPARQL becoming stable, this could be changed (or a mixed approach
> could be chosen that combines the strengths of SQL and SPARQL).
> Developers who are interested in this are also welcome to help.
>
>
>
>
----------------------------------------------------------------------------
--
> Fulfilling the Lean Software Promise
> Lean software platforms are now widely adopted and the benefits have been
> demonstrated beyond question. Learn why your peers are replacing JEE
> containers with lightweight application servers - and what you can gain
> from the move. http://p.sf.net/sfu/vmware-sfemails
> _______________________________________________
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>


----------------------------------------------------------------------------
--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to