Can SPARQL be fun? Explore & query with vinge tutorial

Post on 14-Dec-2014

21.663 views 0 download

description

If you or your team write SPARQL queries and are sometimes wondering if there is a query builder which allows you to overcome two major obstacles why non-programmer people aren’t querying Linked Data, namely 1. hard to understand what data is available, how the classes and properties are named, what the relations are 2. demand to know SPARQL language syntax and whole concept of triple based binding and graph matching then you perhaps would like to check out what Vinge Free has come up with. We have launched a Free Edition of a new kind of Linked Data Browser which we call “Explore & Query”. It is available for download and there are two videos that demonstrate the tool in action. http://www.vingefree.com/querybyexplore/ On a nutshell it is a combination of a Linked Data browser and a Query Builder. It allows to explore and reveal data models; build, visualize and execute SPARQL queries. So essentially while you are navigating in the linked data graph, the tool builds the query for you. On any graph. Regardless how expressive is the ontology or if it is even published. And it is fun! The tool works over any SPARQL endpoint using HTTP binding, which means it runs on top of any triple store. Next slideshare on Explore&Query topic: http://www.slideshare.net/JrgenKerstna/failing-fast-with-explorequery

Transcript of Can SPARQL be fun? Explore & query with vinge tutorial

Explore & QueryTutorial

© 2013 Vinge Free AB, Sweden

Find in DBpedia (Wikipedia content)

All soccer players, who played as goalkeeper for a club that has a stadium with more than 40.000 seats and who are born in a country with more than 10 million inhabitants … and who has also scored

© 2013 Vinge Free AB, Sweden

The goal is to write the SPARQL query

© 2013 Vinge Free AB, Sweden

Your options1. Start typing in SPARQL editor

© 2013 Vinge Free AB, Sweden

What are the options?

Your options

2. Use visual Explore & Query by Vingewhich is downloadable fromhttp://www.vingefree.com/querybyexplore

© 2013 Vinge Free AB, Sweden

Where to start?You have 3 options for how to get in there:● By searching for instances of things you know should exist in the data. This

is a free text search, like Google. From hit list select one instance and start browsing relations and explore the model.

● Searching for concept or class of instances, then selecting one class and listing the instances of it. Select one instance and start exploring.

● Combination of the two above - to limit the text search within the concept and dataset.

© 2013 Vinge Free AB, Sweden

“I remember the German goalkeeper Harald Schumacher”

“Soccer player is the main concept in my query!”

List of search results

Select Harald_Schumacher and enter the Linked Data browser

© 2013 Vinge Free AB, Sweden

Explore the dataSelect the type and properties of interest: add or navigate to

© 2013 Vinge Free AB, Sweden

Data model being revealedNavigate to FC Bayern München where he played.

© 2013 Vinge Free AB, Sweden

Data model being revealedBy default the club relation is not restricted, it can be anything.To limit the query to only soccer clubs add specific typei.e. SoccerClub in this case.

© 2013 Vinge Free AB, Sweden

Data model being revealedCapacity seems to mean # of seats on the stadium,

so it is relevant - add it ...

© 2013 Vinge Free AB, Sweden

Data model being revealed

© 2013 Vinge Free AB, Sweden

Time to filter 40,000 seats ...

Data model being revealedTime to set the filter ...

© 2013 Vinge Free AB, Sweden

While Exploring...you have been generalizing.

The graph that matches Harald Schumacher is applied to match similar “things” described by same properties and relations.

© 2013 Vinge Free AB, Sweden

You can test your generalizationThe SPARQL query is generated and executed

© 2013 Vinge Free AB, Sweden

Explore more - identify goalkeepersThe “position” attribute seems to contain this information.

© 2013 Vinge Free AB, Sweden

Explore more - identify goalkeepersFacet is inferred on the fly. Select from it.

© 2013 Vinge Free AB, Sweden

Explore more - identify goalkeepersAnd that was a bit of the guesswork...

© 2013 Vinge Free AB, Sweden

Now we only have goalies in the result set.

Explore more - identify goalkeepers

© 2013 Vinge Free AB, Sweden

Navigate to birth country and filter 10 millionNavigate to goals and set filter >0

The next slide will show the revealed model.

Exercise - finish it up yourself

© 2013 Vinge Free AB, Sweden

Do you see the same graph? Probably not.On the next slide we guess why not...

Navigation Map to answer the initial question

© 2013 Vinge Free AB, Sweden

The country which does not exist todayand does not have population data available.

For not to miss out players from dissolved countries, we navigate via birthplace (i.e. town) that seems to link to their current countries.

Harald Schumacher was born in West Germany

© 2013 Vinge Free AB, Sweden

See how we did it

Harald Schumacher was born in Düren

Replay

© 2013 Vinge Free AB, Sweden

Düren is a Town. But we don’t want to exclude country boys from the query.

Replay

© 2013 Vinge Free AB, Sweden

Düren is in Germany.

Replay

© 2013 Vinge Free AB, Sweden

Germany is a Country.

Replay

© 2013 Vinge Free AB, Sweden

There is a population attribute for Germany.

Replay

© 2013 Vinge Free AB, Sweden

Add filter to population.

Replay

© 2013 Vinge Free AB, Sweden

Navigation Map to answer the initial question.

Replay

© 2013 Vinge Free AB, Sweden

Dealing with bad data in the graph will be the subject on another occasion.In order to answer the exact question - some fine-tuning is needed.

The query to answer the initial question

© 2013 Vinge Free AB, Sweden

In the query editor generate the query and select the columns for result set. Visualize Query to check that the binding graph is connected.

The query to answer the initial q

© 2013 Vinge Free AB, Sweden

This is the view to see what nodes in the graph are selected to the result set table. There must not be disconnected subgraphs or the result set will be a cartesian product of unrelated nodes.

Verify the query graph

© 2013 Vinge Free AB, Sweden

Source data contained multiple attributes for goals if scored for different teams.To get the list of distinct players and total # of goals, the query needs to be fine-tuned in the editor.

Deal with duplicates

© 2013 Vinge Free AB, Sweden

Source data contained multiple attributes for goals if scored for different teams.To get list of distinct players and total # of goals, the query needs to be modified in the interactive and context sensitive editor.

Eventually some SPARQL is needed

© 2013 Vinge Free AB, Sweden

The answer to the initial question

© 2013 Vinge Free AB, Sweden

Wow!

with Sgvizler

And why not to do more ...

© 2013 Vinge Free AB, Sweden

© 2013 Vinge Free AB, Sweden

download fromhttp://www.vingefree.com/querybyexplore