 So part of our workshop was basically editing and adding data to women who educated at the University of Edinburgh and basically our main objective here is to query that data and see it in a new light and visualise it. So we're going to be looking at the basics of using the Wikidata query service. So the whole idea with the query service is that we're basically going to get some data back and that always appears in this select option. So I'm going to say we're looking to select a person and that's just a name I've made up to identify the people and I'll just finish this first part and explain it afterwards because it makes more sense. So inside this where area is where we're actually going to define what is the relation that's going to define this person. So what we're looking for and I'm going to use I'm just going to in a new tab here I'm just going to search for JK Rowling who is one of the notable people and actually I'll just put Wikidata on the end of that. So this is a way you can help to construct your query. You go and find a person of interest or a notable person that should be on those query results and you can often find everything you need. So what we're really looking for first of all is that we want people who are educated at the University of Edinburgh. So I can see there I've got P69 as the property educated at and University of Edinburgh is 160302 is the item number. So we are going to put that relation in. The person that we are selecting needs to have a property P69. Now this WDT is just a prefix that's required for us having a simple way to say so the query service knows that we're talking about this property and if you hover over you can see we've got the right one educated at and to talk about an item we have to give this WD prefix where we can do WD colon and then we can enter an item number and in our case it was Q160302 for the University of Edinburgh. Now this is a basic query we're selecting a person and we have a way of describing what the criteria are to find them. So we're going to run that. Now we get exactly 3,000 results especially exactly 3,000 but there's no reason why that's round. But you can see that it's a very uninteresting set of results because although we do have the item links and you can prove that that is Charles Darwin that has come up, we don't know what they called. So an absolutely critical thing is to find out what are these people called. So we need their labels and to do that the simplest way is to use the Wikidata built-in label service. So doing it from scratch is a bit of a hassle. So normally what I do is I set up a new tab and if you look at this example here the list of countries ordered by the number of their cities with female mayor amazing query in its own right but you can see here that there's this little section is what I want to copy and paste and it's the label service and I'm going to do it until that last bracket. Copy it, I'm going to put it back into our query. You have to make sure that you do it before this last closing bracket. So this is showing everything that's our where clause telling us how everything writes together and it's got to be within there. It doesn't matter spacing all this other stuff does not matter but I'll just tidy it up a little bit. So at the moment we're set to Russian and then English and I'm just going to leave that as English only. Now if I run that query nothing different happens at the moment because we haven't used it and how do we use it? We type the thing that we're trying to find the label of and on the end we add label with a capital L. Now I'm selecting two things the person himself and their label and when I run it you see what that equates to is a new column Charles Darwin and now much more useful we've got some data and we can see who they are. So that's one very simple thing this is just people educated at the University of Edinburgh. We would like to isolate women educated at the University of Edinburgh. So what I'm going to do is go back to JK Rowling's page and on here you'll see sex or gender is female. That's a P21 is the gender and female is this really long Q number 658 1072. So I also want the person to have a P21 a sex or gender of and it's another right. I mean it's the item for female and it's this 658 1072. Rerun the query we've now got only 259 results down from our 3000 but they are all female names as you can see here that means it's worked and so you can see that by adding extra statements in and a point here that every line must end with a full stop it's a bit like ending a sentence you've got to put a full stop on the end. So now we're selecting women educated at the University of Edinburgh which is the that's the set of results I would like to work with but we now want to get more data back let's get some more data on these columns that we've got here. So what I'm interested in here is the place of birth so that's property P19 but in this case so I'm going to do this again bit like the previous lines person WDT P19 but this time we're not putting an item on the end because it's different for everyone and we're going to give it a name so I'm going to say birth place it didn't really matter what I called it as long as I use the same when I select what I want back up here so now I'm selecting birth place and if I run this query I should put a full stop on the end of there it's not needed for the last one but it's good practice to do it all the time so now you'll notice I've got my third column but unfortunately I'm back to just item numbers which is not quite what I was looking for I wanted their names how do we do that well it's as simple as add the capital L label to the end because we've already got the service loaded and now I've got a name instead of an item number so we're getting there we're getting the days for we want now I would love if we could show this on a map but you can see it's grayed out at the moment because we don't we know their birth place but the query does not know where that birth place is yet we need some coordinates okay so I'll go back here well actually we can click on the place just to see if you wanted to find out or how our coordinates presented well here is coordinate location is p65 so this time I'm not starting with person because it's the birth place that I want to know this information about you see it comes up there things I've used before so I can just use that shortcut this time what I want is a I want a p625 sorry p625 but this is now for the birth place not the person so it's another layer we're finding a birth place to a person and then we're finding a coordinate location connected to the birth place so what I'm after I'm going to give us a name and I'm going to call it just coordinates and of course if I run that nothing special is going to happen at all because I didn't select it so you've got to make sure that each time you want something new you select it and so you can see that basically select is where we see what we get back where is where we define how everything's connected to give us back our results so now when I click run we should have and we do a new column with the coordinates and that is what magically brings to life our map option as soon as it's got that data it can plot these results on a map which is far more interesting all of a sudden so we've now got this is women educated at the University of Edinburgh mapped on a map by their birthplace which is already a really interesting result but let's just go a step further just to show that this is actually just you can kind of go on here now I want some more information about about the person another column I'd like to create so I want to this time get back the p 569 which is a date of birth hover over that you can see this date of birth and I'm going to call it birth date okay and I'm also going to select that we'll see now we've now got an additional column showing the birth date and that brings another visualization to life we suddenly have the timeline option has become available on our list so there's a timeline so this is the built-in wiki data query service timeline along with all these other really cool visualizations and I'm going to stop there with constructing the query because we basically that's really what you do when you're making queries there are of course a million more complicated functions you can learn about sparkle but this is the basics is the essence of most queries so what I'm going to do though is show that we can reuse this query in other services and I'm going to just demonstrate the brand new histropedia sparkle query timeline viewer so I'm going to take my query that we've created and I'm just going to paste it in here and how this works is we are going to fill in some mappings there so we're going to say well what do we want to use at the title for the events on our timeline what do we want to use as a start date so I'm going to say title it wants to be this the person label that's what we want on the head of so I'm going to put that in and we leave out the question mark now the wiki data ID is basically the item and actually we I'm going to I'm going to use this and if I put person in here what it gives me is the option to sort of know what the item was and we can double click and open it in there in wiki data which I'll show we've also got what we use for birth date so birth date is what we use for the start now image that's a point we would probably do with that but I'll come to that in a moment we don't need any of the others for the moment I'm just going to do the basics first so now we have the same timeline that we've rendered on the other place but it's now it's now inside the histropedia engine which gives you all the zoom ability and all these other kind of like you know it's a little bit smoother and but we haven't added a lot to this yet let's just go back and put a little bit more magic into it which is that if I just click here and go back to our query we would like an image here and what I'm going to do is I'm just going to add this on because we haven't selected an image but it's as easy as saying person needs to have a needs to have a p19 sorry 18 which is image I'm going to call it image and I'm going to make sure that I select it so we can use it and now on my mappings I'm just going to say that I called this image and when we submit suddenly the timeline comes to life with pretty pictures which makes a lot of difference and we're just going to go one step further we can use our color code by option where we're just going to select another thing in this case we've got birthplace and in fact birthplace label is what I would like to color code by and it's going to group them into groups and so we have to put in a it's good to put in a threshold here and we're saying that we want at least two people before it becomes before it's called a new group as I said these two people have to live in that or have been born in that place so submit now everything's colored now and if I click up here you can see that we can now filter the timeline so we've basically got this color code key automatically generated according to what we've selected and I can filter and look at whichever parts I'm interested in which is really cool so just to show you that this query I'm actually I've got a slightly better it's basically the same query but I've just done some slightly more advanced things just to make it display a little bit better so I'm just going to demonstrate that just to show you you can see it's a much more complicated looking version but you actually will not recognize a lot of the same things like p18 image person has to have a birthday and I'm going to I've got some mapped variables here already and but this time we did color coding by birthplace so I'm going to this time do country because in this query I'm also selecting their country of citizenship so as long as it's there we can color code by it now you another thing about this query why it's a little bit more complicated I've also ranked things so you get the more important quorum quote people at the front basically the ones that have the most articles so and if I bring up the color code you can see we're actually now color coding by by country an interesting thing here is if you click on the no value these are all of the people that have no country listed on their item at all so they haven't got a country of citizenship this is dates but it's missing it should be added so if I open up this woman here with a double click that's taken me to the item and as you can see here we are missing a country of citizenship I don't know if it's going to be easy for us to find that now but you can see the idea we'd find it rerun the query and she would be she would be categorized where she should be so basically that really outlines what you can do with the how to build a basic query and how to then use it in this other service of course this is just one example there are a million other places where your query could be used and new tools sprouting up all the time so it's well worth learning how to sparkle query beauty of wiki data is the fact that you know we can call upon all the other vast amounts of things that it knows very simply so I'm gonna just make a small modification to my query I'm just gonna change the label that we're looking on not for English but we're gonna look for Japanese labels instead and if we can't find a Japanese label we're gonna use an Arabic label and if we can't find one of those we'll use Russian and finally if we still can't find a Russian label we will finally resort to English up here you can see I'm getting the label for the country and I want that to also be in Japanese for my filter panel and now I'm still color coding in the same way but I'll submit that and lo and behold we now have the whole timeline in Japanese and Arabic where there was no Japanese found etc etc and if we open up our filter panel we get the whole thing in Japanese and that is as simple as changing a few characters and that is the magic of wiki data and I think that definitely covers the basics of the tool okay