Samuel Lampa's blog

Even nicer with more prefixes

 

Ok, even nicer now ... after allowing to introduce custom namespace prefixes also with '?' and '=' as separators (Don't know if that is valid for QNames though? Anyone knows?) than before (blog post 1, and post 2):

Code (see code repo) is still quite ugly though. Just typed together to get things working. Will look at structuring things more as soon as I have slept a little better :)

I also got to think of these random issues, which is foremost questions to myself, that might not be fully thought-through yet, but jotting them down here for possible feedback (hoping it's readable ^^):

  • Imports will have to be done according to a special "mapping configuration", so that the same config can be used on import and export, if wanted. Such a config should be generated on import based on the RDF namespaces used. It should also be manually expandable with a prioritized list of properties (like dc:title) to use as substitute for URIs. Maybe it could be stored in a (timestamped?) wiki article?
  • When using "natural language" substitutes for URI:s, such as "dc:title", one has to put a property such as swivt:originalURI or similar into the page, so that it can be exported again with its original URI (or there is already the swivt:importedFrom (or sth like that...) ... is it better to use that?
  • The SPARQL endpoint will need to be accessed according to the same kinds of mapping configs if the wiki should be able to be queried in the same format as the import data ...

Using RDF namespace prefixes in wiki titles

 

As you might have seen in my previous blog post, using the full RDF URI:s as wiki titles on importing, is not optimal. I now managed to use the RDF namespace prefixes submitted on import time, to make titles nicer. Definitely improves things a bit. At least all properties are not all treated as the same as in the previous blog post for example.

But, also still a bit to go. Not all URI:s have prefixes, and for some things you would probably want to use the corresponding dc:title or similar instead of an abbreviated URI, etc.

 

Populating SMW from RDF/XML (First test)

I now managed, (using ARC2 and SMWWriter, in a MediaWiki extension) to populate Semantic MediaWiki pages with triples, from a snippet of RDF/XML (Thanks to Egon Willighagen for the RDF-ized NMRShiftDB data, submitted further below), yay! But ... as you can see, using the full URI:s as wiki names is not a good idea. URI:s as wiki titles is ugly ... and the predicates in this case even got truncated and all treated as the same one, since they had hashes in it, which MediaWiki obviously doesn't allow in titles), so that's the whole background for our talking so much about the "equivalent URI handler" (mentioned here for example), which is thought to be a configurable handler of mappings from URI patterns to (sensible) wiki titles. Also, optimally the same pattern can then be used both on import and export so that the format is kept, allowing to use SMW as a (collaborative) RDF editor! (which is one of the main motivations for my GSoC project).

Well, the hard bits (URI -> Wiki title mapping) remains. Diving in to it now ...

SMWRDFConnector Architecture - mental picture

This is my current mental picture of the architecture of the parts included in the RDF import/export functionality I'm implementing for Semantic MediaWiki as part of my Google summer of code project. I just got the ARC2 based store functional. The functionality still to be implemented in "dashed" lines:

 - - - - -   - - - - -
 | Export |  | Import |   
 - - - - -   - - - - -
      ^          |     
      |          v     
  - - - - - - - - - -   ---------------
 | Equiv URI handler |->|  SMW Writer |
  - - - - - - - - - -   ---------------
          ^                   |
          |                   v
 ---------------------  ---------------
 | SPARQL+ Interface |  |     SMW     |
 ---------------------  ---------------
          ^        ______/    |
          |       v           v
  -----------------     ----------------
  |  ARC2 Store   |     | MediaWiki DB |
  -----------------     ---------------- 

Working ARC2 RDF Store connector committed

Now I have a working RDF Store connector for Semantic MediaWiki, that uses ARC2:s RDF store, rather than SMW:s built-in store. This will allow to take advantage of functionality in ARC2, such as possibility to set up a SPARQL endpoint etc.

Thanks to Alfredas Chmieliauskas for the Joseki store connector in the SparqlExtension for SMW, which this connector is heavily based upon.

The ARC2 connector implements the same amount of the SMWStore API as the JosekiStore, but I'm not yet sure if more needs to be implemented, for the things we want to do (general RDF import/export). Gotta figure that out.

The code is available in the google code repository trunk, and install instructions on the gcode wiki.

Feel free to try it out, but be warned that it has been only very briefly much tested at all yet!

Back on track GSoC:ing

Back on track GSoC:ing. Follow progress at my twitter.

Tags:

Thesis presentation done

I presented my MSc thesis project "SWI-Prolog as a Semantic Web tool for semantic querying in Bioclipse" today. (Report for download here

Find the slides below. I expected a very non-informatics audience (though some of my fellow Bioclipse:rs showed up =) ), had only 20 minutes, and lots of non-common-knowledge things to introduce, so these are really mostly a bunch of pictures for talking through the basics of semantic web, prolog and Bioclipse.

Turning back to the GSoC project now!

GSoC project started

Have started actual coding for GSoC this wednesday (start was 2 weeks delayed because of exams, which I'll catch up). Still just getting up to speed, but looking now into the PHP RDF framework ARC, whose RDF store will replace the currently used RAP store in Semantic Mediawiki. Usage ARC itself looks very straightforward. Just have to figure out the SMW Store API. Looking at the SMWRapStore2.php now, to get an idea.

If you want to follow my progress in (approximate) real-time, then see my twitter.

Report approved - preliminary version for download

My degree project, titled "SWI-Prolog as a Semantic Web tool for semantic querying in Bioclipse" is getting closer to finish. Now my report is approved by the Scientific Reviewer (thanks, Prof. Mats Gustafsson), so I wanted to make it available here (Download PDF). Reports on typos are welcome of course! :)