Dear viewer, these subtitles were generated by a machine via the service Trint and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/1125 Thanks!
[Music]
um
foreign
[Applause]
thank you hi everyone i'm lucas i work
at wikimedia germany
and um hello everyone i'm amir i also
work at the community germany
yeah okay and today we are going to tell
you
what wikidata is and what it's all about
and what
some of the cool things that you can do
with it and
we didn't prepare too much for this talk
i'm afraid so these are stolen slides so
at some point we will stop using them
and if at any point
something is unclear if you have any
questions then i think you
can just go right away and either you
will get a microphone from our friendly
sage manager or i will just
repeat your question for the live stream
and the recording
okay so should we just start yeah so uh
first of all i guess what's wiki data i
hope that's also what's on the slide
yes wikidata is a knowledge base
a free one which is uh very important to
us
it's part of the wikimedia family of
projects so it's
same family as wikipedia and wikisource
and wikimedia commons and some
other projects and it's exists to
support those projects but also for the
rest of the world so
even if you don't have anything to do
with wikipedia or
any other wikimedia stuff you can still
work on wikidata if you want
and it's a knowledge base of structured
data so
in a wikipedia article you have a lot of
information but it's all
in prose which is useful to human
readers but not so useful
to computers and to use this information
that's there automatically
so in wikidata it's you have
also a lot of information but in a
format that you can
use immediately and that's structured
like that
it's also multilingual so there's just
one wiki data there's not
like there's an english wikipedia german
wikipedia
french wikipedia and so on but there's
just one wiki data
and one week data serves the needs of
all the different
language communities so the
all the data we have is completely
multilingual the
information you see is the same whether
you look at it in uh
what in which language you look at it
and do you want to continue a bit so
just
one other thing that i want to say is
that so you use wikidata without knowing
it because it's actually being used by
alexa and siri and
all the google knowledge graphs are
basically a
it's uh has all of the information
but it's some sort of it's being it's
more built for machines so they use it
for you
and the one other thing that they want
to say like
is public domain which makes it very
easy to use because
there is no copyright for the data and
it's a collaborative like wikipedia
people fight over it
people try to import data it's you say
add more information and it's mostly
based on facts
like if you don't have subjective things
in it
unless you put a reference for that and
it's also
i think it's more for machines but it
also some humans use it so
oh here in the end it's on it's
either edited by humans or it's edited
by machines controlled by humans so
in some respects it's still for humans
definitely
anything here that we forgot it's linked
to other databases as well so you can
use wikidata in
combination with a lot of other
knowledge bases
which you might already be familiar and
perhaps
like they will have more special
specialized or more detailed data which
doesn't belong in wikidata but then wiki
data gives you
extra context because it's a knowledge
base for
almost everything
so some few numbers it was launched at
29th of october 2012.
uh it has more than 52 million items
uh and there's 20 000 active editors
like people who
actually edit once in a month at least
so
yeah so when we talk about 52 million
items uh
what we are talking about
uh what we are talking about is that um
so some of these items actually refers
to the geographical place that it has a
like a
um coordinator related to that and if
you put
each on coordinates somewhere we see we
can build a world map
and this is the world map based on
wikidata and it sees like
it's um you can see there is like a
knowledge gap between places that are
it doesn't have much information in it
in places that are
uh not fully developed as uh like europe
europe is basically
light up but
yeah there's still a lot of places where
we are um
missing some information even though it
it gets better this map used to
look a lot darker so there are
improvements over time
as there are there's also still a lot
left to do
and
so how many people here in the audience
have edited wikipedia before
that's not a lot
five people i guess so
i guess this slide is very relevant for
you as well so that's
applies not just to wiki data but also
to all wikimedia projects in general i
guess
but
in do you know what you want to say
about this
it's basically wiki is uh means like you
first edit and then review it
uh so in wikipedia it's like you first
put something you vandalize it and then
it gets uh reverted immediately by
by a robot or humans or other things so
it's just being like
we need to be quick uh this this is the
way that it works
it's not just for wikipedia so wiki is
applying wikipedia is applying a wiki
philosophy
on an encyclopedia so it's wikipedia and
then they
try to build this a news agency out of
that they try to build a
like a quotation market they try to
build a
dictionary that's called now victionary
uh is basically applying this wiki
philosophy
on data and this is that how it works
yeah and in wikipedia there's
um most of the data model isn't designed
up front but rather
it emerges over time as people start to
edit
and they notice some things that make
sense or they see
things that other people did that make
sense so they copy what that what they
did because
they want to do it this way as well or
they notice that
something is too limited and doesn't
work for some
use case and then they start a
discussion and then perhaps
decide okay we need to model this
information
in a different way uh what's a good
example for that i don't know
if for instance we currently have um one
case that i can think of right now is we
have
a lot of time zone statements right now
on
pretty much any german municipality
saying
this is in the time zone utc plus one
or in summer time it's in utc plus two
and
apparently in a few years there's not
going to be any change between winter
and summer time so it's
as far as i know it's not yet clear if
it's going to be all summer time or all
winter time
but that's definitely going to change
and i'm pretty sure
we will have to change the data model
based on that because
right now that's information that would
then be incorrect on
every uh individual german municipality
so we'll see what happens to that i
guess
but for now the information is there in
some form and then we can see what we do
with it later
does it is there i think we covered
everything in here
mostly yeah it's
i'm not sure how much we emphasize that
it's free and open so far so it's
open for reuse because it's all the data
is in the public domain you
can credit wiki data if you want it
would definitely be nice
but it's not required because if you
combine data from 50 sources
then these attribution requirements get
pretty complicated soon
so if you want you don't have to if it
makes your life easier
but anyone is also allowed to contribute
to wikidata
and you just have to be prepared that
other editors will
review your edits and perhaps tell you
that they don't like them or that you
should have done it
in a different way but anyone is welcome
to edit on wiki data as well
one thing is like it's so prone to
vandalism so and it can show itself
on other places that's one of the
reasons that it's being reused so much
that actually
one year ago that basically a news came
out that
if you ask siri what is the national
anthem of the bulgaria is and the city
would answer you
it's this despacito because it was
someone vandalized it in wikidata and
got
like moved to the series databases and
everything
yeah and then it took people a while to
even figure out where this came from
and in the meantime on wikidata i think
it had been reverted pretty quickly
within 20 minutes or so but yeah
so yeah that's definitely also one way
you can contribute just reviewing edits
and checking them for vandalism we need
more people doing that
did we cover the y wiki data i think so
more or less so it's yeah that is useful
both for
wikimedia projects for instance yeah a
use case
let's say we have um
200 or we have wikipedia articles in 200
or
perhaps even 300 languages about the
city of leipzig
where we currently are and then they
elect a new mayor
and now you would have to update 200 or
300 wikipedia articles
and that's one of the reasons why
wikidata is so useful because
if they pull this information who is the
current mayor
of leipzig if they pull that from
wikidata then you only have to update it
in one place
and then you can edit it there and it
automatically gets updated
in all the wikipedia articles and of
course some of the larger articles they
will also refer to the mayor
somewhere in the prose text and that
will still have to be updated
but at least those smaller articles
which only mention it in the
info box on the right there it will be
automatically updated
and i think we've more or less said how
it works
it's perhaps even more say even more
that it's
very very community driven so there's
really no central
uh planning committee deciding um this
is what should and shouldn't be in
wikidata it's all designed by the
community which
um discusses all these things in
various places and there's uh sub-commun
communities focusing on
a part of the knowledge like there's
wiki project for
anything related to germany or wiki
project related for anything related to
biology or
a weekly project sled dogs with i
think it actually has more than one
member right now so
more than one person interested in sled
dogs and
how they are being modeled in wikidata
because that's
useful information to have as well you
never know
just one thing as i want to say is that
it's very integrated with the wikipedia
community and other community of
wikimedia movements so they're
you you always find yourself with the
lots of wikipedians who
really love to edit wikipedia and then
they come and yell at you because why
you freak yeah you because the data is
being used in wikipedia and then you
change something and they might
get angry saying you know it should not
be like this
so data structure and how data is
structured in
wikidata so if you see there's a queue
id like a queue and the number there
it's an
item it it there's just an id for that
an item
so we have the san francisco item uh
this q62
and all of the articles in uh some
friends about san francisco and
wikipedia are actually connected to this
and then it has some statements and each
statement
can be uh talking about something it's
is being used there so
one is like a population and popul value
of these
statements can be a different type of
things like can be a number
it can be a another item and or it can
be a location
or mayor or like a string or anything
like that so
yeah but mostly the items linked to
other data items so when we say the
mayor of san francisco
is gavin newsom we don't say it's the
string gavin newsom because what if he
changes his name later what if he
marries or whatever so instead
what we store is this id here which
will always refer to this person even if
they change their name later
and then that's where we have all kinds
of information about gavin newsom as
well so
on the item about san francisco we only
know the mayor is
q 400 000 and something and then
on that other item we know uh he was
born in this and that year
and he's probably male and his first
name is gavin and whatever
and that's the linked aspect of the data
one one big
thing about this is uh what good thing
is making the language agnostic so you
can this is at
if you see it in english if you change
it to chinese you will see
all other chinese names that you cannot
read even here like uh so it basically
makes it very language diagnostic
if you want to see which what should be
a string and what should not be in a
string
you can see it that way yeah
let's have a look okay so let's actually
look at some wikidata items
what should we look at leipzig that
sounds good
so i'll just search for leipzig there it
is
and i'm currently looking at the page in
english
so i'm seeing all this information in
english leipzig
is a city in saxony in germany that's
just a bit of information to distinguish
it from like there's probably an
album called leipzig and there's
probably a leipzig in minnesota or
wherever
so you have a small description to tell
you what this is actually about
and then down here we have the
information so this tells us that
leipzig
is a big city and big city is
another item with the id
q1 million and something which has its
own statements
leipzig is also an independent city it's
a city in general it's a major regional
center and it's an
urban municipality of germany
it's part of this is that
an area or something in the leipzig
lowlands central hills
sounds like an area apparently and we
have an image for leipzig so if you want
to
show a bit of information about leipzig
you will you can use this image if you
want
it has an official name in labs in
german so even if you're
writing an article in japanese
if you want to refer to the official
name you can i know here what it is
and it lies in europe okay we have some
less
relevant information first apparently it
lies
in germany since 3rd october 1990
before that it was in the german
democratic republic and
in the soviet occupation zone and in a
bunch of
other countries
it's the capital of various things
apparently this doesn't even have an
english label what is this this is the
chris direction leipzig which is
some level of regional administration i
guess
somewhere down here there should also be
a population which is perhaps more
interesting yeah there's a population
so in 2017 leipzig had a population of
591
and 608 people we also have populations
at some other points in time
including this is apparently more recent
from march 2018
so you can if you want you can always
store multiple pieces of data in
wikidata and then
also add some these are called
qualifiers like the point in time or the
determination method um to further
specify
where this information comes from or
when it applies
or what it means more exactly
and very important you also have
references so sources for the
information let's hope this is a good
reference
yes it is so this population of leipzig
comes from
this url which has the title before
starting success
it was published by this thing
with a weird name but apparently that's
um
that looks like vandalism to me
let's check the history so all this is
like on wikipedia you have a history of
edits
and you can check who did what
yep that was an ip
which edited the english label and
description and before that
it didn't exist and
yeah i think i'm just going to revert
that live on stage yay
tada okay perhaps we could also
add a real english disk label let's just
do that so
this is the can you hold the microphone
it's done i couldn't think of a good
description but now if we reload this
page
that should look a bit better
okay those apparently the partner cities
let's wait for it to lay on there's a
population
no okay i think yeah we
no we just have to oh okay it moved or
not we just have to wait a bit
um but yeah we were talking about
references sorry for the
distractions so this tells us
where this information came from it came
from this
statistical office and if we want we can
look at this url
and check yeah i guess yeah that there's
a number
no this is the number from march 2018.
it's probably too small in the projector
you just have to believe me that is the
real number
and in this case the statement has one
reference
it's also possible for a statement to
have multiple references
do we have any examples of that this one
this has two references
so this population value came from
russian wikipedia at first
someone imported it from there but then
they also found a real reference which
is
this url and this imported from
wikimedia project is what i meant
earlier
when i said hopefully that's a good
reference because this is not a great
reference
so ideally you should find better
references than that
okay anything else on the item we didn't
talk about
so one thing about this is that you can
think about
if you go down you can see site links
and there's a lot of information if you
go down go down go down
so yeah so if you see here and there's
like a lot of wikis and different ones
and
you can see in some ways it has lots of
information
so uh one thing that i want to say for
example it's um
let's go to the check version how can i
open it
so it you have some information it's the
check version and if you go to the
history of that page can you go to
something around
before it got all of the interview links
deleted
i don't think 500 would be
yeah right
do you want to see the sword yeah let's
see so
uh go down if it's possible
so if you see at the bottom of this page
there is a lot of links to the other
wikipedia i don't
i don't know if you can say this but
this is how it wikipedia used to
maintain connection between articles in
different languages so
this is a czech version it was just
linking this to the
german uh like everything there and now
that there's deleted and there is being
handled from wikipedia
wiki data because if there is a central
place and just they are connected to
some
same thing and they they are having
their interviewings
it gives a better a semantic connection
between the wikipedia
different wikipedia versions yeah and
also just means if you
rename the article in one language you
no longer have to update the
corresponding articles in 300 other
languages so it's
again back to this issue of we're
unifying all this information or a lot
of this information in wikidata
just to make it easier
i'm not i mean we can look at this item
in another language just to
see that it's really multilingual
perhaps
i don't know french perhaps someone here
speaks french
so now we see the entire page including
all this information
in french because any
data item can have this label in
different languages and this case
it's called leipzig in all three
languages because it's a city name
but this item for which used to be
a big city i think in french it's called
something else so you now see the french
label but it's still the same item with
the same data of course
and in this case apparently there is no
french label so it falls back to the
english version which is still better
than nothing
let's go back to english
any questions so far by the way
then i guess we can try to create an
item
what item do we want to create
so do you want to check the item for the
last year's
conference sure let's do that
so this is the item for the last year's
conference
it has some basic information in it uh
saying like which is part of what
conference it is and if it's the next
one it's still like if
like the one before that oh
maybe it's the band also
you can see we're going to create this
item but someone must have
edited in the last 15 minutes or
something
who no we wanted to create it
here damn it okay we need a different
idea
for an item to create next year yeah
let's go ahead and then
next year we'll have the same problem
and okay
so so 35 c3 was created
just what time is it now
eight minutes ago is this person here in
the audience who was that
show yourself maybe okay in the live
stream thank you
okay thank you anyways for creating an
item and
so we can see what kind of information
is here
well i mean we can start by adding some
references this item doesn't have any
references perhaps we can
improve that for example refreshing
memories there should be
some web page um telling us where this
model came from right
uh can you hold the mic and i'll just
search for something
official website i guess
so
i guess i think i think that's not the
first time the logo was the motto was
made public but it's a reference we can
use it
bam so
let's start making next year okay
so um we can create a new item now
for you okay
oh okay now the keyboard layout makes
sense
so the label is going to be 36
c3 i think the c was uppercase
description you can just copy it from
the other item if you want um
i think this right
oops there it is
so we just need to replace the 35th with
36th
and do we need any search aliases
no i don't think so
lowercase i guess yeah it doesn't hurt
and
and okay on his behalf and i just made
an edit on his behalf so
yeah i'm logged in here so yeah and now
should i start adding statements hello
so you have to talk because i don't know
okay so what we are going to do is
we have a statement saying that of what
it is like
what we are talking about so this is
like instance of a conference uh
it's called let's go chaos communication
conference probably
yes and then bam it's there
so we can add a reference for that but i
don't think it would be needed so for
example there is like a
you if you go to the item of president
and you say instance of human it doesn't
really need a reference that the person
is human but
so property um we can't say which place
it's been
going to be held do you notice which
place is going to be
next year probably not official yet so
okay
do we have do we have any other
information actually i guess there's a
twitter hashtag at least so there was
one
on 35 c3 uh
so we can add another one for 36
and just guess that let's do it
as follows and follows is like which one
before was that and which one is next
and also you can add this uh
item to the uh this year's yeah
so basically uh now it says like there
is a problem because it needs to be
symmetrical
and it says it follows it should be
after that it should be followed by it
to be added in the other item
now both of them are fixed now hopefully
yeah i think that's all there's nothing
much we can add here for this case
yeah that's all i can think of for now
or we can add a german label i guess
and description for lots of language
yeah but let's just quickly do that
is 36c3 and it is
okay and i just noticed we didn't really
talk about properties yet right
so so far we've looked at the items
which are
aware most where the information is
stored and also they're
the values for a lot of statements
and we haven't talked about this part
which is the properties and that's
um so that there's a difference between
uh item properties because properties
are used to define
how the data is stored and for each
property
um so there's only six thousand
are we at seven thousand properties by
now i don't think so so somewhere
between six and seven thousand
properties by now
and not everyone can create a new
property so anyone can create a new item
like we just did
and creating a new property is not quite
that easy
because there has to be some community
discussion that we actually need this
new property to store some new piece of
information because either we can't
store it in
any other way or at least the other way
is terrible
um but there's usually first a
discussion
if you propose a new property do we
really need this can we not do this with
some of the existing properties
but then in the end you have these
properties like
instance of what is this item anyways
or which other event does it follow or
hear
the motto text of an event or
start an end time and for start and end
time the value is always
a point in time and not an item so
that's
another possible type of value that
exists next to items and some others
one thing that's about wikidata is that
it has different way of modeling things
uh
like there's an ontology here and
there's different type of entities
so we have one entity uh is called item
so we have different type of entity one
entities item and the other type of
entity is property that's being used for
other things
and there's another type of entity it's
called lexiem do you want to talk about
that
how many of you heard about alexeem
oh that's good hello
so lex sims are basically uh
words that are being used in the
dictionary and their languages so
basically
in every entry in the dictionary is sort
of a like scene
uh so for example you can go to the like
sim and then we have another type of
uh entity l99
so this is just a board and it's in
german and then you describe it in a
like a way that machine can understand
it the good thing about this thing
is that actually helps about machine
translations automatic translations
because
you can connect it to the other like
seams in other languages so then you can
say these are like
uh the same thing and the way that's
being the other forms that it has and
the other
way can be described
do you want anymore um yeah so we saw
uh for each leg seam or word we store
the different forms it has
like the different declinations or
conjugations or whatever
and also the different meanings it has
uh luf balon only has one meaning so far
which i guess makes sense what
pluto yeah that's a good one so let's
search for pluto
um there it is the english proper noun
pluto
it means a dwarf planet near neptune
and it also means refers to a greek god
and also a cartoon dog from disney
so we have three different senses for
those and on each of the senses
we can have other statements for example
to link to the item which we have for
this concept so we have
so we would have different lex themes
for uh the english word pluto or the
german word pluto or
in french it's slightly different i
think
or is it the same word pluto it's the
same okay i thought it might be
different
it's definitely different in russian
just because of the different alphabet
but the concept of this dwarf planet
would still be represented by
one item and we can link all the
different
words which have the same meaning to
this item
and actually here we also have a
translation of this word which is
um this is a russian word
oh great so that's pluton in russian
with this same sense which also refers
to the item
and has a translation for
the lexeme which we just looked at so
that's uh
all this lexicographical data is
something we started collecting
fairly recently when was it may this
year
i think so
we're still starting to build up this
collection of data but eventually this
should
um also be a large collection of
lexicographical data
just like we already have different kind
of data
in wikidata so there is another one
that's actually in the future
and just want to talk about the future
video info okay so how many of you do
you know about
wikimedia commons
that's good so let's uh just to recap
wikimedia comes in there
is image repository that uh empowers
wikipedia and has
um around 30 40 million images that are
free license so you can use it in other
places
this is like in wikimedia commons but
the biggest problem is that if you go
down a little bit that
thing you see there's like a all text
and it's
it's not nice and it's it's really hard
to find um
like uh images in that huge vast amount
of uh
images that we have if you go down the
way that people are handling is that
they
add categories uh this is just one
category
that's really nice so for example the
category versions for a categorization
of images in
commons becomes so weird that there is
like a category of
cats looking at left and there's a
category of cats looking at right
and so it's so the way that
the real reasoning for that is that it
needs to be modeled properly in the way
that machine can understand it so you
can
search for that properly yeah of course
oh
up and down yeah we have that too um
so uh this way you can basically uh have
the images and
describe them and model them
i'm not sure if we can show that on
stream oh we can uh okay
but uh they're too small so okay
uh but so we can have this uh images and
then
describe them uh in a way that a machine
can understand and then when you search
it and you can find them easily so you
don't need this weird categorization
yeah it will also be useful for the
license
information i recently built a tool
which showed you
images from commons as part of what it
did and then i of course had to add
attribution and
right now it's a nightmare there is some
kind of api
to get all these fragments of license
information which are
buried in here in here somewhere in the
wiki text and if you're lucky you can
find out that
this is actually in the public domain
but if it's cc by and then
you have to get the author from there
it's all terrible
and if your tool isn't in english it's
probably even worse
so storing this kind of information
in a structured way who created this
image
what is the license which other images
is it perhaps based on is it um
actually pasted together from a lot of
images and they all have their own
license
uh storing all that in a structured way
is also going to make that
much easier one good thing that it will
have it has
some there is like test system that you
can go there and test it and there's has
like a statement called
depicts and we say like what's going to
actually show to you so even if you want
to look
for a picture of pluto they just you can
search like what depicts polo to and
then you get all of the images of that
really
easily so yeah and that's right now
that's
kind of done through categories like we
have this category composites of
bluetooth by laurie and
mvik which is probably a subcategory of
photos of pluto by new horizon which is
subcategory of pluto
but then if we have a category for
some person we might already not know is
this
a category of images by this person or
depicting this person or otherwise
related to this person
so that's all a bit messy right now yeah
and one other thing if
you see this category in comments this
data is comes from wiki data just
the same
okay okay i think
what time do we have okay
we're halfway through we might start
talking about the query service now i
guess
unless there are any questions about
wikidata in general
okay i don't see any questions shout if
i miss you
so um the other thing we can talk about
now is
how you actually get information out of
wikidata
instead of just looking at one item
let's go back to this item you can of
course download the information
in this item in various formats if you
want
but that's um
if you want for example a list of all
the
just all the chaos communication
congress events that would already be
difficult you could you could download
all of wikidata and then search for
any statements which say this is an
instance of chaos communication congress
but that's going to get
pretty complicated so it's much better
to do this using the query service
where you can write queries against
this entire data set so it's
a bit like sql for sql databases but
it's a different query languages
language because the information is
stored in a different format
so for that you would go to
query.wikidata.org
okay and now i hope it's readable for
you and we can start with
this query helper which if you open the
page it should be visible for you i just
usually have it closed
okay so we can start by saying we are
looking
for okay chaos communication
congress events and run that query and
we get seven results so far so people
created items
for 23 c3 and then 31 2
3 4 5 and 36 c3 which is the one we just
created so that's how you can find them
and then we could add some more
information if we want
such as the location
this one and perhaps also
the start time
and the end time why not
uh oh right i need to talk on this end
sorry so we can
add all this information if we have it
and then we see that
23 c3 was still in berlin and we
apparently don't know yet
when it started and ended at least we
don't know it in wikidata
and then these two events were in the
congress central hamburg and in 2016 and
15 respectively and then oh this one
also
because it's not sorted at the moment
and then it moved to the leipzig
fairgrounds in 2017
and 2018 and 436 c3 we don't know yet
if we wanted i mean we could add the
speculative information that it's going
to stay in leipzig but
perhaps let's not do that right now
um
so this is how you can
add lists how you can generate
lists of things on wikidata fairly
easily using this
query helper to click together your qree
and
i think the next step would be to
discuss the actual query language with
it which is on the right
over here so i've just
yeah so the um actual result is of
course a wiki data item which we see
here
but the result also includes the label
of this item because that makes it just
a lot easier to understand and if we
wanted we could say
we actually perhaps we don't need the
item for the location
so we can just remove that here
and we only want the location label
and now we don't have that extra column
here
so on the right here we have the actual
um
query language which you use to um
to write these queries against a
wikidata which is called sparkle which
stands for
what was it structured
something and rdf no sparkle
p and rdf query language i don't know
what the p is for i don't remember
anyways it looks uh at first a bit
similar to sql with this select
something where blah blah and then down
here you have a limit
and we could also add an
order by if we wanted
oops
order by i know this
label and then this makes more sense
um but actually it's not
that similar to sql and i myself didn't
know much sql before i started working
with this
sparkle language but i hear from other
people that they had to basically forget
anything they know about sql in order to
learn this language because it's
still fairly different so i'm not sure
how many people
here are already familiar with sql
um but let's hope it still works
if you want to talk about like how much
is different from skills so there's no
concept of table there's no concept
of join or something related to that
this is at least one big thing about it
and there's like
no fixed schema to say like i need these
columns yeah so
you don't really have a data layout like
an sql i have
these two tables and to use them
together i need to join them
on some condition in sparkle you look at
all the data you have as one
long list of information bits and then
under the hood i guess there must be
some tables and some joins again but
as a creepy author you don't really have
to think about that so
at least in my experience it's even more
declarative than in sql i guess at the
back end at the back end is a graph
database
it's blaze graph and basically it gets
the rdf there and you just put there
inside the
blaze yeah so um we can just quickly
look at what
is actually stored if we write
describe oops
i have to type with one hand sorry
describe
and let's copy the id of 36
c3
and write that query so that's what the
query service actually knows it's just
a long list of these so-called triples
each with a subject
a predicate and an object
and it says that this
item which we just looked at for example
has
a label of 36 c3 and it has a
description of the 36th chaos
communication congress
and then it has the same things in
german as well
and here we see this statement it has so
p31
is the property id of this instance of
property which we saw earlier
and that links to this item which
must be chaos communication congress
and also this is i guess this must be it
follows
yes so that this 36 c3 follows the 35 c3
and also we have from 35 c3
um the information that it is followed
by
that must be yeah that's the followed by
property at 35 c3 is followed by
36 c3 so in a sense it's all
linked together in one huge graph
and in this case we're looking at one
subset of it can we show it as a graph
i think so
okay that's not especially
useful
it's actually actively refusing to be
useful so let's just
go away from that again um
but yeah basically you you have all the
information in wikidata
stored as these uh triples which and
it's just
one long list and then you describe
which of these triples you actually want
to look at
so if we write a
simple query where we say
we want to select anything where
some unknown item
is an instance of which is p31
that's the instance of property and it's
an instance of
this chaos communication congress and i
can search with
a control space by the way if you want
to try this on your laptop
and hopefully we can find yeah chaos
communication congress there it is
and now we're going to find all the
triples in the database
where the second value is this p31
and the third value is this q 500 000
and something
and so because we saw earlier that
this 36 c3 item has
a triple like that which is down here
and so that's one of the triples
matching uh what we just wrote here
so it's going to be part of the result
along with all the
other chaos communication congress
events
so that's more or less the same as we
clicked together earlier
here on the left side and you can see it
here as well so now we're looking for
all the items
with such a statement but if we wanted
we could also
reverse the situation and instead ask
if
c3
um so now we've reversed the question
we're asking
what is this 36 c3 and
instance off
[Music]
now we get one result which is this
chaos communication congress item
so we're still looking at the same
triple in this case
just we've selected it from a different
end so to speak and
you can then add more lines like this
to further limit your results for
instance let's go back to
this which is the list of all
communication congress but let's also
require that the
item has a location
of leipzig fairgrounds
yes and so now we should only get
two items right yeah 34
34 c3 and 35 c3 and because
uh 36 c3 doesn't have this information
yet
and um
the question of how it actually finds
this data that's
not important to us it could um their
previous service could first look for
all the triples matching this line and
then it knows what the item could be and
then it checks for each item
does this and triple also exist um
or it could also go the other way around
and first search for all the items with
location leipzig fairgrounds
and then for each item check is it
actually an instance of
chaos communication congress or is it
something else and we can actually
check how many results that would bring
i i would guess it's
not a lot yeah there's just four events
at leipzig fairgrounds according to
wikidata
or four that we know off so that's the
leipzig book fair
intech and the other two are 34 and 35
c3
um one other thing that is actually is
really useful and it's other types of uh
showing the data it's um you saw this
item way but you can
look at the graph so for example if you
check for as sons of kangaskhan
in the examples no
suns
let me egg kangas
wait there's no children children of
genghis khan yeah oh
sons sorry yeah yeah i was thinking of
the band
that's why i had songs in my hair
so and then if you uh try to sit
i okay did you run it
uh-huh i didn't okay that's
that's a little bit messy but it
actually seemed good uh
can you go up a little no
yeah and there's other types of showing
this yeah
uh if you go
probably this way so
so yeah you see like there's a
kangaskhan and there's like it's
all of these children and the children
of the children and it is
you can go further down in this and if
this is this is really useful in case of
historical
uh figures that they have lots of
children
like kings but yeah
and i mean we can go through some more
of the example traps just to see what
kinds of interesting things you can do
um there's
a map of hospitals for example
everywhere in the world or at least
other ones which we know in wikidata and
which also have
coordinates so we can show them on the
map
and as you can see that's not complete
information i'm sure there must be
a few more hospitals somewhere in this
area for example
but we can still look at the
here
or what other examples can we look at
oh yeah
so this we have all the u1 subway
stations in berlin
and you can show them on the map and
then you see
pretty clearly where the line actually
runs
and in this case i think for a lot of
these stations we
openstreetmap should also have an item
and
i think openstreetmap links to the
wikidata item right
we don't link to openstreetmap because
they say that their node ids are not
stable they can change at any time
so we can't link to them but they can
link to us
and you can actually even query
openstreetmap and wikidata at once but
i don't have a lot of experience with
that but you can do some very cool
things with that as well
what else do we have here
groups of characters something about
timelines
that you can say
yeah not that
harsh but
yeah this is time not enough people who
died in burning i guess
because of burning very popular
around here this time and then not so
very popular more recently
yeah awarded chemistry nobel prizes
perhaps that's a bit more cheerful
[Music]
right and for some reason the timeline
doesn't quite work my browser is zoomed
in so i have to
zoom out sorry i'm not sure if this is
still readable
right here we have all the chemistry
noble prices
now it doesn't it's a bit much to show
on the timeline really i guess
what other timelines do we have
space probes no that's also a lot i
think albums by manu chow and not
mano negra i'm not sure why someone
thought this was
very important but i guess
it's important so you can look at the
timeline of those
what other results views do we have
you can also show the information as a
kind of tree like this is
composers from vienna with their
compositions
arranged by tonality
apparently that's a very important and
then you can
try to guess what's the most common
tonality by schoenberg
h analogy yeah
and then below here we should see a list
of all these different compositions
and also apparently we don't have an
image of oh that's jose wagner not
the other wagner okay
sorry
should we talk a bit more about sparkle
again what do you want to talk about
so any ideas for queries so far we can
maybe try to write them right now
like a list of battles by alexander
alexander the great you know like for a
historic map
or something we can try the first step
there would be to know
how it's modeled in wiki data that is by
a battle by
alexander the great do you have an
example item yeah i have one i
searched it already um wait a second
okay it's q one seven nine
six seven zero that's the
that's the battle okay so we can try to
find
other items like that
part of wars of alexander the great that
sounds promising
does it say that no okay it doesn't
directly say that alexander the great
was a participant or anything but we can
search for items
with this statement part of wars of
alexander the great
um yeah instance of battle perhaps as
well
so instance of battle first
and then also wars of
alexander the great should be a part of
that
and that's h results so far
yeah let's try that coordinate location
yeah a few of them have coordinates so
let's
show them on a map
okay there's one over here
and they're pretty distributed
even down here
yeah and
i mean we can try to show them on a
timeline as well by adding the
point in time i don't think they would
have a start or an
end date so let's just try the point in
time yes a few of them have that
so we can add a timeline as well
and see that yeah it went from
334 bce until 329 bce so
is that a range of just five years
oh well that's just
hmm i'm not sure if wars of alexander
the great is
uh if that covers all the battles or if
there would be
other ones let's look at this item
it's a war apparently
oh there it says that and alexander the
great was a participant
so we could also try to look for
anything where he was a
participant
um so let's
filter for
alexander the great as the
participant
the first one was participant off that's
the wrong direction
okay oh damn sorry i keep touching this
light
um and then we could
look for items
so this is let's say it's
let's call it an event where alexander
the great
participated and
then we can look for any item that was
part of such an
event and then we can perhaps find we
should find the same um
we find all these battles and sieges
which we had earlier
that's 15 did we have less earlier
so i guess now we're also getting some
items which are linked not to this
wars of alexander the great but no
directly connected well yeah
no maybe let's also select the event
label to understand what's going on
no it's all linked to wars of alexander
the great okay
okay yeah we can look uh
so for battles with his father as well
so
i'm trying to think of the best way to
um put this in a query so that it
kind of makes sense uh first of all i
guess i should quickly mention this
thing this
is called the labeled service that takes
ensures that we get these label
variables so that we can
see not just the item itself with the
queue id but that can
that we can also understand what it's
actually about
and basically you can just put that at
the end of the query and forget about it
and this is the important part
um and we can
yeah let's try to say it could be an
event
so so right now we're saying that um the
item is part of
an event in which uh alexander the great
was a participant
but also perhaps he was directly a
participant in something
so we can first
compress these two lines by removing
this
event variable and it just said just
replacing that with a slash
and that says oops my laptop is acting
up that says the item
is part of something which had the
participant alexander the great
and now we should get the same results
except that we don't have this anymore
15 results and now we can also say
actually um if
the item isn't part of anything but if
it directly has this participant that's
also okay for us so we can add a
question mark here and then that means
the item can either be
part of something which had the
participant alexander the great
or it can directly have the participant
alexander the great and
skip this thing i should also zoom in
again
sorry and then let's
see if that gets us more results yes we
have now 17.
okay well we have these two which are
the events we saw earlier so i guess we
didn't get any extra battles of that
and we should also add that the item is
an instance of
battle right yes
and now we only get eight results again
the eight we had earlier
um what other things did we get oh a
siege of halicarnassus which is not a
battle i guess
it's a siege but both the battle and the
siege are related right so let's see
a siege is a subclass of a blockade
which is a military operation so let's
say
we're interested in any kind of military
operation where he took place
whether it's a siege or a battle or
something
so for that we say
if we just say it's an instance of a
military
operation then we will not get any
results i guess
yeah because no item is directly an
instance of military operation
we have to say that we're interested in
military operations or
in subclasses of them which was uh
specified here earlier this
subclass of statements we have to tell
the query service
and that it's allowed to follow these
statements and we do that
with another slash and then
subclass off and then we put a star
after that which means
it's there's allowed to be any number of
uh subclass links between the
uh class itself and this class of
military operations so
it could be directly an instance of
military operation it could be an
instance of siege which was a subclass
of occupation which was a subclass of
military operation
or whatever and now we should get 19
results
that's too many i think
yes we get the indian campaign twice for
example
why because
oh that's the same item two times same
item id we get it twice because it's a
war
and also a military campaign and both of
these
are subclasses of military operations so
there's two ways to include these
results that's why we get it twice
let's say we're not interested in that
we only want
distinct results that's that bit is like
sql again
i guess and now we get 16 results
which is still more than we had earlier
oh this thing doesn't even have a label
in english this is
battle of gabay apparently and if this
let me just see if gabai has
is there a link of that
no there's i'll just guess that it's
called the same in english and doesn't
have a different name so i will call
this the
battle of gabai battled by
[Music]
in the wars of alexander the great
and now if we run the query again and we
have to change it a little bit so we
don't get a cached result
but now we should
see yeah there's the new label and
apparently all the
other labels are in uppercase so
yeah so perhaps i should have made it in
uppercase as well
but yeah so updates in wikidata
are usually visible in the query service
almost instantly you just
um you have to make some minor edit to
the query it can just be some white
space so you don't get the same result
back again because results are cached
for
i think five minutes so if you just make
any change to query then you get a new
result
and you also wanted perhaps battles by
his father right
so let's um so we can do that by adding
another element here
and saying that participant could be
alexander the great
or it could be his father
and we put a question mark behind that
again to say that it can be his father
or it could be just alexander the great
himself
no wait um we need to go the other way
around
because in the end at the end of the
chain is alexander the great so
if the item in here in the position is
his father then the statement we're
looking for is that the father has the
child
alexander the great so this is at the
end of the chain i think
now we get instead of 16 results we get
30. wow
ok
so yeah this one is definitely new
so oh actually the participant here is
three dynasties but it's part of these
wars and i guess these wars have
um participants yeah so one of
these i don't know enough but one of
these must be
the father of alexander the great i
guess this one
the one with the problem apparently
because
aha philip ii of macedon died in 336 bce
and these wars started in 322 bce
apparently
so something doesn't quite make sense
here
but we'll have to check that later
but uh we didn't talk about these
constraints yet anyways
i guess we should do that so
those are
limitations which are placed on some
properties and
they don't stop you from making edits
that don't make sense so
you're allowed to say even very silly
stuff like i could say that
location of 36 c3 is
the concept of water or that it's
a person it doesn't make sense that the
location of something is a person but we
will still let you add that information
to wikidata at first
and then you will see a warning like
this that the information perhaps
doesn't make sense and
you might want to take a second look
there and
check that out so that's what we're
seeing here and we
also saw that a bit earlier but it
um you can still add this information
for now
one thing that's uh for example was
useful is about like um
there are lots of vandalism that come
people change sex of people like gender
of people
from a male or two or female to like a
cat or
i don't know something like that and uh
we have this
20 sort of acceptable value for sex and
gender
and anything besides that it just
is not acceptable like
acceptable these are acceptable values
like male female intersex homophobic
transgender and so on anything beside
those
is a constraint violation yeah
and that's i assume there's probably
a few items which currently have a
different gender
and then perhaps that means that um
actually this constraint is not complete
and should be updated again
but also perhaps it means that there was
some kind of vandalism
you can't find landlords it's good that
you just you can make this such a
queries
in future soon that you can make queries
into the constraint uh
in the query.wikidata.org and then get
the results of things that are actually
violating this constraint
so you can find vandal them really
quickly
yeah i mean if there are no other
questions we could try that and
query for all the sex or gender values
and see
if there is currently anything there
that looks like vandalism
that's oh okay
i could also repeat the question if the
microphone doesn't work
test hello okay uh so
is there a way to query metadata like
say for example
you want to find out which which item
edit
was edited the most is there a way to
find it out
not on the wiki data query service so i
think i still have that tab open
somewhere
um in a second so
here we saw all the information which we
have about this item
and there is so this schema version is
the revision id
for mediawiki and we have
when this item was last edited which is
today
and that's all we have so far we don't
have a full
edit history or anything like that in
the wikidata query service
however however there is a like if you
know about um
media wiki database layout and how they
source the media wiki because
the key data at the end is just a media
week installation with some
like um fancy things added to it
uh so you can just go to the public
service called quarry.wmf
and log in with wikimedia account and
then you basically can
make any queries to the database of
wikipedia or any wiki that you want to
if like if the data is public like you
cannot
actually query the users password hashes
but you cannot actually query like how
many times it has been edited
and if you don't know about the database
layout you just go to media wiki search
database layout
yeah so like this information which
which
page has been edited the most so at the
level of media wiki which doesn't know
anything about items or properties
mediawiki itself just knows this is a
page
you could get that with a database query
i'm not sure if it would be very
efficient
to search for the most edited pages but
you could definitely do that here it's
just a different query service
group by page id and then you get to get
it but it's
i think that's not going to be efficient
so i don't want to do it on stage
nothing nothing works on labs but it's
not the production level so it's not
so wanted to try the sex and gender yeah
so one thing that one funny query that
you can do it we are doing sort of it
right now is that you can group by value
and see how many times
um this statement has been repeated with
different values
and one thing that actually has been
used a lot like grouping people by type
of
hum the type of test that they had like
but which means they died and i if i can
trade laser
but this is like another one okay so
this is all the different values for
sex or gender and there's actually 883
because there's a lot of
unknown values there which we didn't
mention before
but what's a good example for unknown
value
i don't know this is a good example you
don't know
well yeah i want to show it on wikidata
um
yeah okay that's um
hmm filter is not very efficient
okay so here that's why the gender is
unknown this is a serial killer which is
unidentified what a cheerful topic
so we know that they must be a human but
we don't know
which gender they are so that's also
something you can store in wikidata in
addition
to storing a real value you can store
that we don't know the value
or that actually there is no value for
example
that was a good example for no value
right
the city of bern in switzerland
officially
doesn't have a mayor so if we just
open that
our united states doesn't have official
language oh yeah
right but so let's just go here
it's as a coordinate location has lots
of things
head of government no wait uh
not burns switzerland
that's the thing that bern is not the
capital of switzerland
um switzerland has a logo image
it has life expectancies of its citizens
um it's named after something
people in it are called something else
it has four official languages has an
anthem
mottos there so officially
the capital is no value there is no
capital of switzerland
de facto there is um
bern is the city where i think the
parliament is located and
some things it's officially called the
bundestadt i think
um so we still say if you ask
the average person on the street what's
the capital of switzerland they will
probably tell you it's burned so that's
the value
we saw here but we also say that um
actually officially there's no value for
this statement
so that's why it's very useful to be
able to store that information as well
and um the trick is that in the query
service
unknown value like here looks
like this absurd um
t something thing we saw earlier
all these things that's all unknown
values and they're all different
so we just have to filter those out and
okay so we're first of all i'm doing
this in a sub query i'm first getting
all the gender values
and then only after we've done that
checking if there are
a so called blank value or not because
otherwise
as you saw earlier checking each value
individually is very inefficient
so you first get these 800 different
ones and then this more efficient
and now we have 400 different uh
gender values and you we also wanted to
have the number right
so instead of can you hold the mic
instead of instead of just selecting the
different values we actually want to
group by the gender so this part works
just like an sql again
and in addition to the gender we want
the count of
lines we have as that's called count
and select it out here as well and
perhaps also order by that
and that's yeah okay there we go
so we have three million
items i i'm pretty sure this is male and
this
is hopefully female with seven hundred
thousand
yep and then we have 5000 i'm guessing
this is male
organism and 2 000 female organisms
i'm not sure why we actually have
different items for
male female human and organism and
probably it's in fact not male human
but uh fictional characters which are
um more or less human but perhaps
they're not human
from some science fiction thing they
probably also male and not male
organisms
it's complicated but
i'm sure that the community has its
reasons for this distinction
and then down here we have other genders
including ones with only one value
that's a suspiciously low item id q 155
is brazil someone has brazil
as their gender okay so we found some
vandalism let's
find that
so this is the item there's also a
constraint violation
uh it should be one of the following
blah blah it's incomplete list it
doesn't fit here
and was this edited recently let's check
it was
edited
what did they do use a relic
keeper that looks like more or less
they probably have lots of contributions
right
they've done some more or less big
import
great okay so let's not rev so we can't
revert that
you can just undo it i think it's it's a
definitely problem
but the thing is about this case is that
there's lots of um
users who try to go through categories
of wikipedia and then try to
import data from wikipedia tv data which
is a good thing at the end
but there are lots of edge cases that
sometimes they forget or they may be a
problem in their queries or anything
that they do
sometimes these kind of things can
happen and the good thing about this is
that it's
uh it can find these problems so quickly
i'm actually surprised to see this year
field of work poet
i think that's incorrect a field of work
would be poetry
right so i'm surprised that there's no
constraint violation here but
if there's no warning symbol then i'm
not going to touch that for now
yeah right any questions between
and this is not a very structured
introduction to the query service i'm
sorry
we should definitely tell you where
where you can get help that's very
important
up here there's a general
inter there's a portal for help
including some introductions to the
query service and to sparkle
and almost the most important bit is
this page request a query
where without knowing anything about
sparkle you can just
tell people i would like to have this
query
um and then they will write it for you
so you don't actually need to learn
sparkle if you can just go on this page
and
get help there which usually happens
pretty quickly
what's the time by the way oh
we have one minute left apparently i'm
you probably held up the cars and i just
didn't notice them i'm very sorry oh
okay
yes so we will be um over there in the
kitchen later if you
have any other questions or if you want
to try writing your own queries
and we can sit together and try to
experiment with that
i think the slot officially starts in
half an hour or something yeah but
we can just uh be there right away i
guess
then yes
what if i want to use it from like java
or python do you just use the web
service thing or are there like sdks or
do you want to use wikidata or the query
service
uh either both maybe so for wiki data in
general there's a
for java there's a library called the
wikidata toolkit i think
i'm not sure do we have a documentation
page in general for libraries
related to wikidata i'm not sure but it
would be
the wikidata toolkit is a java library
for python there's pi wikibot
and there's a few other libraries as
well i think perhaps there's a category
here for
wiki-based libraries or something and
for the query service two examples yeah
so if you want to see that there's a
like if you want to request a query in
uh
using other languages uh programming
languages that
you can just uh go there and write this
query we basically built this
so we can just copy base and build this
data and get it from there
so this is sort of useful but in the
other hand also
for acquiring the data if you especially
want to do other things
immediately itself has an api.php a
action api
and you can just go there to
wikidata.org and
slash w api.php and then it has action
api and you can get
all sorts of things that you want to
even you can edit using that api so
but i'm sure we can discuss that in the
kitchen in a second as well i think
we're done now so thanks for your
[Applause]
[Music]
attention
[Music]
you