Presentation is loading. Please wait.

Presentation is loading. Please wait.

Semantic Web Andrejs Lesovskis 4/11/2017 6:03 PM

Similar presentations


Presentation on theme: "Semantic Web Andrejs Lesovskis 4/11/2017 6:03 PM"— Presentation transcript:

1 Semantic Web Andrejs Lesovskis 4/11/2017 6:03 PM
©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 This lecture’s agenda Metadata
Introduction to Resource Description Framework RDF triples RDF serialization formats RDF Schema RDF and relational databases

3 Metadata The term "meta" comes from a Greek word that denotes something of a higher or more fundamental nature. Metadata, then, is data about other data. The term refers to any data used to aid the identification, description and location of networked electronic resources.

4 Metadata For example, we have a file that contains some image data. Then file metadata could be the following: name of an author, the date and time a picture was taken, location where a picture was taken, model of a camera that was used, etc.

5 Metadata example (1)

6 Metadata example (2)

7 Metadata types Metadata can describe:
data contents (short summary, limitations, etc); data access history; access rights; relations between data.

8 Uses of metadata Metadata can be used in: content ranking;
resource searching; resource integration; define relations between intelligent agents.

9 Metadata facts to remember
Metadata does not have to be digital Metadata relates to more than the description of an object. Metadata can come from a variety of sources Metadata continue to accrue during the life of an information object or system. One information object's metadata can simultaneously be another information object's data.

10 Semantic Web layers

11 Semantic Web layers

12 W3C Semantic Web Activity Statement
"The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web. It is particularly intended for representing metadata about Web resources, such as the title, author, and modification date of a Web page, copyright and licensing information about a Web document, or the availability schedule for some shared resource." W3C

13 Resource Description Framework
A framework (not a language) for a framework for representing information in the Web, RDF is a standard model for data interchange on the Web, Syntax to allow exchange and use of the information stored in various locations, The point is to facilitate reading and correct use of information by machines, not necessarily by people.

14 What is a resource? Resource is anything that can be identified and described. Resource can be identified by a URI or it can be a blank node. Resource can be abstract. The first precise definition of a resource can be found in the RFC 2396 standard:

15 Main goals of RDF Integrate data from the multiple sources.
Allow the re-use of data in the different projects and organizations. Decentralize data in a way that no single party "owns" all the data.

16 XML and RDF (1) <?xml version="1.0"?> <River id="Yangtze"
xmlns=" <length>6300 kilometers</length> <startingLocation>western China's Qinghai-Tibet Plateau </startingLocation> <endingLocation>East China Sea</endingLocation> </River> XML <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" RDF Yangtze.xml Yangtze.rdf Can be converted to

17 XML and RDF (2) <?xml version="1.0"?> <River rdf:ID="Yangtze"
RDF provides an ID attribute for identifying the resource being described. 2 The ID attribute is in the RDF namespace. <?xml version="1.0"?> <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" <length>6300 kilometers</length> <startingLocation>western China's Qinghai-Tibet Plateau </startingLocation> <endingLocation>East China Sea</endingLocation> </River> 3 Add the "fragment identifier symbol" to the namespace.

18 XML and RDF (3) 2 1 3 4 Identifies the resource being described. This
<?xml version="1.0"?> <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" <length>6300 kilometers</length> <startingLocation>western China's Qinghai-Tibet Plateau</startingLocation> <endingLocation>East China Sea</endingLocation> </River> Identifies the type (class) of the resource being described. Identifies the resource being described. This resource is an instance of River. These are properties, or attributes, of the type (class). Values of the properties 1 2 3 4

19 RDF triple structure (1)
4/11/2017 6:03 PM RDF triple structure (1) RDF data model is based upon the idea of making statements about resources in the form of subject-predicate-object expressions (triples). resource value property ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 RDF triple structure (2)
4/11/2017 6:03 PM RDF triple structure (2) Every triple contains some statement. Resource Resource Property Value Statement ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 RDF triple structure (3)
4/11/2017 6:03 PM RDF triple structure (3) In RDF, the English statement "The owner of the web-site Gmail at is Google." would look like this: Gmail Google owned by url ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 Binary predicates RDF offers only binary predicates. From the example,
Think of them as P(x,y) where P is the relationship between the objects x and y. From the example, X = Y = Jan Egil Refsnes P = author Jan Egil Refsnes author

23 RDF triple example(1) RDF graph example:

24 RDF triple example (2) RDF graph example:

25 RDF triple example (3) RDF/XML code that corresponds to the graph on the previous slide: <?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:contact=" <contact:Person rdf:about=" <contact:fullName>Eric Miller</contact:fullName> <contact:mailbox <contact:personalTitle>Dr.</contact:personalTitle> </contact:Person> </rdf:RDF>

26 URIs and RDF RDF uses URI references to define its subjects, predicates, and objects. A URI reference (or URIref) is a URI, together with an optional fragment identifier at the end. E.g., the URI consists of: the URI the fragment identifier: section2. A resource is identifiable by a URI reference

27 RDF serialization formats
RDF/XML; Notation 3 (N3); Turtle; N-Triples.

28 RDF/XML RDF/XML is a syntax, defined by the W3C, to express (serialize) an RDF graph as an XML document; According to the W3C, "RDF/XML is the normative syntax for writing RDF"; Was endorsed as a recommendation on February 10, 2004.

29 RDF/XML example <rdf:RDF xmlns:rdf=" xmlns:dc=" xmlns:geo=" w3.org/2003/01/geo/wgs84_pos#" xmlns:edu=" <rdf:Description rdf:about=" <geo:lat>40.35</geo:lat> <geo:long>-74.66</geo:long> <edu:hasDept rdf:resource=" </rdf:Description> <rdf:Description rdf:about=" <dc:title>Department of Computer Science</dc:title> </rdf:RDF>

30 Notation3 (N3) Much more compact and readable format that doesn’t use XML syntax ; Is being developed by Tim Berners-Lee and Semantic Web community members; N3 files use UTF-8 encoding.

31 Example (graph)

32 Example in RDF/XML <rdf:RDF xmlns:rdf=" xmlns:m=" xmlns=" xmlns:p=" <rdf:Description about=" <m:homePage resource=" </rdf:Description> <rdf:Description about=" <m:attending resource=" <p:GivenName>Fred</p:GivenName> <p:has </rdf:RDF>

33 Example in Notation3 @prefix p: < . @prefix m: < . < p:GivenName "Fred"; p:has m:attending < . < m:homePage < .

34 Turtle Is Notation3 subset that also uses non-XML syntax;
Very popular RDF serialization format; Was developed by Dave Beckett; Turtle files use UTF-8 encoding.

35 1st example (RDF/XML) <?xml version="1.0"?>
<rdf:RDF xmlns:rdf=" xmlns:dc=" xmlns:ex=" <rdf:Description rdf:about=" dc:title="RDF/XML Syntax Specification (Revised)"> <ex:editor> <rdf:Description ex:fullName="Dave Beckett"> <ex:homePage rdf:resource=" /> </rdf:Description> </ex:editor> </rdf:RDF>

36 4/11/2017 6:03 PM 1st example (Turtle) @prefix rdf: < . @prefix dc: < . @prefix ex: < . < dc:title "RDF/XML Syntax Specification (Revised)" ; ex:editor [ ex:fullname "Dave Beckett"; ex:homePage < ] . ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

37 2nd example (graph)

38 2nd example (Turtle) @prefix rdf: < @prefix contact: < < rdf:type contact:Person; contact:fullName "Eric Miller"; contact:mailbox contact:personalTitle "Dr.".

39 N-Triples Is Turtle and Notation3 subset;
Developed by Dave Beckett and Art Barstow (W3C); N-Triples is a simpler fromat.

40 Example (RDF/XML) <rdf:RDF
xmlns:rdf=" xmlns:dc=" <rdf:Description rdf:about=" <dc:creator>Art Barstow</dc:creator> <dc:creator>Dave Beckett</dc:creator> <dc:publisher rdf:resource=" </rdf:Description> </rdf:RDF>

41 Example (N-Triples) < < "Dave Beckett" . < < "Art Barstow" . < < <

42 Notation3 subsets

43 What is schema? The word schema comes from the Greek word "σχήμα" (skhēma), which means shape, or more generally, plan. Schema (comp. science) is a logical description of the data in a data base, including definitions and relationships of data.

44 RDF Schema (RDFS) RDF Schema provides a way to express:
simple statements defining classes of resources including subclass relationships, statements defining properties including subclass relationships, statements about domain and range of a property.

45 RDF Schema: A meta-language
RDF Schema's type system is similar to those of object-oriented programming languages. RDF Schema allows resources to be defined as instances of one or more classes. Classes can be organized in a hierarchical fashion; for example, a class ex:Dog can be defined as a subclass of ex:Mammal, meaning that any resource which is in class ex:Dog is also in class ex:Mammal. The RDF Schema (RDFS:) is defined in a namespace whose URI is:

46 Sample case: MotorVehicle
To say that ex:MotorVehicle is a class, write: ex:MotorVehicle rdf:type rdfs:Class . To create an instance of ex:MotorVehicle, write: exthings:companyCar rdf:type ex:MotorVehicle . Naming convention: class names start with an uppercase letter; property and instance names are lowercase. A resource may be an instance of more than one class.

47 Defining Subclasses Using subClassOf property we can define specialized kinds of motor vehicles (e.g., passenger vehicles, vans, minivans, etc). ex:Van rdf:type rdfs:Class . ex:Van rdfs:subClassOf ex:MotorVehicle . ex:Truck rdf:type rdfs:Class . ex:Truck rdfs:subClassOf ex:MotorVehicle .

48 Meaning of Subclass subClassOf means if ex:myVan is an instance of ex:Van, then ex:myVan is also, by inference, an instance of ex:MotorVehicle. subClassOf is (obviously) transitive: If ex:Van rdfs:subClassOf ex:MotorVehicle . and ex:MiniVan rdfs:subClassOf ex:Van . then ex:MiniVan is implicitly a subclass of ex:MotorVehicle. A class may be a subclass of more than one class. All classes are implicitly subclasses of class rdfs:Resource.

49 A Full Class Hierarchy The (ex:Truck rdf:type rdfs:Class) part of the graph is not shown. Notice Minivan is subClassOf two classes.

50 Vehicle Hierarchy in RDF/XML
<?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:rdfs=" <rdf:Description rdf:ID="MotorVehicle"> <rdf:type rdf:resource=" </rdf:Description> <rdfs:Class rdf:ID="PassengerVehicle"> <rdfs:subClassOf rdf:resource="#MotorVehicle"/> </rdfs:Class> ... <rdfs:Class rdf:ID="MiniVan"> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/> </rdfs:Class > </rdf:RDF>

51 Class Naming Fragment identifiers, like MotorVehicle, use rdf:ID give the effect of "assigning" URIrefs relative to the schema document. Relative URIrefs based on these names can then be used in other class definitions within the same schema, e.g., #MotorVehicle. The full URIref of this class would be: We could also include an explicit declaration: xml:base="

52 Different instance creation approaches
<?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:ex=" <rdf:Description rdf:ID="companyCar"> <rdf:type rdf:resource=" </rdf:Description> <ex:MotorVehicle rdf:ID="anotherCar"> </ex:MotorVehicle> </rdf:RDF> Notice

53 Properties All properties in RDF are described as instances of class rdf:Property, e.g. exterms:weightInKg rdf:type rdf:Property . RDF Schema provides rdfs:range to define valid fillers for a triple’s Object. RDF Schema provides rdfs:domain to define valid fillers for a triple’s Subject.

54 rdfs:range property If the property ex:author has values that are instances of class ex:Person, we would write: ex:Person rdf:type rdfs:Class . ex:author rdf:type rdf:Property . ex:author rdfs:range ex:Person . If a property has more than one range, then its filler must be an instance of all of the classes specified as the ranges: ex:hasMother rdf:type rdf:Property . ex:hasMother rdfs:range ex:Person . ex:hasMother rdfs:range ex:Female . ex:Sally ex:HasMother exstaff:frances exstaff:frances must be both a Female and a Person.

55 Typed literals as ranges
To say that the range of ex:age is an integer: ex:age rdf:type rdf:Property . ex:age rdfs:range xsd:integer . The datatype xsd:integer is identified by its URIref ( It is optional, but “useful” to declare: xsd:integer rdf:type rdfs:Datatype . This statement documents the existence of the datatype, and indicates explicitly that it is being used in this schema.

56 rdfs:domain property rdfs:domain indicates that a particular property applies to a class. Suppose books have authors. In RDF: ex:Book rdf:type rdfs:Class . ex:author rdf:type rdf:Property . ex:author rdfs:domain ex:Book . If a property has more than one domain, then any subject instance of that property must be an instance of each named domain.

57 Part of the RDF/XMLVehicle schema
<rdf:Description rdf:ID="registeredTo"> <rdf:type rdf:resource=" <rdfs:domain rdf:resource="#MotorVehicle"/> <rdfs:range rdf:resource="#Person"/> </rdf:Description> <rdf:Property rdf:ID="rearSeatLegRoom"> <rdfs:domain rdf:resource="#PassengerVehicle"/> <rdfs:range rdf:resource=" </rdf:Property> <rdfs:Class rdf:ID="Person" />

58 Specializing Properties
Like rdfs:subClassOf, property rdfs:subPropertyOf is used to define a property hierarchy. For example, to say that the property ex:primaryDriver is a kind of ex:driver, write: ex:driver rdf:type rdf:Property . ex:primaryDriver rdf:type rdf:Property . ex:primaryDriver rdfs:subPropertyOf ex:driver . This means that if an instance ex:fred is a ex:primaryDriver of the instance ex:companyVan, then ex:fred is also a ex:driver of ex:companyVan.

59 subPropertyOf property
A property may be a subPropertyOf zero, one or more properties. All RDF rdfs:range and rdfs:domain properties that apply to an RDF property also apply to each of its subproperties. Therefore, because of its subproperty relationship to ex:driver, implicitly ex:primaryDriver also has an rdfs:domain of ex:MotorVehicle.

60 subPropertyOf example (RDF/XML)
<rdf:Description rdf:ID="driver"> <rdf:type rdf:resource=" <rdfs:domain rdf:resource="#MotorVehicle"/> </rdf:Description> <rdf:Property rdf:ID="primaryDriver"> <rdfs:subPropertyOf rdf:resource="#driver"/> </rdf:Property>

61 An Instance of ex:PassengerVehicle
<?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:ex=" <rdf:Description rdf:ID="johnSmithsCar"> <rdf:type rdf:resource= " <ex:registeredTo rdf:resource=" <ex:rearSeatLegRoom rdf:datatype= " </ex:rearSeatLegRoom> <ex:primaryDriver rdf:resource=" </rdf:Description> </rdf:RDF>

62 Example <!-- Top level class 'Staff' -->
4/11/2017 6:03 PM Example <!-- Top level class 'Staff' --> <rdfs:Class rdf:ID="Staff" rdfs:comment="A Staff member"> <rdfs:subClassOf rdf:resource="&rdfs;Resource"/> </rdfs:Class> <!-- Subclasses of Staff --> <rdfs:Class rdf:ID="Researcher" rdfs:comment="A Researcher"> <rdfs:subClassOf rdf:resource="#Staff"/> <rdfs:Class rdf:ID="Intern"> <rdfs:subClassOf rdf:resource="#Researcher"/> ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

63 Example <rdf:Property rdf:ID="LName" rdfs:comment="Last Name">
4/11/2017 6:03 PM Example <rdf:Property rdf:ID="LName" rdfs:comment="Last Name"> <rdfs:domain rdf:resource="#Staff"/> <rdfs:range rdf:resource="&rdfs;Literal"/> </rdf:Property> <rdf:Property rdf:ID="Author" rdfs:comment="Authors of the paper" rdfs:domain="#Paper" /> ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

64 RDF Container Elements
4/11/2017 6:03 PM RDF Container Elements RDF containers are used to describe group of things (resources or literals): rdf:Bag – used to describe a list of values that do not have to be in a specific order. rdf:Seq – used to describe an ordered list of values (for example, in alphabetical order). rdf:Alt – used to describe a list of alternative values (the user can select only one of the values). ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

65 RDF Container Elements (rdf:Bag)
4/11/2017 6:03 PM RDF Container Elements (rdf:Bag) <rdf:Description rdf:about=" <cd:artist> <rdf:Bag> <rdf:li>John</rdf:li> <rdf:li>Paul</rdf:li> <rdf:li>George</rdf:li> <rdf:li>Ringo</rdf:li> </rdf:Bag> </cd:artist> </rdf:Description> ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

66 RDF Container Elements (rdf:Seq)
4/11/2017 6:03 PM RDF Container Elements (rdf:Seq) <rdf:Description rdf:about=" <cd:artist> <rdf:Seq> <rdf:li>George</rdf:li> <rdf:li>John</rdf:li> <rdf:li>Paul</rdf:li> <rdf:li>Ringo</rdf:li> </rdf:Seq> </cd:artist> </rdf:Description> ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

67 RDF Container Elements (rdf:Alt)
4/11/2017 6:03 PM RDF Container Elements (rdf:Alt) <rdf:Description rdf:about=" <cd:format> <rdf:Alt> <rdf:li>CD</rdf:li> <rdf:li>Record</rdf:li> <rdf:li>Tape</rdf:li> </rdf:Alt> </cd:format> </rdf:Description> ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

68 IsaViz: A Visual Authoring Tool for RDF
4/11/2017 6:03 PM IsaViz: A Visual Authoring Tool for RDF ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

69 Jena - open source Semantic Web framework
4/11/2017 6:03 PM Jena - open source Semantic Web framework ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

70 4/11/2017 6:03 PM RDF storage RDF triple store is a system that provides a mechanism for persistent storage and access of RDF graphs. ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

71 Different Architectures
Based on their implementation, triple stores can be divided into 3 broad categories : In-memory, Native, and Non-native, Non-memory. In – Memory : RDF Graph is stored as triples in main –memory. For example, storing an RDF graph using Jena API/ Sesame API. Native : Persistent storage systems with their own implementation of databases. Eg. Sesame Native, Virtuoso, AllegroGraph, Oracle 11g. Non-Native, Non-Memory : Persistent storage systems set-up to run on third party DBs. E. g., Jena SDB. RDF stores can be divided into 3 broad categories based upon how they are implemented. These are not precisely defined terms with rigid boundaries but something that can serve as rough guide to what a triple store is. Native Stores: Provide support for transactions, own SQL compiler and generally their own procedure language. Will explain in detail what I mean by this term in the later slides.

72 4/11/2017 6:03 PM Graph databases ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

73 Graph database example
4/11/2017 6:03 PM Graph database example ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

74 Oracle’s RDF/OWL Architectural Overview
4/11/2017 6:03 PM Oracle’s RDF/OWL Architectural Overview SPARQL Endpoints Joseki / Sesame OBIEE via SPARQL Gateway Tools Visualizer Cytoscape-based Java API support SPARQL: Jena / Sesame JDBC Java Programs SQL Interface SQLplus PL/SQL SQLdev. Programming Interface Ontology-assisted Query of Enterprise Data Query RDF/OWL data and ontologies INFER LOAD RDF/S User-def. OWLsubsets Bulk-Load Incr. DML Core functionality QUERY (SPARQL in SQL) 3rd-Party Callouts Reasoners: Pellet NLP Extractors Enterprise (Relational) data RDF/OWL data and ontologies Rulebases: OWL, RDF/S, user-defined Inferred RDF/OWL data RDF/OWL Oracle DB Security: Oracle Label Security Semantic Indexes ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

75 Paldies par uzmanību! 4/11/2017 6:03 PM
©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "Semantic Web Andrejs Lesovskis 4/11/2017 6:03 PM"

Similar presentations


Ads by Google