Virtuoso and LODRefine – viciously virtuous pair (part 1)

Disclaimer

I’m assuming that you :

  • are familiar with the notion of linked data (triples, SPARQL endpoints)
  • have heard about Virtuoso Universal Server,
  • want to give LODRefine a chance and,
  • don’t mind waiting for part 2 of this post.

The beginning…

They: “We want to upload triples directly from LODRefine to Virtuoso.
Me: “A wha?

… and the (almost) joke

A Virtuoso, SPARQL, and SPARUL enter the bar.
Bartender: “Hey guys, what can I get you?
They: “Select ?drink where {?drink <http://www.w3.org/1999/02/22-rdf-syntax-ns#label “Martini (Coctail)” }
Bartender (puzzled): “Gesundheit!? 

But seriously!

If you are familiar with LODRefine, then you know you can transform your data to triples using RDF extension (thanks to Fadi Richard from DERI!). Now what? You can export triples to file and then upload this file to some triple store.

Imagine you could insert triples directly from LODRefine. Guess what? This is exactly what I’m working on right now. Yay me! :)

I started with installing Virtuoso Open-Source Edition (OS X 10.7) and (fortunately) had no problems building, configuring and installing it according to the instructions. After adding SPARQL_UPDATE rights to the SPARQL user I was ready to insert some triples. And I did… insert some triples via /sparql endpoint. Lovely!

At this point (not endpoint) I learned about SPARUL (could be a name of a villain in the next Batman movie) and figured out how to delete all named graphs containing a specific substring in their name. Why I wanted to do this? Because I installed demo, sparql demo and what-not … and shortly after realized I would be much happier person without all these graphs in my virtuoso instance and that I don’t want to click on each and every one of them to remove them.

[In Vonnegut’s  Breakfast of Champions style…]

This is how you can remove all the graphs containing specific substring in IRI:


DELETE {GRAPH ?g {?s ?p ?o}} 
WHERE {
   GRAPH ?g {?s ?p ?o}  
   FILTER( contains(str(?g), "your substring here"))
}

Level 1: install instance of Virtuoso locally finished.

Next level: add “Upload data to triplestore” to LODRefine…

 

 

Enhanced by Zemanta