66
The Semantic Web Web Science Systems Development Spring 2015

The Semantic Web Web Science Systems Development Spring 2015

Embed Size (px)

Citation preview

Page 1: The Semantic Web Web Science Systems Development Spring 2015

The Semantic Web

Web Science Systems DevelopmentSpring 2015

Page 2: The Semantic Web Web Science Systems Development Spring 2015

AgendaHistory / Background

Linked Data

RDF

SPARQL

OWL

Applications

Current state of the Semantic Web

Page 3: The Semantic Web Web Science Systems Development Spring 2015

The WebCore Principles

Standard for identifying resources

Standard for representing resources

Standard for exchanging resources

Page 4: The Semantic Web Web Science Systems Development Spring 2015

The WebCore Principles

Standard for identifying resources

Standard for representing resources

Standard for exchanging resources

Standards:

URIs (URLs): Uniform Resource Identifier (Locator)

HTML: Hypertext Markup Language

HTTP: Hypertext Transfer Protocol

Page 5: The Semantic Web Web Science Systems Development Spring 2015

URI Identifies one resource

A resource could be anything

URIs are persistent

URLs also locate and are

aligned with protocols URLs are dereferenceable

URLs

mailto:[email protected]

ftp://example.org/aDirectory/aFile

ldap://ldap.example.org/c=GB?objectClass?one

Page 6: The Semantic Web Web Science Systems Development Spring 2015

HTML It is not the resource

Serialization of information

A resource can have multiple

representations

Manifestation of the resource as

a digital document Retrievable resources:

Encode data and information Link to other resources (creating the “Web”)

Page 7: The Semantic Web Web Science Systems Development Spring 2015

HTTPProtocol for information exchange on the web

Protocol is specified in the URL

Used for client-server communication (request-response protocol)

Structured text (header, body,…)

Currently at http/1.1 (since 1999), http/2 in draft form

Page 8: The Semantic Web Web Science Systems Development Spring 2015

One Web

Page 9: The Semantic Web Web Science Systems Development Spring 2015

Principles of a healthy webIdentify resources using URIs

Use HTTP in URIs so that people can look up resources

When someone looks up a resource, return useful information (using standard representation e.g. HTML)

Link to other URIs

Page 10: The Semantic Web Web Science Systems Development Spring 2015

LinkingAsserts relevance/quality of page

Allows discovery

Creates the “Web” effect

Page 11: The Semantic Web Web Science Systems Development Spring 2015

The Semantic WebWhat is it?

Semantics, knowledge representation, ontologies and agents.

Page 12: The Semantic Web Web Science Systems Development Spring 2015
Page 13: The Semantic Web Web Science Systems Development Spring 2015

Linked DataFrom the web of documents to the web of data

Page 14: The Semantic Web Web Science Systems Development Spring 2015

Documents VS. Data

Page 15: The Semantic Web Web Science Systems Development Spring 2015

Web of documents

HTML Data

HTML Data

HTML Data

HTMLData

HTMLData

Page 16: The Semantic Web Web Science Systems Development Spring 2015

Web of data

Data

Data

Data

Data

Data

Data

Page 17: The Semantic Web Web Science Systems Development Spring 2015

One Web

Page 18: The Semantic Web Web Science Systems Development Spring 2015

RDFResource Description Framework

Page 19: The Semantic Web Web Science Systems Development Spring 2015

Semantic Web Stack

Page 20: The Semantic Web Web Science Systems Development Spring 2015

RDF: Resource Description Framework

The triple

Subject ObjectPredicate

Page 21: The Semantic Web Web Science Systems Development Spring 2015

RDF: Resource Description Framework

The triple

Subject ObjectPredicate

“WebSci” “Ahmed”“hasTA”

Page 22: The Semantic Web Web Science Systems Development Spring 2015

RDF Triple

Subject Predicate Object

IRI Literal

Resource

denotes

denotes denotes

Blank Node

representedBy representedB

y

representedBy

Page 23: The Semantic Web Web Science Systems Development Spring 2015

RDF triple

“article”“James

Hendler”

“hasCreator”

http://dx.doi.org//10.1109/MC.2009.30

http://dbpedia.org/resource/

James_Hendler

http://purl.org/dc/elements/1.1/creator

Page 24: The Semantic Web Web Science Systems Development Spring 2015

RDFA triple is true if the relationship holds between the

subject and the object

ResourceCan be ‘anything’, including documents, people,

physical objects, and abstract concepts

IRI: Internationalized Resource Identifier IRIs conform to Universal Character Set, not just

ASCII IRIs are global, dereferenceable and persistent

Blank nodes are anonymous resources

Page 25: The Semantic Web Web Science Systems Development Spring 2015

RDFGraph-based Data Model

Visualized as diagram of nodes and directed-arcs

Nodes represent ‘entities’ and are resourcesArcs represent relationships between the

nodes and are also resources

RDF Graph consists of a set of triples

Page 26: The Semantic Web Web Science Systems Development Spring 2015

RDF Graph

Page 27: The Semantic Web Web Science Systems Development Spring 2015

Raw RDF

Page 28: The Semantic Web Web Science Systems Development Spring 2015

RDF Serializations (representations)Multiple serializations

RDF/XML

JSON-LD Turtle family

Turtle

N3 Trig

Page 29: The Semantic Web Web Science Systems Development Spring 2015

RDF/XML

Page 30: The Semantic Web Web Science Systems Development Spring 2015

JSON-LD

Page 31: The Semantic Web Web Science Systems Development Spring 2015

N3

Page 32: The Semantic Web Web Science Systems Development Spring 2015

RDFa

Page 33: The Semantic Web Web Science Systems Development Spring 2015

Querying RDFHow to retrieve linked data?

How and where to query RDF graphs?

Page 34: The Semantic Web Web Science Systems Development Spring 2015

SPARQLSPARQL Protocol and RDF Query Language

Page 35: The Semantic Web Web Science Systems Development Spring 2015

Semantic Web Stack

Page 36: The Semantic Web Web Science Systems Development Spring 2015

SPARQLLanguage for querying RDF

Triplestores and endpoints

Queries consist of triple patterns, conjunctions, disjunctions and optional patterns

SPARQL is a protocol that defines how an endpoint responds to a query

Page 37: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query (basic)PREFIX geo: <http://www.opengis.net/ont/geosparql#>PREFIX geof: <http://www.opengis.net/def/function/geosparql/>PREFIX sf: <http://www.opengis.net/ont/sf#>PREFIX vocab: <http://localhost:2020/resource/vocab/>PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>PREFIX rpi: <http://openmap.rpi.edu#>

SELECT DISTINCT ?professor ?course ?buildingWHERE {

?prof a rpi:Professor. ?course rpi:instructedBy ?professor. ?course rpi:courseTitle ?title.

?course rpi:hostedInBuilding ?building. ?building rdfs:label ?label.

FILTER regex(?title,"WEB") }

Namespaces

Patterns to match

Filter

Variables

Page 38: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query result

Page 39: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query (complex)Federated query + GeoSPARQL

PREFIX geo: <http://www.opengis.net/ont/geosparql#>

PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

PREFIX sf: <http://www.opengis.net/ont/sf#>

PREFIX vocab: <http://localhost:2020/resource/vocab/>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX rpi: <http://openmap.rpi.edu#>

SELECT DISTINCT ?professor ?course ?building

WHERE {

?course vocab:rpi_class_schedule_all_building_id ?building.

SERVICE <http://localhost:8080/parliament/sparql> {

?professor a rpi:Professor.

?course rpi:instructedBy ?professor.

?building rdfs:label ?label.

?building geo:hasGeometry ?geo.

?geo geo:asWKT ?xy

FILTER(geof:sfIntersects(?xy,"POINT(-73.681948 42.730076)" ^^<http://www.opengis.net/ont/sf#wktLiteral>))

}}

‘Remote’ Endpoint

GeoSPARQL Function

Page 40: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query (complex) result

Page 41: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query (inference)PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX rpi: <http://openmap.rpi.edu#>

PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?s

WHERE {

?s a rpi:Person.

?s foaf:knows <http://openmap.rpi.edu#Ahmed_Eleish>

}

Superclass

Page 42: The Semantic Web Web Science Systems Development Spring 2015

SPARQL query (inference) result

Page 43: The Semantic Web Web Science Systems Development Spring 2015

OWLWeb Ontology Language

Page 44: The Semantic Web Web Science Systems Development Spring 2015

Semantic Web Stack

Page 45: The Semantic Web Web Science Systems Development Spring 2015

Web Ontology Language Provides semantics/structure to RDF

Computational logic-based language, allows reasoning by computer programs to:Verify consistency of knowledgeMake implicit knowledge explicit

Enables inference of new triples from existing ones

Used to build ontologies/vocabularies

Rules that constrain relationships between entities in a domain

Page 46: The Semantic Web Web Science Systems Development Spring 2015

OWL basic notionsAxioms

Entities

Expressions

Page 47: The Semantic Web Web Science Systems Development Spring 2015

OWL componentsClass hierarchies

Object properties

Property hierarchies

Domain & range restrictions

Datatypes

Page 48: The Semantic Web Web Science Systems Development Spring 2015

RPI Campus Ontology

Page 49: The Semantic Web Web Science Systems Development Spring 2015

Ontology Engineering

Expressivity

Implementation

Maintenance

Query Rules

Infer

Page 50: The Semantic Web Web Science Systems Development Spring 2015

Applications of Linked Data

Page 51: The Semantic Web Web Science Systems Development Spring 2015

Linking related dataWebsites with related data on different platforms

Page 52: The Semantic Web Web Science Systems Development Spring 2015

Linking related dataWebsites with related data on different platforms

RDBWebsite

A

Website B

Triplstore

Mapping File

RDF

SPARQL-to-SQL

Direct Mapping

XML

XSLT

Page 53: The Semantic Web Web Science Systems Development Spring 2015

RPI campus map applicationMap of the RPI campus with clickable features

(buildings, emergency callboxes,…etc.)

Geolocation data in KML for projection and in RDF for GeoSPARQL queries

Class schedule scraped off SIS in RDBMS

Mapping of schedule to RDF for SPARQL queries

Page 54: The Semantic Web Web Science Systems Development Spring 2015

Campus map KML

Page 55: The Semantic Web Web Science Systems Development Spring 2015

Campus map RDF

Page 56: The Semantic Web Web Science Systems Development Spring 2015

Class schedule

Page 57: The Semantic Web Web Science Systems Development Spring 2015

RPI campus map applicationHTML/JavaScript front-end

PHP back-end

OpenLayers 3 mapping API

OpenStreetMap tiles

Class schedule csv loaded into MySQL

D2RQ server mapping MySQL to RDF

Map data RDF loaded into Parliament triplestore

Page 58: The Semantic Web Web Science Systems Development Spring 2015

RPI Campus Map

Page 59: The Semantic Web Web Science Systems Development Spring 2015

Current state of the Semantic Web

Page 60: The Semantic Web Web Science Systems Development Spring 2015

Evolution of the web

Page 61: The Semantic Web Web Science Systems Development Spring 2015

Linked Open Data (2007)

Page 62: The Semantic Web Web Science Systems Development Spring 2015

Linked Open Data (2008)

Page 63: The Semantic Web Web Science Systems Development Spring 2015

Linked Open Data (2009)

Page 64: The Semantic Web Web Science Systems Development Spring 2015

Linked Open Data (now)

Page 65: The Semantic Web Web Science Systems Development Spring 2015

Open linked data

Page 66: The Semantic Web Web Science Systems Development Spring 2015

References Tim Berners Lee’s proposal - http://info.cern.ch/Proposal.html

W3C web architecture - http://www.w3.org/TR/webarch/

W3C Technology Stack - http://www.w3.org/Consortium/techstack-desc.html

Google PageRank - http://en.wikipedia.org/wiki/PageRank

Scientific American – The Semantic Web -http://www.cs.umd.edu/~golbeck/LBSC690/SemanticWeb.html

RDF – Resource Description Framework - http://www.w3.org/TR/rdf11-concepts/

SPARQL – SPARQL Protocol & RDF Query Language - http://www.w3.org/TR/sparql11-protocol/

OpenStreetMap - http://www.openstreetmap.org/

Parliament Triplestore - http://parliament.semwebcentral.org/

D2R Server - http://d2rq.org/

Linked Open Data - http://lod-cloud.net/