



















Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!




















Why representing knowledge? Representing knowledge is at the basis of all our interactions , we need it, we need language; language is the human way of representing knowledge; vocal languages or sign languages, same way. In computer science and humanities Representing knowledge is crucial in many areas:
Tim Berners Lee , co-inventor of the World Wide Web, published the first web page in
1991. The web then grew so fast that in a few years the whole humanity changed (forever!) its relation with information retrieval. Curiously, the creation of the World Wide Web was born to solve an internal knowledge manager problem of the CERN (European Council for Nuclear Research, basically a physics centre, in Geneva). Berners Lee joined the CERN in 1980 and proposed the Web as a project for solving a problem: a lot of information just got lost because experimental data and documentations were stored on a large variety of computers in a large variety of formats. It was almost impossible to track down everything that might be relevant to someone’s research like this! WWW relied on existing ideas and tools Interesting to know, the web proposed by Berners Lee actually relied on existing tools and ideas, there were already many ideas, tools, methods and paradigms from which he had the possibility (and intuition!) to start. The most important thing that was actually already there is the Internet! Internet was developed by a military project. In 1969 , the Arpa (Advanced Research Project Agency, USA Defence Department) built a computer network called Arpanet. Ted Nelson and Engelbart’s work on hyperlinks in the 1960s. WWW vs Internet Internet is a global system of interconnected computer networks. Attention here: it is not a network of computers; it is A NETWORK OF NETWORKS of computers, which are interconnected on a global scale and use some protocols to exchange messages; if you are in the USA and you want to exchange a message with your friend in Italy, you can use a certain protocol for sending the message through the internet and make sure the message reaches the destination. There are many things that are called protocols, which accompany and support exchanges of information between the different networks connected through the Internet. The Internet consist of both private and public networks ; the University of Bologna network, for example, is a network itself, a private academic one, but it is connected to the whole network of networks. The World Wide Web, on the other side, is an INFORMATION SPACE, where uniform resource locators (URLs) identify documents and web resources in general, which are interlinked by hypertext. The links are, in this case, logical and not physical (well then, of course there is something physical eventually, the electrical signals that go through the cables!) There are other applications that rely on the Internet: emails, for example. We are used to look at emails as part of the web but emails were actually there before the web, because they use their own protocol for communication.
Hosts can be either servers or clients (also both, in some cases)
- the server provides services to other computers, other hosts, which are called clients. - the client is anything that requests a service from a provider. Google is not running on your computer, for example. Google is running in some computer somewhere near you. You are a client who is asking that computer, which is the server, to provide you the access to Google. And Google is not the only possible example; the point is not every application that I use in my computer is actually running on my computer. All the apps that we have on our mobile phones are clients of those applications; we are submitting requests from our mobile phones to those hosts, which are in this case servers.
Communication protocols This is possible because there are a set of protocols, supporting this procedure. The protocols control the information flow on the Internet: they give us the means for creating the messages, making sure that they are understood through the whole process and eventually exchanged. In order to do that, they provide a standard format, which everybody has to use, and actions that have to be performed during such exchange. Protocols are the bureaucracy of the internet: they define format and order of exchanged messages, as well as the actions to be performed during these exchanges. The main ones are TCP : Transmission Control Protocol and IP : Internet Protocol. They basically ensure that a certain message is wrapped into a security channel and goes through the best path to make sure it arrives. Protocol used to send a request for accessing a webpage We have protocols ourselves, as commonspeakers: speaking the same language of your interlocutor, for example, is one of it! E a questo punto sono state dette veramente una serie di cose confuse che penso (e spero) siano inutili! IP addresses and DNs We have our home address; our computer has its own address too. Every host has a unique IP address and it has to be unique because otherwise messages sent from a computer (with a unique address) to another (with a non-unique address) could get lost. Internet Assigned Numbers Authority (IANA) takes care of it; it assigns IP address and pledges uniqueness. When you connect to the Internet, it’s your Internet Service Provider that assigns you an IP address (among those it owns). Most of us has dynamic IPs. Our addresses do are unique but they are not fixed: my laptop is assigned a unique IP address today but tomorrow I will be assigned another one, which will be unique as well but different. There is also the possibility to have a static IP address, which simply does not change. By using the VPN service, it is possible to mask one’s IP (if you do not want to be traced!)
The World Wide Web Project Every source of information (today we call it a webpage) would have a unique address , in a standard form.
- standard very important that it is standard, so that any browser can read the page you created. - mark-up it is mainly concerned with the layout structure and the formatting and presentation of the information there; this is not a programming language (a programming language allows you to describe procedure, actions, while with a mark-up language you do not describe procedure but how layout is and how content of the page must be displayed). things between angle brackets are tags Page Title My First Heading
My first paragraph.
. Well these are the very basic tags of a HTML document; **** is called the root tag because it is the root element of the page, it has to be there, always. HTML consists of a series of elements: tags and attributes: tags are the main elements and attributes can be associated with them. An HTML element has usually a **** and a **** (yes, with the slash) and everything which is between these two fixed tags is part of the HTML. Why do we use tags? Because in HTML the tags define the way in which content must be formatted or displayed. Considering that each tag has its own meaning in terms of display, layout and things like that, in terms of formatting, we have to tell the browser – which is the main application that processes this data – when this specific layout formatting will end. For example if I want to write my name in italics, I need to tell the browser that only that particular word has to be in italics, otherwise at the end everything from the name on will result in italics. So, always remember to open and close the tags. There are only a few tags, which do not need to be closed by the end tag , because of the meaning of the tag itself. A good example is which is a standard declaration of the HTML5 document. [There are many versions of HTML, this is an HTML5 version, which is in fact the recommended and most common one] An important thing to know is the difference between the and the .each other by edges. The starting node at the very top of the tree is the root node so the root node generates children nodes ( siblings , if they are at the same level) and then these little new nodes generates other nodes in turn, leaves. But why are we speaking about syntactic trees? Why these languages (computer languages?) commonly organize documents and sources as a tree? This is because when you want to process the code with an external application or even with some code within the webpage (ig: if you use a language, called JavaScript, to enrich the webpage with some dynamic behaviours) you can use a tree structure to navigate the document.
When you include this tag in the page, similarly to what happens when you include a link, you need to give a reference to the tag, through an attribute, to go and pick the chosen image, so: ****. There are two ways to specify the value of the source attribute of an image tag: *URL = address
Now, in order to identify the address of a file in the three structure , we have to navigate the tree. Every time I go down along the path to reach the file I am searching for, I have to add a /slash before the node down; it’s just a separator, a convention. Let’s write down, in one string, the whole path which has been made; in this case, it will be (starting with the slash alone, representing the file system): /Users/Val/Desktop/img.jpg There is another concept very important for us to know. Let’s say we have our /root which generates an ITS which generates in turn two final files, two leaves: Index.html and Img.jpg. Now, looking at the Index.html, we want to find the attribute src (qualcosa del genere!) and we want to write its address. We can do it in two ways:
LEFT. The Web: webpages connected through href attribute of the tag. RIGHT. A new version of the Web, the Semantic Web: resources are given a category, they are different things. The links between them have meaning too. The Semantic Web is an evolution , an extension of the old Web. What about precise questions? When you query(ied!) Google or other search engine, what you get is a list of documents. In order to find the specific information that you need, you have to read all of them. But is there a way to improve search results and retrieve the answers, when questions are quite specific? Well yes, since a few years. Google decided to improve this system and this comes from this evolution of the Web, the Semantic Web. The Google knowledge graph is a big resource of data where data are connected in a way similar to the picture before. There are things connected to other with some meaningful relations. Yes, this new name “knowledge graph” is nothing more than the Semantic Web! It is what we see on the right of the page when we google something. If we google “Barack Obama” we found, on the right, this knowledge graph and lots of meaningful relations connected to what we searched.
Knowledge representation also identifies a discipline, a field of Artificial Intelligence dedicated to represent information about the world in a form that a computer system can use to solve complex tasks such as formulating medical diagnoses and natural language dialoguing. We want machines to perform tasks on our behalf, even complex task. We want them to elaborate knowledge about objects of the world , not only mathematical calculations.
This triangle describes the way we organize and express our knowledge of the world. When we write or talk about something this is what we do. It is not possible to put the Monna Lisa painting in a computer. In order to allow a computer to elaborate information about Monna Lisa, I assume that the painting is an element of a set (mathematical sense) that a machine is able to manipulate. And in order to do this, we have to draw a mapping between the real world and the set theory , assuming that the formal semantics of set theory is appropriate to describe how the world functions. Of course this is an approximation, we know the world is much more complex than a set of things having relations between them, still, it is a possible approximation that allows us to create an abstraction for the computer to understand! When we refer to this abstract world in terms of “The set theory”, what we can do is associate a formal semantics to any assessment, any statement that we make through this representation model.
This is a set where elements belong to either one of the sets A or B; they belong either to A or to B.
things and on the other hand, it gives us a way to express these things not ambiguously, which is very important for sharing this knowledge with the machine.
A syllogism is a logical argument where a quantified statement – or conclusion – is inferred from two other quantified statements – or premises. All men are mortal Socrates is a man quantified statements / premises --------------------- Socrates is mortal. conclusion A syllogism beginning with all is a very common one. Premises usually comprehend “all”, “no” and “some”. We define a binary relation, represented by the ∈ symbol, which is “member of”, “belongs to” or “element of”. Everything staying after this symbol, that is to say what the thing/number is member of, is a set.
A = {1, 2) A is a set and 1 ∈ A, 2 ∈ A and that 3 ∉ A. A set can also be composed of other sets.
Let’s take φ as a generic name for a generic property. { x | φ(x)^ } : “all those object such that for them the property φ holds” “the set of object that have the property described by φ”
We are talking about putting on the web a formal representation of knowledge, with can be also processed by machine. The main idea of the Semantic Web was (20 years ago by now!) was starting with what was already there, which is to say the Web, and arrive to a point where the content of all those documents on the web could be interpretable and processed by machines as well, so that there could be a better cooperation between machines and humans. The key point of the Semantic Web is that everything is uniquely identifier by a code, or identifier, or URI (standing for Uniform Resource Identifier). These identifiers are used to give a specific name to anything. Not only webpages but anything really, any object or concept of the real world. The most recent specification for these unique identifiers is called IRI, Internationalized Resource Identifier.
As absolute IRIs are quite long to be written when we have to, we can also use prefixed names. We use the term “absolute, in fact, when we express IRI in full, in their full form. Absolute IRIs are enclosed in “ < “ and “ > “ :
A prefix is composed of a label and a colon “ : “
In other words, as we may have the same prefix for many of these objects, we may want to use a shorter way to indicate that part, which is recurrent. An IRI may be divided in two fragment: the first one is called namespace and the second one, the long code composed of numbers and letters, is called ID : the namespace being, for example, www.unibo.it and the IDs being, in this case, all the students’ and professors’ pages. Now, what do we use to publish this knowledge on the web? We use a model.
Each resource (or entity or triple) is composed of two nodes (subject / object) linked by a directed arc (property). We say directed arc we mean that the arc has a direction, because we read relations with a specific direction.
An RDF graph, which we also call “RDF knowledge graph” is a set of this RDF statements. Different RDF statements are connected to each other. When objects are not IRI, they become subject of a new triple; in this case we use a given relation title and we don’t have a IRI but, in fact, a literal, a string.
What we have seen so fare is data model. When we have to create documents and publish them, so we have to store somewhere these triples, we need a sintax. An RDF document is a document that encodes an RDF graph, a concrete RDF syntax, such as Turtle, RDFa, JSON-LD, TriG or RDF/XLM. RDF documents enable the exchange of RDF graphs and RDF datasets between systems. A concrete syntax for RDF may offer many different ways to encode the same RDF graph and RDG dataset, for example through the use of namespace prefixes, relative IRIs, blank node identifiers, and different ordering of statements. While these aspects can have great affect on the convenience of working with the RDF document, they are not significant for its meaning.
Turtle is a concrete syntax to express RDF statements in a simple and intuitive way. A Turtle triple consists of the three components of a statement, followed by a dot to say “dude, the triple ends here.”
All these statements, when put together, they create a graph, and we also call them “linked data” / “linked open data”. A triplestore (or RDF store) is a particular type of database that stores RDF graphs. The term dataset is often used to refer to RDF graphs. RDF graphs are also called linked (open) data : linked because they can link to each other and open because they have the license to allow anyone to reuse them for any purpose. There are also linked knowledge graphs that are not open. Linked data / PDF datasets are a type of knowledge graph (semantic web knowledge graphs). RDF triplestores store RDF triples, they can be queried to retrieve triples. The query language for RDF triplestores is SPARQL. (“sparkol”)
SPARQL Protocol and RDF Language (SPARQL) is the standard language for querying over RDF graphs. Last version: SPARQL 1.1 (Reccomandation) http://www.w3.org/TR/sparql11-query/ SPARQL is based on the fact you recognize patterns on the graphs, [patterns = structures that match to triples.] The simplest pattern in SPARQL is called triple pattern , which is very similar to an RDF statement with the possibility of specifying variables as subject, predicate and object.
The basic building block for SPARQL queries is a triple pattern. A triple pattern is like an RDF triple, but you can use a variable in any one of the three positions (subject, predicate, object) to define this sort of template of patterns. We use triple patterns to find the matching triples in a graph and variables act like wildcards that match any node.