can sparql be fun? explore & query with vinge tutorial
Post on 14-Dec-2014
21.668 Views
Preview:
DESCRIPTION
TRANSCRIPT
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
top related