The Knowledge Graph is the core of our project. It gives shape and meaning to the results of the sentiment analysis, by connecting together the tweets with all their predicates and objects in an all-encompassing named graph. Each tweet is represented as a node which is connected to its objects through the edges, named after the corresponding predicate. Different colours represent different languages.
Due to the size of our dataset and some technical problems, which we had with Sentilo, we present a sample of the named graph, whose complete creation is still in progress. For the following graph, we selected the three most popular tweets per language. Hence, this sample graph is just about 0.07% of the final graph's size.
The above graph is a visual representation of our ontology, which we designed to organise our data. Our ontology is – like any other ontology – based on triples (subject, predicate, object) and has an IRI (http://www.europinion.com/), which defines the namespace with its predicates. The predicates are tailored to our dataset and encompass generic terms, like eur:createdBy, and some subject specific, like eur:hasTranslation which points to the translated text as the object.
The code below demonstrates along one Tweet, what the structure of the Europinion ontology looks like in RDF/XML. As can be seen in this snippet, the ontology also contains predicates for referencing the Sentilo data: eur:hasPositiveScore, eur:hasAvgPositive, eur:hasNegativeScore, and eur:hasAvgNegative. Those scores were assigned while dynamically creating the full RDF data store in the analysing step, as can be seen in the tab Analysing of our subpageCode. The complete RDF/XML file of our named graph is available on our GitHub repository. However, opening the file in a browser is due to its size not recommended.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:eur="http://www.europinion.com/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description rdf:about="http://www.europinion.com/2019/">
<eur:lang rdf:resource="http://www.europinion.com/2019/fr/"/>
</rdf:Description>
<rdf:Description rdf:about="http://www.europinion.com/2019/fr/">
<eur:hasTweet rdf:resource="http://www.europinion.com/2019/fr/3590"/>
</rdf:Description>
<rdf:Description rdf:about="http://www.europinion.com/2019/fr/3590">
<eur:createdBy>LenaSelles33</eur:createdBy>
<eur:hasLocation>Barcelona, Republic Catalonia</eur:hasLocation>
<eur:hasDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2019-05-29</eur:hasDate>
<eur:hasTime rdf:datatype="http://www.w3.org/2001/XMLSchema#time">22:15:23</eur:hasTime>
<eur:hasLang>fr</eur:hasLang>
<eur:hasText>"Bon soir:
@Europarl_EN @EP_President
Je suis catalane.
J'ai donné ma voix aux élections européennes au Président Carles Puigdemont #KRLS et au député @toni_comin.
👉 Vous venez d'usurper mon vote, Cher Monsieur.
👉 Qu’es-ce qu’on va faire maintenant?"
</eur:hasText>
<eur:hasParsed>
Bon soir: Je suis catalane. J'ai donné ma voix aux élections européennes au Président Carles Puigdemont et au député . Vous venez d'usurper mon vote, Cher Monsieur. Qu’es-ce qu’on va faire maintenant?
</eur:hasParsed>
<eur:hasTranslation>
Good evening: I am Catalan. I gave my vote to the european elections the President, Carles Puigdemont, and the member of parliament . You come to usurp my vote, Dear Sir. What are we going to do now?
</eur:hasTranslation>
<eur:isFavorite rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2479</eur:isFavorite>
<eur:hasRetweet rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1552</eur:hasRetweet>
<eur:hasHashtag>KRLS</eur:hasHashtag>
<eur:hasEmoji>👉</eur:hasEmoji>
<eur:hasEmoji>👉</eur:hasEmoji>
<eur:hasMention>Europarl_EN</eur:hasMention>
<eur:hasMention>EP_President</eur:hasMention>
<has:URL>https://twitter.com/i/web/status/1133859406624559104</has:URL>
<eur:hasPositiveScore rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.90</eur:hasPositiveScore>
<eur:hasPositiveScore rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.81444444</eur:hasPositiveScore>
<eur:hasAvgPositive rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.733</eur:hasAvgPositive>
<eur:hasNegativeScore rdf:datatype="http://www.w3.org/2001/XMLSchema#double">-0.645</eur:hasPositiveScore>
<eur:hasAvgNegative rdf:datatype="http://www.w3.org/2001/XMLSchema#double">-0.645</eur:hasAvgPositive>
</rdf:Description>
</rdf:RDF>