<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Atakan Güney on Medium]]></title>
        <description><![CDATA[Stories by Atakan Güney on Medium]]></description>
        <link>https://medium.com/@atakanguney94?source=rss-ea2705560316------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*cML0SGbFOrbb9LO2FYsnbQ.jpeg</url>
            <title>Stories by Atakan Güney on Medium</title>
            <link>https://medium.com/@atakanguney94?source=rss-ea2705560316------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:12:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atakanguney94/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Simple Reasoning Explanation on Linked Data]]></title>
            <link>https://medium.com/@atakanguney94/a-simple-reasoning-explanation-on-linked-data-cdd1cf4992cd?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdd1cf4992cd</guid>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[linked-data]]></category>
            <category><![CDATA[reasoning]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 18:35:56 GMT</pubDate>
            <atom:updated>2019-12-31T18:35:56.987Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I want to go deeper into linked data. Previously, we have mentioned about how to run the basics of RDF and running SPARQL queries. For a brief introduction to the RDF model and SPARQL language please read our previous blog post.</p><p><a href="https://medium.com/@atakanguney94/introduction-to-resource-description-framework-and-sparql-rdf-101-5857f4a6a8a6">Introduction to Resource Description Framework and SPARQL(RDF 101)</a></p><p>Before diving deeper, let’s look at what we will look in this blog post.</p><ol><li><em>What is reasoning in the context of Semantic Web ?</em></li><li><em>An example of reasoner: EYE</em></li><li><em>Basic reasoning examples with EYE</em></li><li><em>Conclusion</em></li></ol><p>Ok, let’s dive deeper 🚀</p><h4><strong>What Is Reasoning In The Context Of Semantic Web ?</strong></h4><p>As you would remember from the previous post mentioned above, RDF triples represent a graph corresponding to relationships between a <em>subject</em> and an <em>object</em> and the relation corresponds to a <em>predicate</em>. So, when we are dealing with a small amount of data, it is okey to state each relation explicitly but if we have huge amount of data, it is a real pain in the neck to write every triple. This is where a reasoner takes its place and does the jobs on behalf of us.</p><p>Formally speaking, a reasoner or semantic reasoner is a piece of software able to infer logical consequences from a set of asserted facts or axioms.[1]</p><p>See the below image to illustrate, where stands a reasoner in the world of the Semantic Web</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*AC8gj9OK5ywHqX7ln1TU5Q.png" /></figure><h4><strong>An Example Of Reasoner: EYE</strong></h4><p>EYE, with its full name “Euler Yet another proof Engine” is free reasoner software that provides you to do reasoning on RDF storage. For detailed information and the code please visit the GitHub page of the reasoner.</p><p><a href="https://github.com/josd/eye">josd/eye</a></p><p>The EYE is basically doing the following steps:</p><ul><li>Select rule P =&gt; C</li><li>Prove P &amp; NOT(C) (backward chaining) and if it fails backtrack to 1 (it is doing backward chaining</li><li>If P &amp; NOT(C) assert C (forward chaining) and remove brake</li><li>If C = answer(A) and tactic limited-answer stop, else backtrack to 2</li><li>If brake or tactic linear-select stop, else start again at 1</li></ul><p>What basically does is that selecting a rule P, which is a triple or a group of triples and another rule C it is again defined by one or more triples. Then, it checks for P &amp; NOT(C). If that is true, than it adds triples defined in the C into database automatically.</p><p>To understand this reasoning tool more deeply, I would recommend you to read its nicely written paper[2].</p><h4><strong>Basic reasoning examples with EYE</strong></h4><p>I think, it will be clear after seeing some examples on how to do reasoning.</p><p>Let’s begin with our basic relationship: foaf:knows</p><pre><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.</pre><pre>:Atakan foaf:knows :Riza .</pre><p>Normally, foaf:knows relationship is symmetric. Therefore, it means that if I know Riza, Riza also know me. I can basically add another triple “:Riza foaf:knows :Atakan .” but as I have stated earlier, when you are dealing with huge amount of the data, it is going to be a burden. So, instead of adding the information “:Riza foaf:knows :Atakan”. Let’s define a rule:</p><pre><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.</pre><pre>{<br>    :Atakan foaf:knows :Riza.<br>}<br>=&gt;<br>{<br>    :Riza foaf:knows ppl:Atakan.<br>}.</pre><p>When you run the reasoner, it would result the following</p><pre>PREFIX : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;<br>PREFIX foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;</pre><pre>:Atakan foaf:knows :Riza.<br>:Riza foaf:knows :Atakan.</pre><p>But in this rule we only defined rule between Atakan and Riza. Hence, if we run the same reasoning rule on the following data</p><pre><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.</pre><pre>:Atakan foaf:knows :Riza.<br>:Atakan foaf:knows :Meric.</pre><p>This will result</p><pre>PREFIX : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;<br>PREFIX foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;</pre><pre>:Atakan foaf:knows :Riza.<br>:Atakan foaf:knows :Meric.<br>:Riza foaf:knows :Atakan.</pre><p>It doesn’t make much sense to have a rule for just two of them, right ? It is still a burden to write all these rules. So, this is where we should define rules with general variables. Let’s run the last data set with the following reasoning rule</p><pre><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.</pre><pre>{<br>    ?person1 foaf:knows ?person2.<br>}<br>=&gt;<br>{<br>    ?person2 foaf:knows ?person1.<br>}.</pre><p>As you can expect, this will result the following</p><pre>PREFIX : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;<br>PREFIX foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;</pre><pre>:Atakan foaf:knows :Riza.<br>:Atakan foaf:knows :Meric.<br>:Riza foaf:knows :Atakan.<br>:Meric foaf:knows :Atakan.</pre><p>So, we generalized our rule for all the subjects and objects. Moreover, we can make this deduction in a higher level. Let’s do that.</p><p>As you can imagine, there are some relationships that they share same properties. For example, “:friendsWith” and “foaf:knows”. They both are symmetric. Let’s say, they are two-way relationships. Let’s assume we have following data:</p><pre><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.</pre><pre>:Atakan foaf:knows :Riza.<br>:Atakan foaf:knows :Meric.<br>:Atakan :friendsWith :Riza.<br>:Riza :friendsWith :Selen.</pre><p>We can define a similar reasoning rule for “:friendsWith” relationship as we did for “foaf:knows”. But again, this is still a burden. Let’s define a higher relationship about “:friendsWith” and “foaf:knows”</p><pre><a href="http://twitter.com/prefix">@prefix</a> foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;.<br><a href="http://twitter.com/prefix">@prefix</a> owl: &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt;.</pre><pre>foaf:knows a owl:SymmetricProperty.<br>:friendsWith a owl:SymmetricProperty.</pre><p>So, we have common definition for “foaf:knows” and “:friendsWith”. But what is this relation: “owl:SymmetricProperty”. This is defined by the owl ontology. To see more properties, please visit this <a href="http://eulersharp.sourceforge.net/#theories">list</a>. Now, we can define our reasoning rule:</p><pre><a href="http://twitter.com/prefix">@prefix</a> owl: &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt;.</pre><pre>{<br>  ?predicate a owl:SymmetricProperty.<br>  ?subject ?predicate ?object.<br>}<br>=&gt;<br>{<br>  ?object ?predicate ?subject.<br>}.</pre><p>As you can see, we defined a rule for predicates, which type is <em>owl:SymmetricProperty.</em>Now, let’s give it a shot.</p><pre>PREFIX : &lt;<a href="http://example.org/people#">http://example.org/people#</a>&gt;<br>PREFIX foaf: &lt;<a href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt;<br>PREFIX owl: &lt;<a href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl#</a>&gt;</pre><pre>:Atakan foaf:knows :Riza.<br>:Atakan foaf:knows :Meric.<br>:Riza foaf:knows :Atakan.<br>:Meric foaf:knows :Atakan.<br>:Atakan :friendsWith :Riza.<br>:Riza :friendsWith :Selen.<br>:Riza :friendsWith :Atakan.<br>:Selen :friendsWith :Riza.<br>foaf:knows a owl:SymmetricProperty.<br>:friendsWith a owl:SymmetricProperty.</pre><p>Wolala ! We get the predicates by defining a meta rule.</p><h4>Conclusion</h4><p>Graph representation of the data is highly demanded, nowadays. RDF is a just one way to do that. But since it is a standard which is accepted by one of the most influential organization W3C[3]. So, usage of this model is growing constantly. Having these king of tools make life easier for us who are dealing with graph data sets. As the data is growing, it is hard to manage them. Therefore, instead of trying to manage the data manually, using these types of software would take lots of work from us.</p><p>To dive into more exciting tools together, stay tuned 🚀</p><p><strong>P.S</strong>: Happy new year to all ! 🎄</p><h4><strong>References</strong></h4><ol><li><a href="https://www.wikiwand.com/en/Semantic_reasoner">https://www.wikiwand.com/en/Semantic_reasoner</a></li><li><a href="http://josd.github.io/Papers/EYE.pdf">http://josd.github.io/Papers/EYE.pdf</a></li><li><a href="https://www.w3.org/RDF/">https://www.w3.org/RDF/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdd1cf4992cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inference in Graph Database]]></title>
            <link>https://medium.com/data-science/inference-in-graph-database-7203938932a0?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/7203938932a0</guid>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[ontology]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[graph-database]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Wed, 11 Dec 2019 20:44:17 GMT</pubDate>
            <atom:updated>2019-12-12T00:35:26.814Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, I will try to explain what the inference is on Semantic Web and to show how the inference can be applied in a local graph database. The outline of my blog is the following:</p><ol><li>What is Inference?</li><li>What is used for?</li><li>Types of the procedure</li><li>Graph Database and Ontology</li><li>Inference on Database</li><li>Conclusion</li></ol><h3>What is Inference?</h3><p>As described in W3 standards, the inference is briefly discovering new edges within a graph based on a given ontology. On Semantic Web, the data as modeled as triples, i.e. two resources and one relationship between them. The inference is that <strong>inferring</strong> new triples based on the data and some additional information, which may be in the form of vocabularies(ontologies) and rule sets(logic). For example, let’s say we have two sources: <em>John</em> the human and <em>Max</em> the dog and we have information that <em>John</em> <strong>has</strong> <em>Max </em>and<em> Max </em><strong>is</strong><em> Dog.</em> In addition, if we have an additional vocabulary, which includes information; <em>Dog</em> <strong>is</strong> <em>Mammal</em>. We can <strong>infer </strong>that <em>Max</em> <strong>is</strong> <em>Mammal</em> and <em>John</em> <strong>has</strong> <em>Mammal</em>.</p><h3>What is used for?</h3><p>Inference on Semantic Web is used for improving the quality of data integration on the web. It automatically provides new links within the data and analyzes the content. Similarly, it also checks for consistency of the data on the web. For example, let’s say we have the data that includes information <em>Dora</em> <strong>is</strong> <em>Cow</em> and <em>Dora</em> <strong>is</strong> <em>Carnivore.</em> If we check the animal’s ontology, it is inconsistent with that the Cows are vegetarians.</p><h3><strong>Types of the procedure</strong></h3><p>As stated, the automatic discovery of new links is done by either using vocabulary or a rule set. On the Semantic Web, vocabularies or ontologies can be described in OWL, SKOS, and RDF whereas rule sets are described in RIF. These technologies are recommendations of the W3C foundation. Additionally, the ontologies are based on class and sub-class relationships, however, rule sets are describing general rules to generate new relationships based on existing ones.</p><h3><strong>Graph Database and Ontology</strong></h3><p>We are able to store our data as graphs thanks to the new handy technologies in the database field. Especially, the Graph Databases. It is very nice to have such a powerful tool. The nicer is that we can make them more powerful by including common vocabularies, ONTOLOGIES 🚀</p><p>In my previous blog post, I described how to import an ontology into a Neo4j database by using a plugin called <a href="https://neo4j.com/labs/nsmtx-rdf/">NSMNTX — Neo4j RDF &amp; Semantics toolkit</a>. Please read first that blog post before continue.</p><p><a href="https://medium.com/@atakanguney94/a-comparison-of-label-property-graph-and-the-rdf-cd94d2943d53">A Comparison of Label Property Graph and the RDF</a></p><h3><strong>Inference on Database</strong></h3><p>In addition to importing a database, now we do inference on it. As you would remember from the previous post, we could import the ontology from an external store online. But for simplicity in this blog post, we will create our <em>Animal World </em>ontology by ourselves. Let’s do it 😅</p><pre>CREATE (a: AnimalType{authoritativeLabel: &quot;Mammals&quot;, dbLabel: &quot;Mammals&quot;})<br>CREATE (b: AnimalType{authoritativeLabel: &quot;Dog&quot;, dbLabel: &quot;Dog&quot;})<br>CREATE (c: AnimalType{authoritativeLabel: &quot;Cat&quot;, dbLabel: &quot;Cat&quot;})<br>CREATE (d: AnimalType{authoritativeLabel: &quot;Horse&quot;, dbLabel: &quot;Horse&quot;})<br>CREATE (a)&lt;-[:IS_A]-(b)<br>CREATE (a)&lt;-[:IS_A]-(c)<br>CREATE (a)&lt;-[:IS_A]-(d)</pre><p>This will produce some nodes which have the type AnimalType and they have IS_A relationship. Let’s see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*KoVe1tOEXJQLt8hhzx9BLg.png" /></figure><p>This AnimalType is telling us about relations between animals. So, now create some animal instances which are considered as Pets.</p><pre>CREATE (:Pet:Dog{name: &quot;Max&quot;})<br>CREATE (:Pet:Cat{name: &quot;Missy&quot;})<br>CREATE (:Pet:Horse{name: &quot;DulDul&quot;})</pre><p>And this will produce</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPNI3kOVHbpFx5Sv4YS2dw.png" /></figure><p>Our first inference would be getting all Mammals. So, as you can see our data consists of only three distinct nodes.</p><pre>CALL semantics.inference.nodesLabelled(&#39;Mammals&#39;,  { catNameProp: &quot;dbLabel&quot;, catLabel: &quot;AnimalType&quot;, subCatRel: &quot;IS_A&quot; }) YIELD node<br>RETURN node.name as name, labels(node) as categories</pre><p>This will return</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjwPJDsMbgeR-ksEh1-Q1w.png" /></figure><p>So, without having any relation in our database we inferred common label relation by using our vocabulary.</p><p>Now, let’s add some relations.</p><pre>MATCH (c:Cat{name: &quot;Missy&quot;})<br>MATCH (d:Dog{name: &quot;Max&quot;})<br>MATCH (h:Horse{name: &quot;DulDul&quot;})<br>CREATE(jn: Person{name: &quot;John&quot;})<br>CREATE(al: Person{name: &quot;Alex&quot;})<br>CREATE (jn)-[:LOVES]-&gt;(d)<br>CREATE (h)-[:LOVES]-&gt;(d)<br>CREATE (al)-[:LOVES]-&gt;(c)</pre><p>This will result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*E4MTcuysskCMa6qso7ib2A.png" /></figure><p>As a second kind of inference, let’s try to get all animal lovers ❤️</p><pre>MATCH (p)-[:LOVES]-&gt;(pt)<br>WHERE semantics.inference.hasLabel(pt,&#39;Mammals&#39;, { catNameProp: &quot;dbLabel&quot;, catLabel: &quot;AnimalType&quot;, subCatRel: &quot;IS_A&quot; })<br>RETURN p.name as name</pre><p>And results come…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYcpvpuY8di0aQQp2LmH1g.png" /></figure><p>Now, let’s do inference on vocabulary itself. Before that, let’s extend it a little bit</p><pre>MATCH (h:AnimalType{authoritativeLabel: &quot;Horse&quot;})<br>MATCH (d:AnimalType{authoritativeLabel: &quot;Dog&quot;})<br>MATCH (c:AnimalType{authoritativeLabel: &quot;Cat&quot;})</pre><pre>CREATE (:Film {title: &quot;A Dog&#39;s Journey&quot;})-[:HAS_SUBJECT]-&gt;(d)<br>CREATE (:Film {title: &quot;Cats&quot;})-[:HAS_SUBJECT]-&gt;(c)<br>CREATE (:Film {title: &quot;The Mustang&quot;})-[:HAS_SUBJECT]-&gt;(h)</pre><p>And visualize it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uYMzbDFN624NVa-Z7ZOIug.png" /></figure><p>We added some movies, which has subject as animals. Our next inference type would be node in category type of inference. Let’s try to get all films, which has subject as Mammals</p><pre>MATCH (cat:AnimalType { authoritativeLabel: &quot;Mammals&quot;})<br>CALL semantics.inference.nodesInCategory(cat, { inCatRel: &quot;HAS_SUBJECT&quot;, subCatRel: &quot;IS_A&quot;}) yield node<br>return node.title as film</pre><p>And…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nRItZsUspnPTCbMeidhROQ.png" /></figure><p>We got what we asked for 😈</p><p>Now, let’s see our last inference type. Our data takes place, again. But before that let’s define other AnimalType, which is different than Mammals: Fish and Shark. Similarly, let’s add another IS_A relationship.</p><pre>CREATE (f:AnimalType{authoritativeLabel: &quot;Fish&quot;, dbLabel: &quot;Fish&quot;})<br>CREATE (sh:AnimalType{authoritativeLabel: &quot;Shark&quot;, dbLabel: &quot;Shark&quot;})</pre><pre>CREATE (f)&lt;-[:IS_A]-(sh)</pre><p>And create a film about Shark</p><pre>MATCH (s: AnimalType{authoritativeLabel: &quot;Shark&quot;})</pre><pre>CREATE (:Film {title: &quot;Frenzen&quot;})-[:HAS_SUBJECT]-&gt;(s)</pre><p>Our final vocabulary will look like the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbPUZMSLovlvLtDRZO5GMQ.png" /></figure><p>Now add new information into our data</p><pre>MERGE (p:Person { name : &quot;John&quot;}) with p<br>MATCH (film1:Film { title : &quot;Cats&quot; })<br>MATCH (film2:Film { title : &quot;Frenzen&quot; })<br>WITH p, film1, film2<br>CREATE (film1)&lt;-[:LIKES]-(p)-[:LIKES]-&gt;(film2)</pre><p>See the corresponding data in our graph database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*ZxC0MfK32IKPusE20pfQ8A.png" /></figure><p>So, our person John likes both Cats and Frenzen. Let’s query which of the films that John likes has subject about Fish.</p><pre>MATCH (fish:AnimalType { authoritativeLabel: &quot;Fish&quot;})<br>MATCH (:Person { name : &quot;John&quot;})-[:LIKES]-&gt;(b:Film)<br>WHERE semantics.inference.inCategory(b,fish,{ inCatRel: &quot;HAS_SUBJECT&quot;, subCatRel: &quot;IS_A&quot;})<br>RETURN b.title as title</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*no_mY7pT3qwaLGtyXBNIVQ.png" /></figure><p>Yeah, we got our result 💪</p><h3><strong>Conclusion</strong></h3><p>Recently, NoSQL databases attracted attention instead of relational databases. Among various kinds of NoSQL databases, Graph-based ones are getting more attraction in time. In my humble opinion, it will be valuable including external information onto a Graph Database and managing, analyzing and proof checking it. Importing ontologies is a nice and compact way of doing that. I hope you enjoyed the blog. For more interesting tools, stay tuned 🚀</p><h3><strong>References</strong></h3><ul><li><a href="https://www.w3.org/standards/semanticweb/inference">https://www.w3.org/standards/semanticweb/inference</a></li><li><a href="https://neo4j.com/docs/labs/nsmntx/current/inference/">https://neo4j.com/docs/labs/nsmntx/current/inference/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7203938932a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/inference-in-graph-database-7203938932a0">Inference in Graph Database</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comparison of Label Property Graph and the RDF]]></title>
            <link>https://medium.com/@atakanguney94/a-comparison-of-label-property-graph-and-the-rdf-cd94d2943d53?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd94d2943d53</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[semantic-analysis]]></category>
            <category><![CDATA[neo4j]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 23:12:50 GMT</pubDate>
            <atom:updated>2019-11-27T23:12:50.678Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will briefly explain what the Labeled Property Graph is and what are the differences and similarities with RDF(Resource Description Framework) and I will try to show how to map those two in a well-known graph database: Neo4j.</p><h4>Introduction</h4><p>First of all, if you are not familiar with RDF, you can read my previous humble blog post.</p><p><a href="https://medium.com/@atakanguney94/introduction-to-resource-description-framework-and-sparql-rdf-101-5857f4a6a8a6">Introduction to Resource Description Framework and SPARQL(RDF 101)</a></p><p>Secondly, if you are not familiar with the graph, you can look at the following two great blog posts from <a href="https://medium.com/u/b9f04b01cca9">Selen Parlar</a>:</p><ul><li><a href="https://medium.com/analytics-vidhya/a-brief-look-at-graph-databases-d65b00f9c349">A Brief Look at Graph Databases</a></li><li><a href="https://medium.com/analytics-vidhya/neo4j-friends-edition-b7b139cd2834">Neo4j: Friends Edition</a></li></ul><h4>The Label Property Graph</h4><p>So, the label property graph is one of a few data representation approaches, that is utilized in graph databases. That is, the data is organized as nodes, relationships, and properties. A node is an entity that can have zero or more properties. Properties are key-value pairs. Finally, relationships link two nodes in a directed way. Moreover, relations may also have zero or more properties. Let’s see an example from a sample dataset in Neo4j.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*pj7tFGFImeHMedkcXNSmKg.png" /><figcaption>Movie Data Set Example of Neo4j</figcaption></figure><p>Let’s see a node’s and a relationship’s properties in this data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgjkhOpa6TyiIXiAQSVy_w.png" /><figcaption>On the left-bottom you see the properties of the node “Jack Nicholson”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXZzHyzC5rK8k7LJGYNJMQ.png" /><figcaption>Now, you see the properties of a relationship</figcaption></figure><h4>Differences between RDF and LPG</h4><p>As you may think, the graph represented by RDF triples can be converted into a property graph. But why do we need this conversion? There are certain advantages of the property graph over the RDF graph. First, the RDF triples are easy statements to produce but when the query takes place it may give a headache. Secondly, since relationships in the property graphs can have properties, this may simplify the modeling process. Thirdly, relationships that are repeated are counted as unique, e.g. a person like another person only one in the RDF representation. Of course, these problems can be worked around by the modeling techniques but overall, it seems to have the property graph more intuitive. These advantages of the property graphs arise a question: Why do we use the RDF triples? Because they are the so easy way to transfer and save relationships and there are already a certain amount of the RDF data sources. In addition, the property graphs may be a burden on the applications. For further comparison of these two different ways to represent graphs, I suggest watching the following talk.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSvwIqzaoYMo%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSvwIqzaoYMo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSvwIqzaoYMo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d034dea85649862e0dd6a057232040c7/href">https://medium.com/media/d034dea85649862e0dd6a057232040c7/href</a></iframe><h4>Example of both</h4><p>Now, let’s dive into a little bit and see how data can be represented in both the RDF and LPG. Do you remember our funny RDF data 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*OSndsO2wwNpMUzsCL3WtFg.png" /></figure><p>And in an RDF store, you would get the following triple list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGBUHg30uT2OedI8wnS4xQ.png" /></figure><p>This is a local RDF store server called RDF4j you can try it by following the instructions <a href="https://rdf4j.org/documentation/server-workbench-console/">here</a>.</p><p>Because I showed how to query RDF data, I skip this time and do the same query on the property graph.</p><pre>MATCH (n:Person) RETURN n.name</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4gNxkLGxCXj_vmU88g8RTw.png" /><figcaption>Query results in Neo4j</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLFDxliOwQ66-4tXeawWrg.png" /><figcaption>Corresponding SPARQL results in rdf4j</figcaption></figure><h4>Mapping RDF to Property Graph vice versa</h4><p>As stated above, the RDF is the most used relation representation framework in the Web and there are billions of sources that produce RDF data. To be linked to these huge linked data, somehow we should consume and produce RDF representation of our graph database. Special thanks to NSMNTX, we can easily import-export RDF data sets and construct RDF endpoints on Neo4j. The NSMNTX is a plugin for Neo4j, which enables the use of RDF in the database. For detailed information, you can set up the plugin and follow their nice <a href="https://neo4j.com/docs/labs/nsmntx/current/">documentation</a>.</p><p>Before jumping into the mapping functionality of NSMNTX, let’s start creating a sample property graph with Cypher.</p><pre>CREATE(p1: Person{name: &quot;Atakan&quot;, age: 25})<br>CREATE(p2: Person{name: &quot;Riza&quot;})<br>CREATE(p3: Person{name: &quot;Selen&quot;}<br>CREATE(p4: Person{name: &quot;Suzan&quot;})</pre><pre>CREATE (p1)-[:knows]-&gt;(p2)<br>CREATE (p3)-[:knows]-&gt;(p4)<br>CREATE (p4)-[:knows]-&gt;(p3)</pre><p>This Cypher code snippet should create following graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*154lVX-m8K70q-KXSaHIJw.png" /></figure><p>Let’s integrate RDF data into our graph. We first need to define schemas.</p><pre>call semantics.mapping.addSchema(&quot;<a href="http://schema.org/">http://schema.org/</a>&quot;, &quot;Person&quot;, &quot;Person&quot;)<br>call semantics.mapping.addSchema(&quot;http://schema.org/Person#&quot;, &quot;knows&quot;, &quot;knows&quot;)<br>call semantics.mapping.addSchema(&quot;http://schema.org/Person#&quot;, &quot;friendOf&quot;, &quot;colleagues&quot;)</pre><p>After calling these you should be able to see following schema list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUqmRoXW0N124-SErAio2g.png" /></figure><p>And the general graph will change as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*Qtu0W7C8IK7Zu44WsXjKFQ.png" /></figure><p>So, it adds mappings into the graph.</p><h4>Conclusion</h4><p>The graph databases are so helpful to store data that have complex relationships among them. In addition, these databases provide lots of effective graph algorithms to analyze the data. Neo4j is one of the most used graph databases and its integration with RDF data would lead to more deep analysis and it may be worth to connect your storage with linked data through Neo4j. For more interesting tools, please stay tuned 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd94d2943d53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Bayesian Belief Networks]]></title>
            <link>https://medium.com/data-science/introduction-to-bayesian-belief-networks-c012e3f59f1b?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/c012e3f59f1b</guid>
            <category><![CDATA[bayesian-networks]]></category>
            <category><![CDATA[social-network-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[probabilistic-graphical]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 00:14:13 GMT</pubDate>
            <atom:updated>2019-11-30T15:02:47.876Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is a Bayesian Belief Network?</h3><p>Bayesian Belief Network or Bayesian Network or Belief Network is a Probabilistic Graphical Model (PGM) that represents conditional dependencies between random variables through a Directed Acyclic Graph (DAG).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yBqj9uNUlYLmTQzLcvjFEQ.png" /><figcaption>An Example Bayesian Belief Network Representation</figcaption></figure><p>Today, I will try to explain the main aspects of Belief Networks, especially for applications which may be related to Social Network Analysis(SNA). In addition, I will show you an example implementation of this kind of network.</p><h3>What do we use the Bayesian Networks for?</h3><p>Bayesian Networks are applied in many fields. For example, disease diagnosis, optimized web search, spam filtering, gene regulatory networks, etc. And this list can be extended. The main objective of these networks is trying to understand the structure of causality relations. To clarify this, let’s consider a disease diagnosis problem. With given symptoms and their resulting disease, we construct our Belief Network and when a new patient comes, we can infer which disease or diseases may have the new patient by providing probabilities for each disease. Similarly, these causality relations can be constructed for other problems and inference techniques can be applied to interesting results.</p><h3>Quick Probability Review</h3><p>Before continue, to refresh our memories let me give you the definition of conditional property. Conditional probability is the probability of a random variable when some other random variable is given. It is shown by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*mIrs-uL2Zm11aQmGaE52ag.png" /></figure><p>If these two random variables are dependent,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*ZaCtKdDqIwSFijvgd3y5VQ.png" /></figure><p>If they are independent, then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*YdVCoDf1ULfEEodeRRqq3g.png" /></figure><h3>Mathematical Definition of Belief Networks</h3><p>The probabilities are calculated in the belief networks by the following formula</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*jDJCOjeKKQ9EBKhl_uAc2w.png" /></figure><p>As you would understand from the formula, to be able to calculate the joint distribution we need to have conditional probabilities indicated by the network. But further that if we have the joint distribution, then we can start to ask interesting questions. For example, in the first example, we ask for the probability of “RAIN” if “SEASON” is “WINTER” and “DOG BARK” is “TRUE”.</p><h3>Python Example of Belief Network</h3><p>So, I think this enough for theory and let’s see some real example with my current favorite programming language Python ❤️ Before continue, you can find the Jupyter Notebook I have written <a href="https://gitlab.com/atakanguney/social-semantic-web-examples/blob/master/bayesian-nets/BBNConstructionExample.ipynb">here</a>.</p><pre># create the nodes<br>season = BbnNode(Variable(0, &#39;season&#39;, [&#39;winter&#39;, &#39;summer&#39;]), [0.5, 0.5])<br>atmos_pres = BbnNode(Variable(1, &#39;atmos_press&#39;, [&#39;high&#39;, &#39;low&#39;]), [0.5, 0.5])<br>allergies = BbnNode(Variable(2, &#39;allergies&#39;, [&#39;allergic&#39;, &#39;non_alergic&#39;]), [0.7, 0.3, 0.2, 0.8])<br>rain = BbnNode(Variable(3, &#39;rain&#39;, [&#39;rainy&#39;, &#39;sunny&#39;]), [0.9, 0.1, 0.7, 0.3, 0.3, 0.7, 0.1, 0.9])<br>grass = BbnNode(Variable(4, &#39;grass&#39;, [&#39;grass&#39;, &#39;no_grass&#39;]), [0.8, 0.2, 0.3, 0.7])<br>umbrellas = BbnNode(Variable(5, &#39;umbrellas&#39;, [&#39;on&#39;, &#39;off&#39;]), [0.99, 0.01, 0.80, 0.20, 0.20, 0.80, 0.01, 0.99])<br>dog_bark = BbnNode(Variable(6, &#39;dog_bark&#39;, [&#39;bark&#39;, &#39;not_bark&#39;]), [0.8, 0.2, 0.1, 0.9])<br>cat_mood = BbnNode(Variable(7, &#39;cat_mood&#39;, [&#39;good&#39;, &#39;bad&#39;]), [0.05, 0.95, 0.95, 0.05])<br>cat_hide = BbnNode(Variable(8, &#39;cat_hide&#39;, [&#39;hide&#39;, &#39;show&#39;]), [0.20, 0.80, 0.95, 0.05, 0.95, 0.05, 0.70, 0.30])</pre><pre>bbn = Bbn() \<br>    .add_node(season) \<br>    .add_node(atmos_pres) \<br>    .add_node(allergies) \<br>    .add_node(rain) \<br>    .add_node(grass) \<br>    .add_node(umbrellas) \<br>    .add_node(dog_bark) \<br>    .add_node(cat_mood) \<br>    .add_node(cat_hide) \<br>    .add_edge(Edge(season, allergies, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(season, umbrellas, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(season, rain, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(atmos_pres, rain, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(rain, grass, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(rain, umbrellas, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(rain, dog_bark, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(rain, cat_mood, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(dog_bark, cat_hide, EdgeType.DIRECTED)) \<br>    .add_edge(Edge(cat_mood, cat_hide, EdgeType.DIRECTED))</pre><p>We first described our nodes with conditional probabilities. You should notice that I skipped some possible state values for simplicity. For example, <em>season </em>variable take other values “spring” and “autumn”. So, the idea is the same.</p><p>Not, let’s check our network is constructed properly or not.</p><pre>with warnings.catch_warnings():<br>    warnings.simplefilter(&#39;ignore&#39;)<br>    <br>    graph = convert_for_drawing(bbn)<br>    pos = nx.nx_agraph.graphviz_layout(graph, prog=&#39;neato&#39;)</pre><pre>plt.figure(figsize=(20, 10))<br>    plt.subplot(121) <br>    labels = dict([(k, node.variable.name) for k, node in bbn.nodes.items()])<br>    nx.draw(graph, pos=pos, with_labels=True, labels=labels)<br>    plt.title(&#39;BBN DAG&#39;)</pre><p>This code snippet would result the following graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*-0M1BRAa2G3sdsxxPG5yyA.png" /></figure><p>So, you see that this network fits with my fancy drawing in the beginning. Now, let’s do some inference on this Belief Network.</p><pre># convert the BBN to a join tree<br>join_tree = InferenceController.apply(bbn)</pre><pre># insert an observation evidence<br>ev = EvidenceBuilder() \<br>    .with_node(join_tree.get_bbn_node_by_name(&#39;season&#39;)) \<br>    .with_evidence(&#39;winter&#39;, 1.0) \<br>    .build()</pre><pre>join_tree.set_observation(ev)</pre><pre># print the marginal probabilities<br>for node in join_tree.get_bbn_nodes():<br>    potential = join_tree.get_bbn_potential(node)<br>    print(node)<br>    print(potential)<br>    print(&#39;---------------------&gt;&#39;)</pre><p>This code snippet basically give evidence to the network which is the season is winter with 1.0 probability. According to this evidence, when we do the inference, we get following results.</p><pre>0|season|winter,summer<br>0=winter|1.00000<br>0=summer|0.00000<br>---------------------&gt;<br>2|allergies|allergic,non_alergic<br>2=allergic|0.70000<br>2=non_alergic|0.30000<br>---------------------&gt;<br>3|rain|rainy,sunny<br>3=rainy|0.80000<br>3=sunny|0.20000<br>---------------------&gt;<br>4|grass|grass,no_grass<br>4=grass|0.70000<br>4=no_grass|0.30000<br>---------------------&gt;<br>1|atmos_press|high,low<br>1=high|0.50000<br>1=low|0.50000<br>---------------------&gt;<br>5|umbrellas|on,off<br>5=on|0.95200<br>5=off|0.04800<br>---------------------&gt;<br>6|dog_bark|bark,not_bark<br>6=bark|0.66000<br>6=not_bark|0.34000<br>---------------------&gt;<br>7|cat_mood|good,bad<br>7=good|0.23000<br>7=bad|0.77000<br>---------------------&gt;<br>8|cat_hide|hide,show<br>8=hide|0.87150<br>8=show|0.12850<br>---------------------&gt;</pre><p>When we add further evidence, like the dog is not barking</p><pre># convert the BBN to a join tree<br>join_tree = InferenceController.apply(bbn)</pre><pre># insert an observation evidence<br>ev = EvidenceBuilder() \<br>    .with_node(join_tree.get_bbn_node_by_name(&#39;season&#39;)) \<br>    .with_evidence(&#39;winter&#39;, 1.0) \<br>    .build()</pre><pre>ev2 = EvidenceBuilder() \<br>    .with_node(join_tree.get_bbn_node_by_name(&#39;dog_bark&#39;)) \<br>    .with_evidence(&#39;not_bark&#39;, 1.0) \<br>    .build()</pre><pre>join_tree.set_observation(ev)<br>join_tree.set_observation(ev2)</pre><pre># print the marginal probabilities<br>for node in join_tree.get_bbn_nodes():<br>    potential = join_tree.get_bbn_potential(node)<br>    print(node)<br>    print(potential)<br>    print(&#39;---------------------&gt;&#39;)</pre><p>We get the following inference results</p><pre>0|season|winter,summer<br>0=winter|1.00000<br>0=summer|0.00000<br>---------------------&gt;<br>2|allergies|allergic,non_alergic<br>2=allergic|0.70000<br>2=non_alergic|0.30000<br>---------------------&gt;<br>3|rain|rainy,sunny<br>3=rainy|0.47059<br>3=sunny|0.52941<br>---------------------&gt;<br>4|grass|grass,no_grass<br>4=grass|0.53529<br>4=no_grass|0.46471<br>---------------------&gt;<br>1|atmos_press|high,low<br>1=high|0.39706<br>1=low|0.60294<br>---------------------&gt;<br>5|umbrellas|on,off<br>5=on|0.88941<br>5=off|0.11059<br>---------------------&gt;<br>6|dog_bark|bark,not_bark<br>6=bark|0.00000<br>6=not_bark|1.00000<br>---------------------&gt;<br>7|cat_mood|good,bad<br>7=good|0.52647<br>7=bad|0.47353<br>---------------------&gt;<br>8|cat_hide|hide,show<br>8=hide|0.83162<br>8=show|0.16838<br>---------------------&gt;</pre><p>Do you see the difference? 😆 Lots of probability values changed when we add the evidence related to the barking. It is definitely a silly example but nice to get intuition.</p><h3>How to use Bayesian Networks in SNA ?</h3><p>Bayesian Networks are very powerful tools to understand structure of causality relations between variables. Once you designed your model, even with a small data set, it can tell you various things. The question in this part is how can get benefit of Bayesian Nets in SNA. The answer is not unique, but let’s start with a profound idea. In SNA, we try to understand structure of a social network. In addition, we try to understand the importance of the nodes. But we don’t know that what the results are of our importance metrics. This is the point where Bayesian Networks take place. For example, if you think the importance of a node is caused by Degree Centrality and Link Centrality, you may have the following network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRfBHC4MWggzSL9bf7wYCg.png" /></figure><p>This is a very naive Bayesian Network. In addition to determine the importance of the nodes, further application may be searching for some specific type of nodes. Let’s consider a Social Network in which there are some people who are potential leaders and I want to search for them. Consider the following graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8xZf0RDHJI2ikHh8Ve8Wg.png" /></figure><p>This a bit more complicated network will help us to determine uncertainty of the nodes related to be a leadership.</p><p>Another application would be inferring the links. The new links may be inferred from existing ones. For example, from the group membership in a Social Network, likely membership link can be inferred. What I meant is that we can model a new link between users and groups by considering existing links. See the following model diagram</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUKccly-cuXiF0ZvQCOY3A.png" /></figure><p>So, these are some basic examples of how Bayesian Networks can be applied in SNA. This topic is not studied very well but I think it might be very useful to study further.</p><h3>Conclusion</h3><p>The hard thing about Bayesian Networks is designing. Especially, when you thing of SNA, constructing mapping from Social Network with a Bayesian Network is art than science 😃 But once you did the art job and designed your model very well, these handy tools can tell you a lot of things. As we know that Bayesian Networks are applied in vast kinds of ares. It worked very well in most of the cases. Therefore, I strongly believe that we can make very profound inferences on Social Networks, as well.</p><p>For further investigation with SNA and Bayesian Networks, please stay tuned 🚀</p><h3>References</h3><ol><li><a href="https://www.researchgate.net/publication/245449293_Applications_of_Bayesian_Belief_Networks_in_Social_Network_Analysis">Koelle, David &amp; Pfautz, Jonathan &amp; Farry, Michael &amp; Cox, Zach &amp; Catto, Geoffrey &amp; Campolongo, Joseph. (2006). Applications of Bayesian Belief Networks in Social Network Analysis.</a></li><li><a href="https://www.edureka.co/blog/bayesian-networks/">https://www.edureka.co/blog/bayesian-networks/</a></li><li>Drawings are drawn in <a href="https://sketch.io/">sketch.io</a></li><li>The sample network is taken from <a href="https://www.probabilisticworld.com/bayesian-belief-networks-part-1/">https://www.probabilisticworld.com/bayesian-belief-networks-part-1/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c012e3f59f1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/introduction-to-bayesian-belief-networks-c012e3f59f1b">Introduction to Bayesian Belief Networks</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Standardization of Annotations]]></title>
            <link>https://medium.com/@atakanguney94/the-standardization-of-annotations-3c9a5115f5fe?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c9a5115f5fe</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[w3c]]></category>
            <category><![CDATA[standards]]></category>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[annotations]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Thu, 14 Nov 2019 01:33:45 GMT</pubDate>
            <atom:updated>2019-11-14T01:33:45.119Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Motivation</strong></h3><p>As the World Wide Web is growing unprecedentedly, managing its content is becoming harder. As you may guess that it was not a situation that only bothers me but it bothered clever people who work for WWW. The World Wide Web Consortium has the standardization for Web Annotations. In fact, the aim is to have a common standard for all kinds of annotations.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fm2cJNDs7y2Y%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dm2cJNDs7y2Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fm2cJNDs7y2Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/19b22004c1834fabb107d38bc546cf08/href">https://medium.com/media/19b22004c1834fabb107d38bc546cf08/href</a></iframe><p>In this blog, I will try to cover the following issues:</p><ol><li>What is an Annotation?</li><li>What is the W3C’s standardization for the Annotation?</li><li>What are some of the tools to annotate on the Web?</li><li>Quick demo for how to include an annotation tool for a website.</li><li>Conclusion</li></ol><h4><strong>What is an Annotation?</strong></h4><p>An Annotation is basically relating some content which may be in the format of the text, image, video, etc. with other content which can be also in various formats. For example, when you watch a movie or see a picture, you can annotate a square in the picture with a text, let’s say you are watching a video on some video-stream website and you recognized somebody but you don’t know her name but you are curious about her. Then, if the video-stream provider allows users to annotate videos and if somebody did annotate the girl with her name, you will be happy to learn her name. This example shows how information can be transported between people by using annotations.</p><p>On the other hand, if this annotation mechanism is isolated in the video-stream website, other websites may not understand the structure of this annotation and cannot use it. Moreover, can you imagine that all the websites create their own annotation structure? What a mass of useless data for both a human analyst or a machine interpreter. Hence, to make these annotations valuable and incorporable with each other we need to have a good STANDARDIZATION 🚀</p><h4><strong>What is the W3C’s standardization for the Annotation?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*6HfUCXrjPc4eY3h5RfLm-A.png" /><figcaption>A Directed Graph Representation of Annotation</figcaption></figure><p>I have stated at the beginning of this blog that I am not the only guy who thought about this annotation data valuable. Therefore, the W3C has defined a standardization for annotations. Let’s look at what they have defined for us 😃</p><ol><li><a href="https://www.w3.org/TR/annotation-model/">The Web Annotation Data Model</a></li><li><a href="https://www.w3.org/TR/annotation-vocab/">The Web Annotation Vocabulary</a></li><li><a href="https://www.w3.org/TR/annotation-protocol/">The Web Annotation Protocol</a></li><li><a href="https://www.w3.org/TR/annotation-html/">Embedding Web Annotations in HTML</a></li><li><a href="https://www.w3.org/TR/selectors-states/">Selectors and States</a></li></ol><p>To begin with, the Data Model describes a well-structured data model for the usage of applications on different stacks. Secondly, the Vocabulary specifies the set of RDF classes, predicates and named entities that are used by the Annotation Data Model. Third, the Annotation Protocol defines the transport mechanism for creating and managing annotations such that the method conforms with the Web Architecture and REST best practices. Fourth, the first three standardizations defined a serialization of the Model, JSON-LD. This one gives available serialization methods for integrating annotations into an HTML page. Finally, the document for selectors and states describes a common structure and syntax to express and possibly combine selectors.</p><h4>What are some of the tools to annotate on the Web?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0GpO1bs9pelcB8sZ4uQeg.png" /></figure><p>There are lots of ready tools that provide annotation. Let’s see some of them.</p><ol><li><a href="https://web.hypothes.is/start/">Hypothes</a></li><li><a href="https://thepund.it/">Pundit</a></li><li><a href="http://annotum.org/">Annotum</a></li><li><a href="http://goodreader.com/index.html">Goodreader</a></li></ol><p>…</p><p>The <a href="https://docs.google.com/spreadsheets/d/1f86L7vgHUW9wSLNNSunhjmtxtg6KlCOVpHGKbqUzW-Y/edit#gid=0">list</a> goes on. These tools are allowing to annotate data on the web. They provide you an annotation server. They keep you annotations in their storage systems or your local as you keep the annotations for yourselves 😃 As far as I am concerned, I liked Hypothes. You can register online for free and get started to annotate data online. It is very easy to use.</p><p>Besides these tools to annotate, what if we want to create a website which serves its guests with an annotation system. For sure, there are some libraries but let’s list two of them.</p><ul><li><a href="https://annotator.apache.org/">Apache Annotator</a></li><li><a href="http://annotatorjs.org/">Annotator.js</a></li></ul><p>These two tools enable us to integrate annotation functionality into our websites. As you will realize, at the time of the present, the Apache project in the incubator state. So, they are trying to develop it. But Annotate.js has stable release and today we will see how to use it for basic usage.</p><h4>Quick demo for how to include an annotation tool for a website.</h4><p>Before continue, you can see the example in my GitLab <a href="https://gitlab.com/atakanguney/social-semantic-web-examples/tree/master/annotation-example">repo</a>. It is a very basic React app that you can clone. The below code snippet is content of `App.js` file.</p><pre>import React from &#39;react&#39;;<br>import &#39;./App.css&#39;;<br>import annotator from &#39;annotator&#39;;<br><br>function App() {<br>  var app = new annotator.App();<br>  app.include(annotator.ui.main, {element: document.body});<br>  app.start();<br>  return (<br>      &lt;div className=&quot;App&quot;&gt;<br>        &lt;header className=&quot;App-header&quot;&gt;<br>          &lt;h1&gt;<br>            My Awesome Annotative Web Site<br>          &lt;/h1&gt;<br>        &lt;/header&gt;<br>        &lt;p&gt;<br>          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi hendrerit sapien ligula, vel feugiat est tincidunt a. Cras a sodales felis. Integer eleifend tempor urna at accumsan. Donec condimentum iaculis nunc ut dapibus. Integer sed arcu dolor. Nullam ullamcorper neque urna, eu vulputate nibh fermentum et. Mauris ac dignissim lectus. Sed facilisis tellus vel accumsan commodo. Donec facilisis ipsum tellus.<br>        &lt;/p&gt;<br>        &lt;p&gt;<br>          Nam lobortis eleifend metus, facilisis auctor nulla semper id. Fusce vitae facilisis nisl, eu porta purus. Morbi scelerisque, purus sit amet placerat varius, est nisl viverra quam, quis vehicula purus neque vestibulum nulla. Fusce eleifend finibus scelerisque. Duis sagittis non diam vitae pretium. Proin malesuada finibus vehicula. Suspendisse tempor mauris ut libero tincidunt suscipit.<br>        &lt;/p&gt;<br>        &lt;p&gt;<br>          Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam et felis magna. Sed laoreet nunc sit amet velit convallis euismod sit amet in tellus. Donec viverra egestas porta. Sed lacinia enim ac pulvinar tristique. Ut eget imperdiet nibh. Nam ipsum magna, imperdiet id urna et, lobortis porttitor lectus. Integer venenatis dolor odio, nec aliquam tellus consectetur eget.<br>        &lt;/p&gt;<br>        &lt;p&gt;<br>          In ac posuere ex. Nunc iaculis lectus blandit ante mattis euismod. Duis non mattis sem. Proin nec elit in nunc varius posuere id quis dui. Sed at lacus congue lectus volutpat ultrices sed at nisl. Etiam sed mi hendrerit, ultrices nibh et, pellentesque massa. Pellentesque et felis dictum, dapibus mauris et, varius nulla. Nulla condimentum rutrum egestas. Donec ac gravida arcu. Suspendisse in malesuada felis, ut iaculis arcu. Nunc euismod metus nec ex tristique gravida. Quisque accumsan accumsan viverra.<br>        &lt;/p&gt;<br>        &lt;p&gt;<br>          Suspendisse suscipit, ligula eu lobortis malesuada, enim erat fermentum tellus, non placerat justo lorem ut arcu. Maecenas massa erat, cursus vel laoreet nec, gravida et metus. Fusce tempus nunc massa, sit amet egestas orci tempus non. Nulla tempor metus ac dapibus congue. Mauris ornare, augue ac consequat suscipit, nulla est lobortis urna, cursus molestie lorem nisi quis purus. Curabitur at fermentum sapien. Fusce convallis accumsan enim, sed rhoncus ante fringilla eu. Curabitur egestas vitae ex eu ultricies. Aenean eu blandit ex. Quisque id scelerisque nulla. Sed rutrum libero efficitur pretium feugiat. Integer nec lacus tortor. Cras auctor enim a condimentum ultricies. <br>        &lt;/p&gt;<br>      &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>You can observe how easy to add basic annotation functionality. So, is it really that easy ?</p><p>First of all, let’s look at what the content is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nylBSoaH1VhhKdISRFj4og.png" /><figcaption>A `Lorem Ipsum` content 🚀</figcaption></figure><p>Second, select a text part in the content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KI9jD5O7ls6itx7IjonnA.png" /></figure><p>Wohaa ! We see a button there 😃 Click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQIhw59XBOVEDROr9GMg8Q.png" /></figure><p>Third, write your annotation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IpawZ4X0iQbU1Rr9zg6vhA.png" /></figure><p>Finally, save it and see your annotation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7QXj9HSKcrCqZ_-CMLuRBg.png" /></figure><p>So, this is a very basic annotation tool to enable your website to provide annotations. For applying the W3C standards, follow my next blogs, so we can dig it more 😅</p><h4>Conclusion</h4><p>From the beginning of the Web, people are producing content and share on the Web. Most of the time, we encounter redundancy. What I meant is people generate the same information in different places. In fact, they also produce complementary content. Somehow, they need to relate these different contents to build up useful massive data that synchronize together and makes the value.</p><p>For the more interesting tools, please stay tuned 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c9a5115f5fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Introduction into GDELT: Global Database of Events, Language and Tone]]></title>
            <link>https://medium.com/@atakanguney94/a-brief-introduction-into-gdelt-global-database-of-events-language-and-tone-e96b0c64d03a?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/e96b0c64d03a</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[gdelt]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[news]]></category>
            <category><![CDATA[analysis]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Sun, 27 Oct 2019 12:50:10 GMT</pubDate>
            <atom:updated>2019-10-27T12:50:10.330Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, I want to introduce you to an interesting project which I have seen almost three years ago: GDELT. The project aims to create a common database of knowledge produced in every corner of the globe. Similarly, their goal is to collect news data from local services. First and foremost motivation is that not relying on only global news agencies like “Reuters”, “CNN” or “BBC” but getting news from local news resources and collecting them into one platform.</p><p>First of all, as you can imagine, the data produced by all the resources around the world would be amazingly huge. At that point, the big data technologies come into the scene and give opportunities to analyze this amount of data. I will try to explain some of the various possible usages of GDELT tools.</p><ol><li><strong>A Quick Story of GDELT</strong></li></ol><p>GDELT is founded by <a href="https://www.kalevleetaru.com/">Kalev H. Leetaru</a> who has been studying the web and trying to understand how it shapes our world today. The current database includes the news from January 1, 1979, until today. Now, you can reach news even on the hourly scale. In addition, GDELT gets data from all around the world in more than 100 different languages. For a more detailed story of it, please read <a href="https://www.gdeltproject.org/about.html">this</a>.</p><p><strong>2. GDELT Analysis, Querying and Accessing the Data</strong></p><p>There are three options to access and/or analyze the data.</p><ul><li><strong>GDELT Analysis Service</strong></li></ul><p>This is the most suitable choice for the first look at how to analyze GDELT data.</p><ul><li><strong>Google BigQuery</strong></li></ul><p>It serves under Google API services. So, you need to create an application within your Google developer console and to enable BigQuery service. Then, you can run SQL queries on the GDELT data.</p><ul><li><strong>Raw Data Files</strong></li></ul><p>Since data is huge, I don’t recommend to download raw files unless you have computers with huge storage capacity.</p><p>I will go deep into the GDELT Analysis Service in the rest of the blog because this blog attempts to introduce the idea.</p><p><strong>3. GDELT Analysis Service</strong></p><p>There are various analysis tools under the GDELT Analysis Service. Let’s look at the list</p><ul><li><a href="http://analysis.gdeltproject.org/module-event-exporter.html">Event Exporter</a></li><li><a href="http://analysis.gdeltproject.org/module-event-geonet.html">Event Geographic Network</a></li><li><a href="http://analysis.gdeltproject.org/module-event-heatmapper.html">Event Heatmapper</a></li><li><a href="http://analysis.gdeltproject.org/module-event-timeline.html">Event Timeline</a></li><li><a href="http://analysis.gdeltproject.org/module-event-timemapper.html">Event Timemapper</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-network.html">GKG Network</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-heatmapper.html">GKG Heatmap</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-countrytimeline.html">GKG Country Timeline</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-exporter.html">GKG Exporter</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-geonet.html">GKG Geographic Network</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-wordcloud.html">GKG Word Cloud</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-tonetimeline.html">GKG Tone Timeline</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-timeline.html">GKG Timeline</a></li><li><a href="http://analysis.gdeltproject.org/module-gkg-thematictimeline.html">GKG Thematic Timeline</a></li></ul><p>I provided a link for each module, so you can investigate more. But I will show you an example of one of these tools. To make more clear, GKG stands for “Global Knowledge Graph”. Furthermore, if you want to dig more and more into the GDELT data structure, I will recommend you to look at their <a href="https://www.gdeltproject.org/data.html#documentation">documentation</a>. Besides, they have well improved their documentation and structure since 2017 when I have first looked at the project.</p><p>Nowadays, knowledge graphs are handy tools to put some semantics on the contents that we have produced. In fact, the concept “knowledge graph” is sometimes considered as a synonym of “ontology”. Although they have some differences, they are definitely correlated concepts. Thus, GKG Network seemed to be an interesting one. Let’s try to use this tool. 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPx04WqN639-UYhGHbPp7w.png" /></figure><p>I wanted to get a graph in which nodes are Person Names and Edges are based on co-occurrences of people. My query aims to fetch news articles that include “Turkey” and “Syria”. Plus, articles must involve at least one of the following topics:</p><ul><li>SANCTIONS</li><li>ECON_CURRENCY_EXCHANGE_RATE</li><li>BORDER</li><li>MILITARY</li><li>TERROR</li></ul><p>To see the full list of available themes, please look at this <a href="http://data.gdeltproject.org/documentation/GDELT-Global_Knowledge_Graph_CategoryList.xlsx">list</a>.</p><p>All those tools require you to provide an email address to send you the results. In my first few attempts, I wasn’t able to get the results properly because at first, the results were very limited to construct a network(5 nodes, 17 edges), then I reconstructed my query but this time, results were so many to create an online visualization(3816 nodes and 489009 edges). Finally, I gave up on online visualization and try to get the Gephi file and Centrality spreadsheet. Let’s look at the spreadsheet first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tMHG6WUHO2fUiwkDevrT2g.png" /><figcaption>First 40 people by Betweenness</figcaption></figure><p>When you try to rank people according to their betweenness centrality, we observe that Trump has the highest rank which is very reasonable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPcGujoeBI1ebSoVm0BMqQ.png" /><figcaption>First 40 people by Eigenvector</figcaption></figure><p>But when you look at the eigenvalue centrality, Turkey’s President Erdogan gets the first rank which makes sense because we searched for Turkey and its neighbor in the border, Syria.</p><p>Now, its time to get some visualization that the GDELT Analysis Service couldn’t provide us. 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*txnvJN850mmmjvAz46yM0g.png" /><figcaption>Nodes’ sizes are scaled by betweenness scores</figcaption></figure><p>To get this graph, I applied the “Yifan Hu” layout first and filtered nodes which have a degree of less than 390. Then I applied to color according to their betweenness score of nodes.</p><p>In the graph, we can easily observe the relations of Trump, Erdogan, and Putin. We can also detect other people who have significance in the network of these people.</p><p><strong>4. Conclusion</strong></p><p>Today, people and agencies are producing tremendous amount of news data online. But the problem is that they are all localized. For example, if I wanted to get information about what’s going on in Syria, even if we are neighbors, I would need to checkout BBC’s or Reuters’ websites rather than local resources. Most of them are not available to me or I can not see them. Projects like GDELT would likely increase in the near future for making usage of all data produced by humans and making analysis on the machines.</p><p>Similarly, the GDELT project gives us a big data resource to analyze the world’s news data for free and they provide some handy tools for the same reason, as well. I think this project will attract more and more people over time. For other interesting projects or tools, please stay tuned. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e96b0c64d03a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not Traditional SEO: Semantic SEO]]></title>
            <link>https://medium.com/@atakanguney94/not-traditional-seo-semantic-seo-f658fc5c880b?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/f658fc5c880b</guid>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[semantic-seo]]></category>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Tue, 22 Oct 2019 21:33:22 GMT</pubDate>
            <atom:updated>2019-10-23T07:43:36.075Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I will introduce you to a relatively new concept on the world wide web. Everyone who put their hands on web development has seen the concept of SEO. Before going into detail, let me introduce to you what SEO is.</p><ol><li><strong>What is SEO?</strong></li></ol><p>SEO stands for <em>Search Engine Optimization</em>. Most of the web developers would recognize the SEO and relate with <a href="https://www.wpbeginner.com/glossary/backlinks/">backlinking</a> and keywords/keyphrases inclusion on their websites. First of all, the ultimate goal of SEO is to rank the website as much as possible when target keywords are searched. For example, if you try to sell flowers online, you aim to put your site top when somebody searched for “send flowers”.</p><p>Contrary to the website owner’s perspective, SEO from the search engine’s perspective is a bit different. Search engines are looking for retrieving the most relevant websites to give meaningful and useful results. They use certain algorithms for that. SEO adapted websites provide search engines to develop more robust and successful algorithms to retrieve the best results in terms of their user’s needs.</p><p>2. <strong>Semantic SEO</strong></p><p>Semantic SEO is there for questions and phrases which return meaningful results on search engines. It does not have to include the exact phrase but the point is to make a machine to understand the user’s intent and return results accordingly. A basic example is that Google can show you their definitions when searching for certain terms. We will see the examples below.</p><blockquote>“ … But we all know that [taj mahal] has a much richer meaning. You might think of one of the world’s most beautiful monuments, or a Grammy Award-winning musician, or possibly even a casino in Atlantic City, NJ. Or, depending on when you last ate, the nearest Indian restaurant. It’s why we’ve been working on an intelligent model — in geek-speak, a “graph” — that understands real-world entities and their relationships to one another: things, not strings.”</blockquote><p>This quotation from <a href="https://www.blog.google/products/search/introducing-knowledge-graph-things-not/">the blog</a> written in 2012 by Amit Singhal who was SVP in the Engineering department at Google. So, Google aims to understand the relations between entities. But how does it work?</p><p>Time to see examples. Let’s first search for some keywords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XrBFM-TxIs3BAhjev_ktQ.png" /><figcaption>Google results for keywords “semantic seo tips”</figcaption></figure><p>As you can observe, Google tries to understand what I search for and answer it directly not just for ranking websites. I think we better ask a question directly and see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irjWa40C_MjRq5wdSEwLWg.png" /></figure><p>Fascinating, huh? 😃 But, you should ignore the ad at the top. Anyway, how Google determines the answer that I am looking for. Let’s go in detail and make a deeper analysis. Google also relates to relevant questions. Let’s see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nenqdGWmCgRsYbnNGIDHAQ.png" /></figure><p>To make further analysis, we need to look at related keywords. There are various tools for that but let’s use <a href="https://keywordtool.io/">KeywordTool.io</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtRAvFTTaNVcZ2Vp_-Mlzg.png" /></figure><p>And let’s look at questions asked for those keywords</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXjqj9nOTYaWpYKrAyndEg.png" /></figure><p>We are looking for these keywords to understand users’ behavior. Our ultimate goal is to make the website to relate these questions and keywords. So, let’s continue with the question that we asked Google before.</p><p>It is reasonable to assume that the website which includes the answer is one of the best websites on the web about the topic we intended. So, we may think this website is also higher ranked with related keywords. Therefore, it is worth to analyze it. I am not an SEO expert but they call this analysis competitive analysis and I used the free version of a tool to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lf9ekuhj6S-XEE0PWeA9qQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wBh5-YkKfXxAHiF-2oDpQ.png" /></figure><p>So, these are the keywords that our number one site gets its traffic. We can create a list that includes these words. The effect of having the list on developing new a website about the same topic is the ability to understand user’s behavior while they are looking for Semantic SEO. Besides, these keywords do not only give an understanding of users’ search but it gives a list that we should include these words on our website.</p><p>3. <strong>Conclusion</strong></p><p>We saw how we can analyze active websites on the web in terms of SEO. We have looked at ways to determine similar keywords and related questions of our keywords.</p><p>To conclude, I want to highlight that our purpose should be creating the most meaningful and best context for users rather than just ranking. Otherwise, it will be nothing but fooling a search engine algorithm or bot.</p><p>Before finishing, I want to add here a video on this topic which affected me the most to write this post. Stay tuned to explore more interesting tools 🚀</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F81WeOXS0vfs%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D81WeOXS0vfs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F81WeOXS0vfs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/07cc7078bb74375edfd3a179d28635fc/href">https://medium.com/media/07cc7078bb74375edfd3a179d28635fc/href</a></iframe><p><strong>Further Readings</strong></p><ol><li><a href="https://www.orbitmedia.com/blog/semantic-seo/">https://www.orbitmedia.com/blog/semantic-seo/</a></li><li><a href="https://online-sales-marketing.com/what-is-semantic-seo/">https://online-sales-marketing.com/what-is-semantic-seo/</a></li><li><a href="https://www.blog.google/products/search/introducing-knowledge-graph-things-not/">https://www.blog.google/products/search/introducing-knowledge-graph-things-not/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f658fc5c880b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Useful Framework for Semantic Web and Linked Data Applications: Apache Jena]]></title>
            <link>https://medium.com/@atakanguney94/useful-framework-for-semantic-web-and-linked-data-applications-apache-jena-85d494f5555e?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/85d494f5555e</guid>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[apache-jena]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[ontology]]></category>
            <category><![CDATA[semanticweb]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Thu, 17 Oct 2019 00:19:28 GMT</pubDate>
            <atom:updated>2019-10-17T00:19:28.363Z</atom:updated>
            <content:encoded><![CDATA[<p>Today’s blog post, I will give a brief introduction to Apache Jena. The framework also known as Jena. This is used to build semantic web and linked data applications. In the post, we will cover how to create Resource Description Framework(RDF) data with Jena and how to make query on the data(runnin SPARQL queries) and we will have little bit of ontology. Before that, if you need detailed information on RDF and SPARQL, please read my previous <a href="https://medium.com/@atakanguney94/introduction-to-resource-description-framework-and-sparql-rdf-101-5857f4a6a8a6">blog</a>.</p><ol><li><strong>Brief Introduction into Jena</strong></li></ol><p>Apache Jena is an open source Apache project, which provides some handy tools to developers to build, work or analyse on semantic web or linked data. Therefore, you can develop semantic web applications on top of Apache Jena. <a href="https://jena.apache.org/about_jena/contributions.html">Here</a> is the list of applications which are enhancing Jena or built on top of Jena.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*ToGJc57S_EcPSKRkIjsKmw.png" /><figcaption>Architecture of Jena Framework</figcaption></figure><p>Now, we have seen architecture and what is Apache Jena. It is time to code 🚀.</p><p>2. <strong>RDF Examples</strong></p><p>First of all, you can see all examples in my GitLab <a href="https://gitlab.com/atakanguney/social-semantic-web-examples/tree/master/jena-examples/src">repo</a>. We first begin with our previous example of Green Goblin and Spiderman. Jena has already some vocabulary in it but in the example, we need to import external vocabulary whose URI is “<a href="http://www.perceive.net/schemas/relationship/">http://www.perceive.net/schemas/relationship/</a>”. After I downloaded vocabulary rdf data, to produce Java class, jena has useful command-line tool called “schemagen”. For detail, follow this <a href="https://jena.apache.org/documentation/tools/schemagen.html">HowTo</a>. I created new vocabulary by following command under Jena directory, which I downloaded from <a href="http://jena.apache.org/download/index.cgi">here</a>.</p><pre>bin/schemagen -i ~/Downloads/relationship.rdf -a &quot;<a href="http://www.perceive.net/schemas/relationship/">http://www.perceive.net/schemas/relationship/</a>&quot; -o .</pre><p>Note that, I run this under Jena home folder. So, it produced Java class and I moved the class into the same folder of my example code, cool 😈</p><p>We are now ready to produce our RDF data.</p><pre><strong>import </strong>org.apache.jena.rdf.model.*;<br><strong>import </strong>org.apache.jena.sparql.vocabulary.FOAF;<br><strong>import </strong>org.apache.jena.vocabulary.*;</pre><p>So as you can see, Jena has already vocabulary FOAF.</p><pre>Model model = ModelFactory.<em>createDefaultModel</em>();<br><br><em>// create the resource<br>//   and add the properties cascading style<br></em>Resource greenGoblin<br>        = model.createResource()<br>        .addProperty(RDF.<strong><em>type</em></strong>, FOAF.<strong><em>Person</em></strong>)<br>        .addProperty(FOAF.<strong><em>name</em></strong>, <strong>&quot;Green Goblin&quot;</strong>);<br><br>Resource spiderman<br>        = model.createResource()<br>        .addProperty(RDF.<strong><em>type</em></strong>, FOAF.<strong><em>Person</em></strong>)<br>        .addProperty(FOAF.<strong><em>name</em></strong>, <strong>&quot;Spiderman&quot;</strong>);<br><br>greenGoblin.addProperty(Relationship.<strong><em>enemyOf</em></strong>, spiderman);<br>spiderman.addProperty(Relationship.<strong><em>enemyOf</em></strong>, greenGoblin);<br><br><em>// list the statements in the graph<br></em>StmtIterator iter = model.listStatements();<br><br><em>// print out the predicate, subject and object of each statement<br></em><strong>while </strong>(iter.hasNext()) {<br>    Statement stmt      = iter.nextStatement();<em><br>    </em>Resource  subject   = stmt.getSubject();   <em>// get the subject<br>    </em>Property  predicate = stmt.getPredicate(); <em>// get the predicate<br>    </em>RDFNode   object    = stmt.getObject();    <em>// get the object<br><br>    </em>System.<strong><em>out</em></strong>.print(subject.toString());<br>    System.<strong><em>out</em></strong>.print(<strong>&quot; &quot; </strong>+ predicate.toString() + <strong>&quot; &quot;</strong>);<br>    <strong>if </strong>(object <strong>instanceof </strong>Resource) {<br>        System.<strong><em>out</em></strong>.print(object.toString());<br>    } <strong>else </strong>{<br>        <em>// object is a literal<br>        </em>System.<strong><em>out</em></strong>.print(<strong>&quot; \&quot;&quot; </strong>+ object.toString() + <strong>&quot;\&quot;&quot;</strong>);<br>    }<br>    System.<strong><em>out</em></strong>.println(<strong>&quot; .&quot;</strong>);<br>}</pre><p>So, lets dive into what is happenning here. In Jena, an RDF element consists of Resource, Property and RDFNode; subject, predicate, object accordingly and each RDF record is a Statement. Now, see the results.</p><pre>79bb0efc-4b0a-4b5a-8c8e-5dfd33bf6d0b <a href="http://www.perceive.net/schemas/relationship/enemyOf">http://www.perceive.net/schemas/relationship/enemyOf</a> 205788d7-255c-4cf7-b652-bce0c60f2a88 .<br>79bb0efc-4b0a-4b5a-8c8e-5dfd33bf6d0b <a href="http://xmlns.com/foaf/0.1/name">http://xmlns.com/foaf/0.1/name</a>  &quot;Spiderman&quot; .<br>79bb0efc-4b0a-4b5a-8c8e-5dfd33bf6d0b <a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a> <a href="http://xmlns.com/foaf/0.1/Person">http://xmlns.com/foaf/0.1/Person</a> .<br>205788d7-255c-4cf7-b652-bce0c60f2a88 <a href="http://www.perceive.net/schemas/relationship/enemyOf">http://www.perceive.net/schemas/relationship/enemyOf</a> 79bb0efc-4b0a-4b5a-8c8e-5dfd33bf6d0b .<br>205788d7-255c-4cf7-b652-bce0c60f2a88 <a href="http://xmlns.com/foaf/0.1/name">http://xmlns.com/foaf/0.1/name</a>  &quot;Green Goblin&quot; .<br>205788d7-255c-4cf7-b652-bce0c60f2a88 <a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a> <a href="http://xmlns.com/foaf/0.1/Person">http://xmlns.com/foaf/0.1/Person</a> .</pre><p>We can also convert it into “TURTLE” format</p><pre>FileWriter fileWriter = <strong>new </strong>FileWriter(<strong>&quot;results/example-1.ttl&quot;</strong>);<br>model.write(fileWriter, <strong>&quot;TURTLE&quot;</strong>);</pre><p>And the file content is:</p><pre>_:b0    a       &lt;http://xmlns.com/foaf/0.1/Person&gt; ;<br>        &lt;http://www.perceive.net/schemas/relationship/enemyOf&gt;<br>                _:b1 ;<br>        &lt;http://xmlns.com/foaf/0.1/name&gt;<br>                &quot;Spiderman&quot; .<br><br>_:b1    a       &lt;http://xmlns.com/foaf/0.1/Person&gt; ;<br>        &lt;http://www.perceive.net/schemas/relationship/enemyOf&gt;<br>                _:b0 ;<br>        &lt;http://xmlns.com/foaf/0.1/name&gt;<br>                &quot;Green Goblin&quot; .</pre><p>As a second example, by using Jena we can read external RDF file(XML/RDF format in following example) and write into local file.</p><pre>Model model = ModelFactory.<em>createDefaultModel</em>();<br><br>model.read(<strong>&quot;https://www.w3.org/TR/2002/WD-rdf-schema-20020430/rdfs-namespace.xml&quot;</strong>, <strong>null</strong>, <strong>&quot;RDF/XML&quot;</strong>);<br>FileWriter writer = <strong>new </strong>FileWriter(<strong>&quot;results/example-2.ttl&quot;</strong>);<br>model.write(writer, <strong>&quot;TURTLE&quot;</strong>);</pre><p>3. <strong>SPARQL Queries in Apache Jena</strong></p><p>Now, as I have stated before, Jena supports SPARQL queries as well. Let see some examples. Assume we have the following RDF data</p><pre>@prefix : &lt;http://example.org/&gt; .<br>@prefix foaf:   &lt;http://xmlns.com/foaf/0.1/&gt; .<br><br>:atakan<br>    a           foaf:Person ;<br>    foaf:name   &quot;Atakan&quot; ;<br>    foaf:mbox   &lt;mailto:atakan@example.org&gt; ;<br>    foaf:knows  :suzan ;<br>    foaf:knows  :riza ;<br>    foaf:knows  :selen ;<br>    .<br><br>:suzan<br>    foaf:name   &quot;Suzan&quot; ;<br>    foaf:knows  :riza ;<br>    foaf:knows  :selen;<br>    .<br><br>:riza<br>    foaf:name   &quot;Riza&quot; ;<br>    foaf:knows  :atakan ;<br>    foaf:knows  :selen;<br>    foaf:knows  :suzan;<br>    .<br><br>:selen<br>    foaf:name   &quot;Selen&quot;;<br>    foaf:knows  :riza;<br>    .</pre><p>We have 4 people: Atakan, Suzan, Riza and Selen. Now, we will extract people who knows Suzan.</p><pre>String queryString = <strong>&quot;PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt; &quot; </strong>+<br>        <strong>&quot;PREFIX : &lt;http://example.org/&gt; &quot; </strong>+<br>        <strong>&quot;SELECT ?name WHERE { &quot; </strong>+<br>        <strong>&quot;   ?person foaf:knows :suzan .&quot; </strong>+<br>        <strong>&quot;   ?person foaf:name ?name .&quot; </strong>+<br>        <strong>&quot;}&quot;</strong>;</pre><p>This is the query string. With Jena, we can run this query on dataset</p><pre>Query query = QueryFactory.<em>create</em>(queryString);<br>QueryExecution qexec = QueryExecutionFactory.<em>create</em>(query, model);<br><strong>try</strong>{<br>    ResultSet results = qexec.execSelect();<br>    <strong>while </strong>(results.hasNext()){<br>        QuerySolution soln = results.nextSolution();<br>        Literal name = soln.getLiteral(<strong>&quot;name&quot;</strong>);<br>        System.<strong><em>out</em></strong>.println(name);<br>    }<br>} <strong>finally </strong>{<br>    qexec.close();<br>}</pre><p>Results as follows</p><pre>Riza<br>Atakan</pre><p>4. Ontologies</p><p>As a last example, we will see how ontology API of Jena is working. To be able to use it, first we need to have a base ontology. Our example ontology is <a href="https://www.w3.org/TR/2003/PR-owl-guide-20031215/wine">here</a>.</p><p>First, we need to load our base ontology</p><pre>String sourceURL = <strong>&quot;https://www.w3.org/TR/2003/PR-owl-guide-20031215/wine&quot;</strong>;<br>OntModel base = ModelFactory.<em>createOntologyModel</em>();<br>base.read( sourceURL, <strong>&quot;RDF/XML&quot; </strong>);</pre><p>Then, creating new item on top of the ontology.</p><pre>String namespace = <strong>&quot;http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#&quot;</strong>;<br>OntClass wine = base.getOntClass(namespace + <strong>&quot;RedBordeaux&quot;</strong>);<br>Individual atakanWine = base.createIndividual(namespace + <strong>&quot;AtakanWine-madebyAtakan&quot;</strong>, wine);</pre><p>So, we take a “RedBordeaux” class and create an individual which is “AtakanWine-madebyAtakan” under that class. This is an assertion.</p><pre><strong>for </strong>(Iterator&lt;Resource&gt; i = atakanWine.listRDFTypes(<strong>true</strong>); i.hasNext();){<br>    System.<strong><em>out</em></strong>.println(atakanWine.getURI() + <strong>&quot; is asserted in class &quot; </strong>+ i.next());<br>}</pre><p>This would produce</p><pre><a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan</a> is asserted in class <a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RedBordeaux">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RedBordeaux</a></pre><p>To get inferences, we need to do some extra work</p><pre>OntModel inf = ModelFactory.<em>createOntologyModel</em>(OntModelSpec.<strong><em>OWL_MEM_MICRO_RULE_INF</em></strong>, base);</pre><p>We need to specify ontology model specification to get some kind of inference. Now we are ready to make inference.</p><pre>atakanWine = inf.getIndividual(namespace + <strong>&quot;AtakanWine-madebyAtakan&quot;</strong>);<br><strong>for </strong>(Iterator&lt;Resource&gt; i = atakanWine.listRDFTypes(<strong>true</strong>); i.hasNext(); ){<br>    System.<strong><em>out</em></strong>.println(atakanWine.getURI() + <strong>&quot; is inferred to be in class &quot; </strong>+ i.next());<br>}</pre><p>And this would result</p><pre><a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan</a> is inferred to be in class <a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RedBordeaux">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RedBordeaux</a><br><a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#AtakanWine-madebyAtakan</a> is inferred to be in class <a href="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#FrenchWine">http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#FrenchWine</a></pre><p>As you can observe that, since AtakanWine-madebyAtakan is asserted as RedBordeaux, it is also inferred as FrenchWine.</p><p><strong>Conclusion</strong></p><p>Apache Jena is one of the prominent tools in Semantic Web and Linked Data Applications. To be able to develop advanced applications, one should definetly get its hand dirty on Apache Jena. So, for more semantic web tools, stay tunned 😃</p><p><strong>References</strong></p><ul><li><a href="http://jena.apache.org/index.html">http://jena.apache.org/index.html</a></li><li><a href="https://www.w3.org/">https://www.w3.org/</a></li><li><a href="http://www.perceive.net/schemas/20031015/relationship/">http://www.perceive.net/schemas/20031015/relationship/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85d494f5555e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How BOT you are ?]]></title>
            <link>https://blog.chatbotslife.com/how-bot-you-are-a5102d39b139?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5102d39b139</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[botometer]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[twitter]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Wed, 09 Oct 2019 12:04:22 GMT</pubDate>
            <atom:updated>2019-10-11T14:47:46.652Z</atom:updated>
            <content:encoded><![CDATA[<h3>How BOT are you?</h3><p>In this blog post, I want to inform you about a tool called <em>botometer, </em>which<em> </em>measures how likely a Twitter account is to be a bot. Before go into details, I want to clarify following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/0*yDSWWtqVpmaZQSAR.png" /></figure><p><strong>What is a BOT ?</strong></p><p>A <a href="https://chatbotslife.com/">bot</a> is software application which is able to do some certain tasks. They are automated which means no human interuption is needed for doing tasks. Bots can be both malicious or beneficial. For example, assistant bots in customer services are helping people to get information without waiting a call center employee. On the other hand, bots that are developed to attack our social platform accounts or to send us spam mails are considered as malicious. For detailed information, please read <a href="https://www.cloudflare.com/learning/bots/what-is-a-bot/">this</a> nice definition.</p><h3>Top Articles on How Businesses are using Bots:</h3><blockquote><a href="https://chatbotslife.com/what-i-learned-in-making-three-chatbots-for-small-businesses-7282c305ce19">1. What I learned in making three chatbots for small businesses</a></blockquote><blockquote><a href="https://chatbotslife.com/what-is-conversational-marketing-why-is-it-a-big-deal-5ac32ee4bff4">2. What is Conversational Marketing &amp; Why Is It a Big Deal?</a></blockquote><blockquote><a href="https://chatbotslife.com/whatsapp-for-business-a-beginners-guide-bots-4a98ac93f4c">3. WhatsApp for Business: A Beginners Guide</a></blockquote><blockquote><a href="https://chatbotslife.com/chatbots-what-happened-dcc3f91a512c">4. Chatbots: What Happened?</a></blockquote><p><strong>What is the BOTOMETER ?</strong></p><p>As I have stated above, botometer measures how likely a Twitter account is to be a bot. It is a Observatory on Social Media(OSoMe) project. Although OSoMe has various interesting tools, botometer is one the core ones. I definetely recommend to check out their <a href="https://osome.iuni.iu.edu/tools/">tools</a> for analyzing social media. Let me continue with botometer. You can go and visit its <a href="https://botometer.iuni.iu.edu/#!/">website</a> and try it very easily. I tried it for my account and as I accepted, it seems that I am definitely a bot 😃 Since I don’t use Twitter too much and I only do some retweeting or liking other tweets, it is surely understandable that it regards me as a bot. See my result below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMPpIdJNuRvgF4pa9619LQ.png" /><figcaption>Botometer result for my Twitter account</figcaption></figure><p><strong>What are the features ?</strong></p><p>In addition to basic result, you can get detailed information about botness (I came up with this word 😃) of an account. Let’s see some details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qDmvxf2eLvrp-Prce0R-6A.png" /><figcaption>Detailed result</figcaption></figure><p>As you can observe, it just not measures by using only one dimension of an account. It looks content, sentiment and also language independent features which are mostly related to network analysis. So as you see, I am a <a href="https://chatbotslife.com/">bot</a> with 91% probability. To get further information, you can get detailed report by clicking details on the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Cwt-hOVsivbSCbZpEsCsw.png" /><figcaption>Details about my account</figcaption></figure><p>Another point is that on botometer website, you can directly download data by only one click to “Export data”.</p><p><strong>Possible Usecases</strong></p><p>Before talking about usecases, it is needed to highlight “Why is important to get a score like that ?”. I will mostly write about malicious respect of bots.</p><p>Since Twitter has been founded, its number of users are increasing and inparallel its influence is also growing. So, it means how many people you are reaching shows how high your app has impact on society. We saw prominent example of this in 2016 elections in U.S. There were fake-accounts which deliberately tried to manipulate people and it seems that this strategy was successful. Hence, we can definetly say that now social media affects people’s behaviours. Another example of social media’s power is what happened in Turkey at Gezi Park events in 2013 where people are gathered together via Twitter.</p><p>Anyway, social media has unprecedented power nowadays. People in bussiness or politics try to use this power in their way. To be able to that they create bots and try to influence people by using these bots. How do they do that ? One possibilty would be creating a journalist account on Twitter and at the sametime, their bots start following the journalist and it is getting more and more followers because people may think that this journalist is followed by lots of people so he or she might be a trustworthy. After that when a fake new published on the journalist account, lots of people would think that the news is right. On the other hand, not only by creating an account but bots can also be used to promote only some news which are prefered and other unprefered important news or informations may become less visible.</p><p>First usecase of the botometer would be eliminating such bot accounts that I have mentioned above. We know that Twitter has some issues for deleting bot accounts. For example<a href="https://www.reuters.com/article/us-usa-election-twitter-exclusive/exclusive-twitter-deletes-over-10000-accounts-that-sought-to-discourage-u-s-voting-idUSKCN1N72FA"> see the news before midterm elections in U.S</a>.</p><p>Another use case may be for analysing real accounts trustworthiness. People don’t use <a href="https://chatbotslife.com/">bots</a> just promoting the fake news but they also try to promote accounts. This can be analyzed by using botometer.</p><p>Other use case would be generating robust bots. Today, generative deep learning models like Generative Adversarial Networks(GANs) or Variational Auto Encoders(VAEs) are very successful to generate content. By using botometer measure as objective function, basically a GAN can be trained to generate bot content.</p><p><strong>Example</strong></p><p>To illustrate how to use botometer, let me give a toy example. Let us assume we want to analyze followers of an important account, for example our President Recep Tayyip Erdogan. I was going to get followers data from API of botometer but unfortunetly it is required to have developer Twitter account and for now my account is under reviewing 😶 So, I needed to collect botometer result of 336 accounts on the browser. Thanks to botometers nice interface, it was not hard but for more detailed analysis, I need to wait Twitter to review my account.</p><p>So, first look at our President’s result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8pat8Om5dJfFHlMV1MoDA.png" /><figcaption>Botometer results of RTE</figcaption></figure><p>For a detailed look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFAJMYbpBiZQyiKGKFd-Cw.png" /><figcaption>Detalied results of RTE</figcaption></figure><p>Now, let’s do some very basic analysis on followers of our President. From those 336 accounts, I could only get 116 accounts’ scores because others are unauthorized or they don’t contain any timeline content. I know 116 or 336 from 14,143,059 followers is not reflectiong very profound infortmation but it is a toy example.</p><p>I used pandas library of python to make this analysis. To see the humble notebook, please visit <a href="https://gitlab.com/atakanguney/social-semantic-web-examples/blob/master/botometer/FollowerAnalysis.ipynb">my repo</a>.</p><pre>import pandas as pd<br>import matplotlib.pyplot as plt</pre><p>I only used pandas and matplotlib.</p><pre>data = pd.read_json(&quot;botometer_export.json&quot;)<br>data</pre><p>Data that I downloaded from botometer website look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oI4i2ad4JN34yNj54S69Lg.png" /><figcaption>Sample Data</figcaption></figure><p>And I plot the histogram of followers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*aa3IYSGnSEMAWLEdntouHA.png" /><figcaption>Histogram of followers based on their scores</figcaption></figure><p>So, my histogram shows most of the followers of our President look bots but again this is not a comprehensive analysis because my sample from all of his followers is too small.</p><p><strong>Conclusion</strong></p><p>Botometer is very interesting tool and it can be used in different kind of projects. One of them which is in my mind is to train a GAN model to create a very powerful bot which may be able to fool botometer 😃 On the other hand, while social media has such a great impact on society, having this kind of tools that are developed by OSoME may help us to avoid malicous effect of bots or influencers. For more interesting tools or concepts on Social Semantic Web, stay tuned 👀</p><h3>Don’t forget to give us your 👏 !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*ZxaGcKC3UQEydQIX" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e59ef%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e59ef&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e59ef%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href">https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href</a></iframe><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/chatbot-development-hire-top-ai-chatbot-developers-c8b45ef7f207"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5102d39b139" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/how-bot-you-are-a5102d39b139">How BOT you are ?</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Resource Description Framework and SPARQL(RDF 101)]]></title>
            <link>https://medium.com/@atakanguney94/introduction-to-resource-description-framework-and-sparql-rdf-101-5857f4a6a8a6?source=rss-ea2705560316------2</link>
            <guid isPermaLink="false">https://medium.com/p/5857f4a6a8a6</guid>
            <category><![CDATA[linked-data]]></category>
            <category><![CDATA[rdf]]></category>
            <category><![CDATA[sparql]]></category>
            <category><![CDATA[social-semantic-web]]></category>
            <dc:creator><![CDATA[Atakan Güney]]></dc:creator>
            <pubDate>Tue, 01 Oct 2019 15:12:08 GMT</pubDate>
            <atom:updated>2019-10-01T15:12:08.167Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, in this blog post I try to explain what <em>Resource Description Framework </em>is and what it is used for. I will try to cover following sections during the blog:</p><ol><li>What does RDF stands for ?</li><li>Why do we need such a framework ?</li><li>RDF Structure</li><li>RDF Example</li><li>What is Sparql ?</li><li>Sparql “Code” Examples</li><li><strong>What is RDF ?</strong></li></ol><p>Resource Description Framework is a standard data model on the Web. It facilitates data to interchange across websites. Most fascinating feature is by using RDF data, websites can share information even if they use different schemas, thanks to the data modeling languages like<a href="https://www.w3.org/OWL/"> OWL</a> and <a href="https://www.w3.org/2001/sw/wiki/RDFS">RDFS</a> which are developed on top of RDF.</p><p>For detailed explaination of RDF, read W3C’s <a href="https://www.w3.org/RDF/">wiki page</a>.</p><p>2. <strong>Why do we need such a framework ?</strong></p><p>Since the ubiquitos spread of the Internet and usage of social media, the data collected from users has been growing at a pace. Besides collecting data, how to benefit of it is another problem. The basic reason is that every website has its own data model to store user of object information and this brings us to the problem of connection.</p><p>As you can guess, this problem was concerned by some clever guys from <a href="https://www.w3.org/">the W3C</a> before and they recommended a data model which we call it today as Resource Description Framework in 1999. In 2004, they published RDF 1.0 specification and the last specification of it is RDF 1.1 which is published in 2014.</p><p>3.<strong> RDF Structure</strong></p><p>RDF data model based on 3 parts: <em>subject, predicate, objects. </em>Aim<em> </em>at this model is to relate subject with object by predefined predicates. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*YT6PWy7nQc-659HTF9fMCg.gif" /><figcaption>Illustration of RDF Structure</figcaption></figure><p>As above graph states, subject can be resources which are located on the web, predicates are property-types which are predefined before(predicates can be both from well-kwon ontologies like <a href="http://Meaning of illustration in English illustration">FOAF</a> or we can define our relationships by using extensions of RDF loke OWL or RDFS), objects can be both resources or literals.</p><p>There are some different serialization formats of RDF. By serialization format, I mean basically format of data stored in the file. These formats are:</p><ul><li><a href="https://www.wikiwand.com/en/Turtle_(syntax)">Turtle</a>(I use this format in the blog)</li><li><a href="https://www.wikiwand.com/en/N-Triples">N-triples</a></li><li><a href="https://www.wikiwand.com/en/N-Triples">N-Quads</a></li><li><a href="https://www.wikiwand.com/en/JSON-LD">JSON-LD</a></li><li><a href="https://www.wikiwand.com/en/Notation3">Notation3</a></li><li><a href="https://www.wikiwand.com/en/RDF/XML">RDF/XML</a></li><li>RDF/JSON</li></ul><p>Despite I use Turtle format, I encountered a lot of example online which are in RDF/XML format. It seems that before Turtle, RDF/XML was the most used one.</p><p>4. <strong>Example</strong></p><p>That is enough description 😃 Lets see an example RDF data.</p><pre>@base &lt;http://example.org/&gt; .<br>@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .<br>@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .<br>@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .<br>@prefix rel: &lt;http://www.perceive.net/schemas/relationship/&gt; .<br><br>&lt;#green-goblin&gt;<br>    rel:enemyOf &lt;#spiderman&gt; ;<br>    a foaf:Person ;    # in the context of the Marvel universe<br>    foaf:name &quot;Green Goblin&quot; .<br><br>&lt;#spiderman&gt;<br>    rel:enemyOf &lt;#green-goblin&gt; ;<br>    a foaf:Person ;<br>    foaf:name &quot;Spiderman&quot;, &quot;Человек-паук&quot;@ru .</pre><p>In the above example, there are records related to <em>Spiderman</em> and <em>Green Goblin</em> which are enemies. We defined first Green Goblin. It is “enemy of” Spiderman and “a person” and its name is “Green Goblin”. Other record is about Spiderman. It is “enemy of” Green Goblin and it is “a person” and its name is “Spiderman” which is “Человек-паук” in Russian. Example is written in <em>Turtle</em> serialization format which is one of the serialization format used for RDF data.</p><p>As you can observe, RDF structure has very basic format to express relationship between subject and object. By using the format, many resources of the web can be related and knowledge graphs can be constructed. On the other hand, the most profound feature of RDF is machine interpretable structure. So, machine can infer the data collected all over the web, if the data is stored in RDF format.</p><p>5. <strong>SPARQL</strong></p><p>Until now, I only mentioned about data format and the beauty of it 😅 But without getting specific parts of the data, how can thousands of gigabytes data be useful. Can you imagine such a mass 😧 Again thanks to some smart guys who recommended a query language for RDF data, we call this language “SPARQL”. If you are familiar with SQL, you can find similarities between them. For example, they both have <em>SELECT</em> and <em>WHERE</em> keywords, etc.</p><p>Lets consider the SPARQL query below:</p><pre>SELECT ?name<br>WHERE {<br>?x foaf:name ?name<br>}</pre><p>This query should return “Green Goblin” and “Spiderman”, “Человек-паук”, if we consider our dataset is example given above.</p><p>Lets dive in little bit. First of all, the RDF data example can be written as following:</p><pre>@base &lt;http://example.org/&gt; .<br>@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .<br>@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .<br>@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .<br>@prefix rel: &lt;http://www.perceive.net/schemas/relationship/&gt; .<br><br>&lt;#green-goblin&gt; rel:enemyOf &lt;#spiderman&gt; .<br>&lt;#green-goblin&gt; a foaf:Person .<br>&lt;#green-goblin&gt; foaf:name &quot;Green Goblin&quot; .<br><br>&lt;#spiderman&gt; rel:enemyOf &lt;#green-goblin&gt; .<br>&lt;#spiderman&gt; a foaf:Person .<br>&lt;#spiderman&gt; foaf:name &quot;Spiderman&quot; .<br>&lt;#spiderman&gt; foaf:name &quot;Человек-паук&quot;@ru .</pre><p>Our query match with “?x foaf:name ?name” format. Corresponding records are</p><pre>&lt;#green-goblin&gt; foaf:name &quot;Green Goblin&quot; .<br>&lt;#spiderman&gt; foaf:name &quot;Spiderman&quot; .<br>&lt;#spiderman&gt; foaf:name &quot;Человек-паук&quot;@ru .</pre><p>By the way, “@ru” specifies language of literal “Человек-паук”.</p><p>6. <strong>SPARQL in Python</strong></p><p>To see all code and some results, please visit my <a href="https://gitlab.com/atakanguney/social-semantic-web-examples/tree/master/sparql-examples">repo</a> on GitLab.</p><p>Now, lets see some coding practices. I am mostly comfortable with python for now. Therefore, I implemented all codes in python 3.6 and in addition to that you need to install rdflib, rdfextras and sparqlwrapper libraries but don’t worry you will see the “Requirement.txt” in my humble repo 😅</p><p>Before doing some real life queries, lets implement our example queries we talked before.</p><pre>import rdflib<br>import rdfextras<br>rdfextras.registerplugins()<br><br>file_path = &quot;sample.ttl&quot;<br>g = rdflib.Graph()<br>g.parse(file_path, format=&quot;turtle&quot;)<br><br>results = g.query(&quot;&quot;&quot;<br>SELECT ?name<br>WHERE{<br>?x foaf:name ?name<br>}<br>&quot;&quot;&quot;)<br><br>for r in results:<br>    print(r[0])</pre><p>The result would be:</p><pre>Green Goblin<br>Spiderman<br>Человек-паук</pre><p>Lets see some real life queries 😃 By saying so this, I mean querying from <a href="https://wiki.dbpedia.org/">DBPEDIA</a>. It has also sparql query client in <a href="http://dbpedia.org/sparql">itself</a>. You can run queries directly on the browser. So, lets continue:</p><ul><li>SELECT type queries</li></ul><pre><strong>from </strong>SPARQLWrapper <strong>import </strong>SPARQLWrapper, JSON<br><br>sparql = SPARQLWrapper(<strong>&quot;http://dbpedia.org/sparql&quot;</strong>)<br>sparql.setQuery(<strong>&quot;&quot;&quot;<br>    PREFIX dbr: &lt;http://dbpedia.org/resource/&gt;<br>    PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;<br>    SELECT ?x<br>    WHERE { ?x dbo:location dbr:Turkey }<br>&quot;&quot;&quot;</strong>)<br>sparql.setReturnFormat(JSON)<br>results = sparql.query().convert()<br><br><strong>with </strong>open(<strong>&quot;select-results.txt&quot;</strong>, <strong>&quot;w&quot;</strong>, encoding=<strong>&quot;utf-8&quot;</strong>) <strong>as </strong>f:<br>    <strong>for </strong>result <strong>in </strong>results[<strong>&quot;results&quot;</strong>][<strong>&quot;bindings&quot;</strong>]:<br>        f.write(result[<strong>&quot;x&quot;</strong>][<strong>&quot;value&quot;</strong>] + <strong>&quot;\n&quot;</strong>)</pre><p>Sample results are:</p><pre>http://dbpedia.org/resource/Anadolu_Agency<br>http://dbpedia.org/resource/Anadolu_Airport<br>http://dbpedia.org/resource/Syrian_National_Council<br>http://dbpedia.org/resource/Cebeci_İnönü_Stadium<br>http://dbpedia.org/resource/Köprübaşı_Dam<br>http://dbpedia.org/resource/Lake_Nemrut<br>http://dbpedia.org/resource/Mado_(food_company)<br>http://dbpedia.org/resource/Selimiye_Barracks<br>http://dbpedia.org/resource/Selimiye_Tunnel<br>http://dbpedia.org/resource/Telsiz_ve_Radyo_Amatörleri_Cemiyeti<br>http://dbpedia.org/resource/Yıldız_Palace<br>http://dbpedia.org/resource/İstinye_Park<br>http://dbpedia.org/resource/45th_Antalya_Golden_Orange_Film_Festival<br>http://dbpedia.org/resource/ANKAmall<br>...</pre><p>In this query, we got resources which are related to “Turkey” by the relation “location”. Cool, hah 😍</p><p>So, lets continue with my favorite</p><ul><li>DESCRIBE type queries</li></ul><pre><strong>from </strong>SPARQLWrapper <strong>import </strong>SPARQLWrapper, TURTLE<br><strong>from </strong>rdflib <strong>import </strong>Graph<br><br><em># Describe Query<br></em>sparql = SPARQLWrapper(<strong>&quot;http://dbpedia.org/sparql&quot;</strong>)<br>sparql.setQuery(<strong>&quot;&quot;&quot;<br>    DESCRIBE &lt;http://dbpedia.org/resource/Turkey&gt;<br>&quot;&quot;&quot;</strong>)<br><br>sparql.setReturnFormat(TURTLE)<br>results = sparql.query().convert()<br><br>g = Graph()<br>g.parse(data=results, format=<strong>&quot;turtle&quot;</strong>)<br><br><strong>with </strong>open(<strong>&quot;describe-results.ttl&quot;</strong>, <strong>&quot;wb&quot;</strong>) <strong>as </strong>f:<br>    f.write(g.serialize(format=<strong>&#39;turtle&#39;</strong>))</pre><p>Results will look like following:</p><pre>@prefix dbc: &lt;http://dbpedia.org/resource/Category:&gt; .<br>@prefix dbo: &lt;http://dbpedia.org/ontology/&gt; .<br>@prefix dbp: &lt;http://dbpedia.org/property/&gt; .<br>@prefix dbpedia-cs: &lt;http://cs.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-eu: &lt;http://eu.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-fr: &lt;http://fr.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-id: &lt;http://id.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-it: &lt;http://it.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-nl: &lt;http://nl.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-pl: &lt;http://pl.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-pt: &lt;http://pt.dbpedia.org/resource/&gt; .<br>@prefix dbpedia-wikidata: &lt;http://wikidata.dbpedia.org/resource/&gt; .<br>@prefix dbr: &lt;http://dbpedia.org/resource/&gt; .<br>@prefix dct: &lt;http://purl.org/dc/terms/&gt; .<br>@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .<br>@prefix geo: &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt; .<br>@prefix georss: &lt;http://www.georss.org/georss/&gt; .<br>@prefix lgdt: &lt;http://linkedgeodata.org/triplify/&gt; .<br>@prefix ns10: &lt;http://dbpedia.org/resource/Crossing_the_Bridge:&gt; .<br>...</pre><p>The result is huge 👌 This query returns RDF data about the resource. So, we got RDF data about “Turkey” which we explicitly queried the resource.</p><ul><li>ASK type queries</li></ul><p>This type of query returns true or false based on our query. Lets see.</p><pre><strong>from </strong>SPARQLWrapper <strong>import </strong>SPARQLWrapper, XML<br><br>sparql = SPARQLWrapper(<strong>&quot;http://dbpedia.org/sparql&quot;</strong>)<br>sparql.setQuery(<strong>&quot;&quot;&quot;<br>    ASK WHERE { <br>        &lt;http://dbpedia.org/resource/Turkey&gt; rdfs:label &quot;Türkei&quot;@de<br>    }    <br>&quot;&quot;&quot;</strong>)<br><br>sparql.setReturnFormat(XML)<br>results = sparql.query().convert()<br>print(results.toxml())</pre><p>This returns</p><pre>&lt;?xml version=&quot;1.0&quot; ?&gt;&lt;sparql xmlns=&quot;<a href="http://www.w3.org/2005/sparql-results#">http://www.w3.org/2005/sparql-results#</a>&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot; xsi:schemaLocation=&quot;<a href="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd</a>&quot;&gt;<br> &lt;head/&gt;<br> &lt;boolean&gt;true&lt;/boolean&gt;<br>&lt;/sparql&gt;</pre><p>The last one is</p><ul><li>CONSTRUCT</li></ul><p>In this query type, a RDF data constructed with results by given construct. Lets see the example</p><pre><strong>from </strong>SPARQLWrapper <strong>import </strong>SPARQLWrapper, XML, JSON<br><br>sparql = SPARQLWrapper(<strong>&quot;http://dbpedia.org/sparql&quot;</strong>)<br>sparql.setQuery(<strong>&quot;&quot;&quot;<br>    PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;<br>    PREFIX schema: &lt;http://schema.org/&gt;<br>    CONSTRUCT {<br>      ?lang a schema:Language ;<br>      schema:alternateName ?iso6391Code . <br>    }<br>    WHERE {<br>      ?lang a dbo:Language ;<br>      dbo:iso6391Code ?iso6391Code .<br>      FILTER (STRLEN(?iso6391Code)=2) # to filter out non-valid values<br>    }<br>&quot;&quot;&quot;</strong>)<br><br>sparql.setReturnFormat(XML)<br>results = sparql.query().convert()<br><strong>with </strong>open(<strong>&quot;construct-results.ttl&quot;</strong>, <strong>&quot;wb&quot;</strong>) <strong>as </strong>f:<br>    f.write(results.serialize(format=<strong>&#39;turtle&#39;</strong>))</pre><p>Sample result:</p><pre>@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .<br>@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .<br>@prefix schema: &lt;http://schema.org/&gt; .<br>@prefix xml: &lt;http://www.w3.org/XML/1998/namespace&gt; .<br>@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .<br><br>&lt;http://dbpedia.org/resource/Abkhaz_language&gt; a schema:Language ;<br>    schema:alternateName &quot;ab&quot; .<br><br>&lt;http://dbpedia.org/resource/Afar_language&gt; a schema:Language ;<br>    schema:alternateName &quot;aa&quot; .<br><br>&lt;http://dbpedia.org/resource/Afrikaans&gt; a schema:Language ;<br>    schema:alternateName &quot;af&quot; .<br><br>&lt;http://dbpedia.org/resource/Akan_language&gt; a schema:Language ;<br>    schema:alternateName &quot;ak&quot; .<br><br>&lt;http://dbpedia.org/resource/Albanian_language&gt; a schema:Language ;<br>    schema:alternateName &quot;sq&quot; .<br><br>&lt;http://dbpedia.org/resource/Amharic&gt; a schema:Language ;<br>    schema:alternateName &quot;am&quot; .<br>...</pre><p>So, we get languages and their codes and we got new RDF graph based on our construction.</p><p><strong>Conclusion and Future Blogs</strong></p><p>Actually, I wanted to write a blog about spary queries on distributed system Apache Spark. But I realized that it is early to write such a complex blog 😅 In comming weeks, I may write blogs about this topic.</p><p>To conclude, RDF is exciting tool or model language or whatever you name it. It is definitely exciting idea to gather all data on the web and make it machine understandable. For interesting blogs about Social Semantic Web tools, please stay tuned 😃</p><p><strong>References</strong></p><ol><li><a href="https://www.w3.org/RDF/">https://www.w3.org/RDF/</a></li><li><a href="https://www.dataversity.net/introduction-to-sparql/">https://www.dataversity.net/introduction-to-sparql/</a></li><li><a href="https://rdflib.github.io/sparqlwrapper/">https://rdflib.github.io/sparqlwrapper/</a></li><li><a href="https://www.w3.org/TR/turtle/">https://www.w3.org/TR/turtle/</a></li><li><a href="https://www.wikiwand.com/en/Resource_Description_Framework#/Serialization_formats">https://www.wikiwand.com/en/Resource_Description_Framework#/Serialization_formats</a></li><li><a href="https://www.w3.org/TR/rdf-sparql-query/">https://www.w3.org/TR/rdf-sparql-query/</a></li><li><a href="http://www.linkeddatatools.com/semantic-web-basics">http://www.linkeddatatools.com/semantic-web-basics</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5857f4a6a8a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>