Skip to content

Instantly share code, notes, and snippets.

@sayoojsamuel
Last active December 16, 2020 14:49
Show Gist options
  • Save sayoojsamuel/1b16f9bdadf042558ea622054fec9bc0 to your computer and use it in GitHub Desktop.
Save sayoojsamuel/1b16f9bdadf042558ea622054fec9bc0 to your computer and use it in GitHub Desktop.
[15CSE366] Semantic Web

Semantics Web

Video Notes

Lecture 1

01 Evolutionof th web

First network - ARPANET

WWW was born at European Nuclear Research Center, CERN 1990

Authors

  • JCR Licjlider
  • Robert Taylor
  • Larry Roberts

02 Limits of the current web

WEb is supposed to be used by humans

HTML describes

  • how information is presented
  • how information is linked
  • but not what information means

03 Importance of Meaning

  • Semantic Pertains to the character, the study of meaning. It is the study of interpretations of signs or symbols as used by agents or communitites.

The semantics of a message depends on context and pragmatics.

  • Syntax Arragngement, ordering as in grammatics denotes the study of principles and processes by which sentences are constructed in a particular language.

  • Context denotes the surrounding of a symbol in an expression. It is neccessary to make sense of the semantics, to determine the meaning.

-Pragmatics reflects the intention by which the language is used to comminicate a message. It also denotes the intended purpose of the speaker.

Successful Communication

  • information has to be correctly transmittted (Syntax)
  • meaning (Semantics) of information must be intepreted correctly
  • understanding depends on the
    • context of both sender and receiver
    • pragmatics of the sender
  • contest of sender and receiver depends on the
    • experience of the sender and receiver

04 The limits of the web

Problem 1: Information Retrieval

  • traditional keyword-based search does not fild all results
  • synonyms and metaphors
  • Polusemy - missing context definition

Problem 2: Information Extraction

  • can only be solved correctly bu a human agent
  • heterogeneous distribiution and order of information

Problem 3: Maintanance

  • syntatic and semantic consitency
  • correctness
  • timeliness

Personalization

  • adaptaion of the presented information content to personal requirements
  • personalization vs data security

SPARQL Week 10

SPARQL 1

How to query RDFS

SPARQL1.1

  1. Assignments
PREFIX ex: <url>
SELECT ?Item (?Pr*1.1 AS ?NewP )
WHERE { ?Item ex:price ?Pr }
  1. Aggregate
PREFIX ex: <url>
SELECT (Count(?Item) AS ?C) 
WHERE { ?Item ex:price ?Pr }

...

  • Sum
  • Avg
  • Min
  • Max
  • Sample
  • Group_Concat
  1. Sample, Groupconcat
PREFIX foaf: <...>
SELECT ( SAMPLE(?N) as ?Name)
       ( GROUP_CONCAT(?M, SEPARATOR=", ") AS ?Nicknames )
WHERE { ?P a foaf:Person;
         foaf:name ?N ;
         foaf:nick ?M .
         }
GROUP BY ?P .
         

Additional Features

  1. Inverse Object Property Subject with ^ symbol

  2. Inverse path sequences

{ ?x foaf:knows/^foaf:knows ?y .
    FILTER (?x != ?y) }
  1. Arbitrary length Match
{ ?x foaf:mbox <email> .
  ?x foaf:knows+/foaf:name ?name . }
  1. negated property paths
{ ?x !(rdf:type|^rdf:type) ?y } 

SPARQL 2

How to store RDF data

  1. Giant Triple Storage and convert sparql to sql query

  2. ID based triple storage

  3. Quad Tables have a new column to specify the graph that the triple corresponds to

  4. Property Tables

  5. Vertically partitioned tables

  • row based
  • column based
  1. hexastores

Sparql limitations

  1. Cardinality limitations
  2. Class combination
  3. Cannot show disjunctive relations
  4. Locality of global properties
  5. special property constrains
  • transitive
  • uniqueness
  • inversiveness

SPARQL Week 10

The concept of Ontology in Computer Science

An ontology is an explicit, format specification of a shared conceptualization.

Conveptualization: Abstract model formal: machine understandable

How to represent ontologies

Using

  • Classes : represent concepts, and described via attributes
  • Relations
  • Instances

Classes are related to other classes Relations are special attributes, whose values are objects to other classes.

Constrains (rules) can be devined that determines values allowed values for relations.

Week 14

Applications in the Web of Data

Linked DAta Egnineering

Data is locked in small data islands.
Other applications usually cannot access this data

Apply semantiv technologies with RDF and OWL to link data between the islands.

linked Data Principles

  1. Use URI's as names for things
  2. Use HTTP URI's so that people can look up those names
  3. For each URI, provide useful information using the standards (RDF, SPARQL)
  4. Include links to related URI's and other objects.

Explanation

  1. Use HTTP URI's so that people can look up those names
  • Use http content negotiation to differentiate resource for machine/humans -- application/rdf+xml or application/text+html
  1. For each URI, provide useful information using the standards (RDF, SPARQL)
  • make all rui in the rdf graph deferencable.
  • avoid rdf constructs that cause problem in linked data context -- rdf reification -- rdf collections and containers -- unnamed blank nodes - because they are not accessible from outside.
  1. Include links to related URI's and other objects.
  • relationship links
  • identity links
  • vocabulary links

Semantic Maships

Are applications that use linked RDF data from varous data sources. enables navigation helps crawlers

Linked data engineering 2

OWL

owl:same as -> connect identical indiciduals owl:equivalentClass -> connect equivalent class

It cannot connect almost similar classes -: limitation

Unbel Ontologies

Upper Mapping and Binding Exchange Layer Subset of OpenCyc as RDF Tribles based on SKOS and OWL2

Upper ontology with 28,000 ontologies

SKOS

Simple Knowledge Organization System bsed on RDF and RDFS

skos:concept (classes) skos:narrower :broader :related :exactMAtch, narrowMatch, :broadMatch, relatedMatch

Sources on the web

Native publication, Implementatin of wrappers linking open data project

Semantic web

Week 2

05 The Vision of the Semantic Web | Entities and Classes

Precondition: condtent can be read and interpreted correctly by machine

Semantic Web: Natural language we content willl be explicitly annotated with semantic metadata.

Extract meaning out of raw data.

Meaning

meaning of entities and classes must be defined explicitily.
Classify data inito appropriate classes and entities, following the exact relations.

Meaning (semantics) is expresses with the help of appropriate knowledge representations (Ontologies)

Data have properties which also have relationsips among then, and are ...

Definition

The meaning of information (semantcs) is made explicit by formal (structured) and standardized knowledge representations (ontologies).

Thus it will be possible to

  • process the meaning of information automatically
  • to relate and intergrate heterogeneous data
  • to deduce implicaite information from existing information in an automated way.

RDF Resource Description Framework.

Subject, Property, Object

07: Applications of Web of Data

Semantic web

Week 3

01 Basic Architecture | How to identify things

Semiotic Triange

Concept, Symbol and Object Concept symbolizes Symbol which stands for an object. Concept refers to object.

URI - Uniform Resource Identifier defines a simple and extensible schema for worldwide unique identification of abstract or phisycal resources.

Designator, Designatum

Designatiror showcases and discusses the real world object - designatum.

  • A resource can be described (designated) via Metadata
  • Resouce representation might be available that describes the resource sufficiently from the web server.

URI

URI combines

  • Address (Locator)
    • URL
    • might change during life cycle
  • Identity (Name)
    • URN
    • persistant identifyer for web resouce
    • remains unchanged during life cycle

Seperate URI for designator and designatum

02 How to Represent Facts

Resource Description Framework

Intuitive knowledge representation with directed graphs

Level 1 (objects) : XML Level 2 (knowledge about objects): RDF and RDFSchema Level 3 (entire world): OWL and Rules (web ontology language)

RDF

  • Resource
    • can be anything
    • must be uniqly identifiable
  • Description
    • desc of resouces
    • via representation properties and relationships among resouces
    • relattionships can be representated as graphs
  • Framework
    • made of web frameworks
    • based on formal semantic models

knowledge in rdf is expressed as a list of statements

Subject -> Property -> object

RDF-TRIPLE: Resouce + Property + Object/Value

Constituents of RDF graphen

URI / Another Resource LITERALS BLANK NODES

RDF representations

NodeEdge - NodeTriple

N3 Notation

{ SUBJECT_URI, 
  SUBJECT_URL#Property,
  OBJECT_URI
}

Turtle (Turse RDF Triple Language)

<subject> <property> <object> .	  <= for uri
<subject> <property> "object" .   <= for literals

or can use prefix

@prefix mail: <sayoojsamuel@gmail.com>

We also have RDF xml serializarion to make it compatable with xml framework

03 | How to Represent facts Part 2

RDF with xml example

<xml version="1.0" encodin="utf-8">
<rdf:RDF 
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns# " 
	xmlns:pers="http://hpi-web.de/Personal#"
	xml:base="http://hpi-web.de/Lecturer">

	<rdf:Description rdf:about="#HaraldSack"    // rdf:ID="HaraldSack" is an alternative without #
		pers:hasPhoneNumber="++123456789">
		<pers:writesBlog rdf:resource="http://block.com"/>
	</rdf:Description>
<rdf:RDF>

RDF with Turtle

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix pers: <"http://hpi-web.de/Personal#"> .
@base <"http://hpi-web.de/Lecturer"> .

:HaraldSack pers:hasPhoneNumber "++123456779";
			pers:writesBlog <http://block.com"/>

RDF xml revisited / without XMLSchema NS

<xml version="1.0" encoding="utf-8">
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns# " 
	xmlns:lv="http://hpi-web.de/Lecture#" 
	
	<rdf:Description rdf:about="http://hpi.de/ws123#swt">
		<lv:Name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
			Senabtuc Web Technologies
		</lv:Name>
		<lv:SWS rdf:datatype="http://www.w3.org/2001/XMLSchema#int">
			4
		</lv:SWS>
	</rdf:Description>
</rdf:RDF>

RDF xml revisited / with XMLSchema NS

<xml version="1.0" encoding="utf-8">
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns# " 
	xmlns:lv="http://hpi-web.de/Lecture#" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	
	<rdf:Description rdf:about="http://hpi.de/ws123#swt">
		<lv:Name rdf:datatype="xs:string">
			Senabtuc Web Technologies
		</lv:Name>
		<lv:SWS rdf:datatype="xs:int">
			4
		</lv:SWS>
	</rdf:Description>
</rdf:RDF>

04 | How to Represent facts Part 3

Lecture on blank nodes, list and aggregates list

Blank Nodes

Blank nodes combine two or more nodes so that can be grouped together.
We can represent a blank node in xml as

<hpi-lv:takesPlace rdf:parseType="Resouce"/>  ... </hpi-lv:takesPlace>

The same can be represented as a list in Turtle

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix hpi-lv: <"http://hpi-web.de/Lecture#"> .

<http://hpi-web.de/ws1213#swt> hpi-lv:takesPlace [
	hpi-lv:hasDate "Tue 13:30";
	hpi-lv:hasRoom "HS3"
] ; hpi-lv:hasName "SemanticWebTechnologies".

We can assign the blanknodes id with rdf:nodeID="ID1"so that they can be dereferenced later.

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix hpi-lv: <"http://hpi-web.de/Lecture#"> .

<http://hpi-web.de/ws1213#swt> hpi-lv:takesPlace _:ID1 .

_:ID1 hpi-lv:hasDate "Tue 13:30";
	  hpi-lv:hasRoom "HS3" .

Lists

General Data Structure to enumerate any resource or literals Only shortcuts, no additional semantic expressivity

  • Container We can extend this list afterwards
  • Collections closed list, no further extension is possible

Container

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix hpi-lv: <"http://hpi-web.de/Lecture#"> .
@base <http://hpi-web.de/>

:swt lv:hasParticipants [
	a rdf:Seq:
	rdf:_1 <sayoojSamuel>;
	rdf:_2 <vivek>;
	rdf:_3 <mahes>;
	rdf:_4 <shenoi>;_
] .

the root node of the container is assigned a container-typ via rdf-type

  • rdf:Bag unordered set of elements, no order of given elements
  • rdf:Seq ordered set of elements
  • rdf:Alt defines alternatives of elements only one element of the given alternatives is relavant for the application

Collection

It is a linear list

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix lv: <"http://hpi-web.de/Lecture#"> .
@base <http://hpi-web.de/>

:swt lv:hasParticipants [
	rdf:first <vishakul>; rdf:rest [
	rdf:first <sayoojSamuel>; rdf:rest [
	rdf:first <vivek>; rdf:rest [
	rdf:first <mahes>; rdf:rest [
	rdf:first <shenoi>; rdf:rest rdf:nil .
]]]]] .

or in short, we can write

@prefix rdf: <"http://www.w3.org/1999/02/22-rdf-syntax-ns#"> .
@prefix lv: <"http://hpi-web.de/Lecture#"> .
@base <http://hpi-web.de/>

:swt lv:hasParticipants 
(<vishakul> <sayoojsamuel> <vivek>) .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment