Quratulain Rajput Faculty of Computer Science, IBA Spring2013 Semantic Web Quratulain Rajput Faculty of Computer Science, IBA Spring2013
RDF To represent web as: “ the web of real world object rather than only web of documents.” Quratulain Rajput
RDF Construction of URI Scheme:[//authority]path[?query][#fragment] [Note: path and fragment are optional.] http://www.iba.edu.pk/ http://cs.iba.edu.pk/faculty.html#sghani https://www.google.com.pk/search?q=textmining+the+quran&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Quratulain Rajput
RDF <rdf:Description rdf:about=“http://ww.iba.edu.pk/asif”> <hasAge>40</hasAge> </rdf:Description> <rdf:Description rdf:about=“http://ww.iba.edu.pk/asif”> <writeBook> <rdf:Description rdf:about=“http://www.semantic-web- book.org/”> </writeBook> Quratulain Rajput
XML namespaces and RDF Draw for the following description. Quratulain Rajput
RDF Representation Draw Graphs, are these represent same meaning? Quratulain Rajput
IRI IRI (International Resource Identifier) is extended URI by allowing non-Latin (Chinese, Urdu, Arabic) characters. Quratulain Rajput
Shorter URI xmlns can only used with xml tags and with attribute but not as value of attribute (e.g allowed with rdf:about, rdf:resource). Use of Xml:base with rdf:about <xml version=“1.0“ encoding=“utf-8“> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:data=“http://iba.edu.pk/research#“ xml:base=“http://iba.edu.pk/Faculty“> <rdf:Description rdf:about=“#Quratulain“ data:teaches=“Semantic Web“> <data:writesWiki rdf:resource=“http://cse661semanticwebspring2013.wikispaces.com/“/> </rdf:Description> </rdf:RDF> Quratulain Rajput
Shorter URI Use of xml:base with rdf:ID (used only once) <xml version=“1.0“ encoding=“utf-8“> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:data=“http://iba.edu.pk/research#“ xml:base=“http://iba.edu.pk/Faculty“> <rdf:Description rdf:ID=“Quratulain“ data:teaches=“Semantic Web“> <data:writesWiki rdf:resource=“http://cse661semanticwebspring2013.wikispaces.com/“/> </rdf:Description> </rdf:RDF> Quratulain Rajput
Rdf:Datatypes RDF describe data values by means of literals. E.G string, number etc. Each datatype is uniquely identified by a URI. RDF use the xml-schema for datatype description. <xml version=“1.0“ encoding=“utf-8“> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:course=“http://iba.edu.pk/MS/courses#“ > <rdf:Description rdf:about=“http://iba.edu.pk/MS/CSE661“> <course:Name rdf:datatype=“http://www.w3c.org/2001/XMLSchema#string“> Semantic Web </course:Name> <course:credit rdf:datatype= “http://www.w3c.org/2001/XMLSchema#integer“> 3 </course:credit> </rdf:Description></rdf:RDF> Quratulain Rajput
<xml version=“1.0“ encoding=“utf-8“> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:course=“http://iba.edu.pk/MS/course#“ > <rdf:Description rdf:about=“http://iba.edu.pk/MS/CSE661“> <course:Name rdf:datatype=“http://www.w3c.org/2001/XMLSchema#string“> Semantic Web </course:Name> <course:credit rdf:datatype= “http://www.w3c.org/2001/XMLSchema#integer“> 3 </course:credit> </rdf:Description></rdf:RDF> http://iba.edu.pk/MS/course#Name Semantic Web http://iba.edu.pk/MS/CSE661 4 http://iba.edu.pk/MS/course#credit Quratulain Rajput
Multiple values Relation Problem: which height belong to which member. Solution: A node with no unique name is called blank node. It use to aggregate facts in form of list. Asif saad http://www.footballpakistan.com/hasMember http://www.footballpakistan.com/hasMember http://www.footballpakistan.com/team http://www.footballpakistan.com/hasHeight http://www.footballpakistan.com/hasHeight 6.5ft 6 ft Quratulain Rajput
Blank Node Blank node cannot be addressed globally with URI. 6 ft saad http://www.footballpakistan.com/hasName http://www.footballpakistan.com/hasHeight http://www.footballpakistan.com/hasMember http://www.footballpakistan.com/hasHeight http://www.footballpakistan.com/team 6.5ft http://www.footballpakistan.com/hasMember Asif http://www.footballpakistan.com/hasName Quratulain Rajput Quratulain Rajput 13
Blank Node <rdf:Description rdf:about=“http://footballpakistan.com/team#Mem“> <te:hasMember rdf:parseType=“Resource“/> <te:hasName>Asif</te:hasName> <te:hasHeight>6.5</te:hasHeight> </te:hasMember> </rdf:Description> Quratulain Rajput
Blank node with name Blank node can be assign name if needed. <rdf:Description rdf:about=“http://footballpakistan.com/team#Mem“> <te:hasMember rdf:nodeID=“M1”/> </rdf:Description> <rdf:Description rdf:nodeID=“M1”> <te:hasName>Asif</te:hasName> <te:hasHeight>6.5</te:hasHeight> </te:hasMember> Quratulain Rajput
Container Elements Represents a group of resources or literals E.g., we may wish to talk about the courses given by a particular lecturer The content of container elements are named rdf:_1, rdf:_2, etc. or alternatively rdf:li Quratulain
Three Types of Container Elements rdf:Bag an unordered container, allowing multiple occurrences E.g. members of the faculty board, documents in a folder rdf:Seq an ordered container, which may contain multiple occurrences E.g. modules of a course, items on an agenda, an alphabetized list of staff members (order is imposed) rdf:Alt a set of alternatives E.g. the document home and mirrors, translations of a document in various languages Quratulain
Example for a Bag <uni:lecturer rdf:ID= "FAC949" uni:name= "Atif" uni:title="Professor"> <uni:coursesTaught> <rdf:Bag> <rdf:_1 rdf:resource="#CSE101"/> <rdf:_2 rdf:resource="#CSE206"/> </rdf:Bag> </uni:coursesTaught> </uni:lecturer> Quratulain
Example for Alternative <uni:course rdf:ID=“CSE206" uni:courseName=“Data Structures"> <uni:lecturer> <rdf:Alt> <rdf:li rdf:resource="#FAC949"/> <rdf:li rdf:resource="#FAC318"/> </rdf:Alt> </uni:lecturer> </uni:course> Quratulain
Question Describe it using container? Referee(X,Y,Z) : X is the referee in a chess game between players Y and Z Quratulain
RDF Collections A limitation of these containers is that there is no way to close them “these are all the members of the container” RDF provides support for describing groups containing only the specified members, in the form of RDF collections list structure in the RDF graph constructed using a predefined collection vocabulary: rdf:List, rdf:first, rdf:rest and rdf:nil Quratulain
Reification In RDF it is possible to make statement about statement such as Ahmed belief that Hassan is the creator of the web page http://www.xyz.com How would you do this?try. RDF allow this using reification mechanism. Quratulain
Reification Any statement can be an object graphs can be nested - reification claims pers05 ISBN... Author-of NYT <rdf:Description rdf:about=“#NYT”> <claims> <rdf:Description rdf:about=“#pers05”> <authorOf>ISBN...</authorOf> </rdf:Description> </claims> RDF approved bu FvH This is reification. Complete triple treated as a object or value. In this case a value. Quratulain
Reification RDF turns a statement into resource. <rdf:Description rdf:about=“#NYT”> <claims> <rdf:Description rdf:about=“#pers05”> <authorOf>ISBN...</authorOf> </rdf:Description> </claims> RDF turns a statement into resource. <rdf:Statement rdf:about=“Statementaboutpers05”> <rdf:subject rdf:resource=“#pers05”/> <rdf:predicate rdf:resource=“#authorOf”/> <rdf:object>ISBN</rdf:object> </rdf:Statement> <rdf:Description rdf:about=“#NYT”> <claims> <rdf:Description rdf:resource=“#Statementaboutpers05”/> </claims> </rdf:Description> Quratulain