Can SPARQL be fun? Explore & query with vinge tutorial

37
Explore & Query Tutorial © 2013 Vinge Free AB, Sweden

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

Page 1: Can SPARQL be fun? Explore & query with vinge   tutorial

Explore & QueryTutorial

© 2013 Vinge Free AB, Sweden

Page 2: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 3: Can SPARQL be fun? Explore & query with vinge   tutorial

The goal is to write the SPARQL query

© 2013 Vinge Free AB, Sweden

Page 4: Can SPARQL be fun? Explore & query with vinge   tutorial

Your options1. Start typing in SPARQL editor

© 2013 Vinge Free AB, Sweden

What are the options?

Page 5: Can SPARQL be fun? Explore & query with vinge   tutorial

Your options

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

© 2013 Vinge Free AB, Sweden

Page 6: Can SPARQL be fun? Explore & query with vinge   tutorial

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!”

Page 7: Can SPARQL be fun? Explore & query with vinge   tutorial

List of search results

Select Harald_Schumacher and enter the Linked Data browser

© 2013 Vinge Free AB, Sweden

Page 8: Can SPARQL be fun? Explore & query with vinge   tutorial

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

© 2013 Vinge Free AB, Sweden

Page 9: Can SPARQL be fun? Explore & query with vinge   tutorial

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

© 2013 Vinge Free AB, Sweden

Page 10: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 11: Can SPARQL be fun? Explore & query with vinge   tutorial

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

so it is relevant - add it ...

© 2013 Vinge Free AB, Sweden

Page 12: Can SPARQL be fun? Explore & query with vinge   tutorial

Data model being revealed

© 2013 Vinge Free AB, Sweden

Time to filter 40,000 seats ...

Page 13: Can SPARQL be fun? Explore & query with vinge   tutorial

Data model being revealedTime to set the filter ...

© 2013 Vinge Free AB, Sweden

Page 14: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 15: Can SPARQL be fun? Explore & query with vinge   tutorial

You can test your generalizationThe SPARQL query is generated and executed

© 2013 Vinge Free AB, Sweden

Page 16: Can SPARQL be fun? Explore & query with vinge   tutorial

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

© 2013 Vinge Free AB, Sweden

Page 17: Can SPARQL be fun? Explore & query with vinge   tutorial

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

© 2013 Vinge Free AB, Sweden

Page 18: Can SPARQL be fun? Explore & query with vinge   tutorial

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

© 2013 Vinge Free AB, Sweden

Page 19: Can SPARQL be fun? Explore & query with vinge   tutorial

Now we only have goalies in the result set.

Explore more - identify goalkeepers

© 2013 Vinge Free AB, Sweden

Page 20: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 21: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 22: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 23: Can SPARQL be fun? Explore & query with vinge   tutorial

Harald Schumacher was born in Düren

Replay

© 2013 Vinge Free AB, Sweden

Page 24: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Replay

© 2013 Vinge Free AB, Sweden

Page 25: Can SPARQL be fun? Explore & query with vinge   tutorial

Düren is in Germany.

Replay

© 2013 Vinge Free AB, Sweden

Page 26: Can SPARQL be fun? Explore & query with vinge   tutorial

Germany is a Country.

Replay

© 2013 Vinge Free AB, Sweden

Page 27: Can SPARQL be fun? Explore & query with vinge   tutorial

There is a population attribute for Germany.

Replay

© 2013 Vinge Free AB, Sweden

Page 28: Can SPARQL be fun? Explore & query with vinge   tutorial

Add filter to population.

Replay

© 2013 Vinge Free AB, Sweden

Page 29: Can SPARQL be fun? Explore & query with vinge   tutorial

Navigation Map to answer the initial question.

Replay

© 2013 Vinge Free AB, Sweden

Page 30: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 31: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 32: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 33: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 34: Can SPARQL be fun? Explore & query with vinge   tutorial

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

Page 35: Can SPARQL be fun? Explore & query with vinge   tutorial

The answer to the initial question

© 2013 Vinge Free AB, Sweden

Wow!

Page 36: Can SPARQL be fun? Explore & query with vinge   tutorial

with Sgvizler

And why not to do more ...

© 2013 Vinge Free AB, Sweden

Page 37: Can SPARQL be fun? Explore & query with vinge   tutorial

© 2013 Vinge Free AB, Sweden

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