Semantic Web and Python Concepts to Application development

Similar documents
RESOURCES DESCRIPTION FRAMEWORK: RDF

Building Blocks of Linked Data

COMPUTER AND INFORMATION SCIENCE JENA DB. Group Abhishek Kumar Harshvardhan Singh Abhisek Mohanty Suhas Tumkur Chandrashekhara

Finding Similarity and Comparability from Merged Hetero Data of the Semantic Web by Using Graph Pattern Matching

Reminder: RDF triples

Semantic Days 2011 Tutorial Semantic Web Technologies

Interacting with Linked Data Part I: General Introduction

SPARQL. Fausto Giunchiglia and Mattia Fumagallli. University of Trento

SPAR-QL. Mario Arrigoni Neri

Contents. G52IWS: The Semantic Web. The Semantic Web. Semantic web elements. Semantic Web technologies. Semantic Web Services

From the Web to the Semantic Web: RDF and RDF Schema

Querying Semantic Web Data

BASI DI DATI II 2 modulo Parte VIII: SPARQL

The Semantic Web DEFINITIONS & APPLICATIONS

Linked data and its role in the semantic web. Dave Reynolds, Epimorphics

Semantic Web. MPRI : Web Data Management. Antoine Amarilli Friday, January 11th 1/29

Unit 1 a Bird s Eye View on RDF(S), OWL & SPARQL

Multi-agent Semantic Web Systems: RDF Models

KNOWLEDGE GRAPHS. Lecture 3: Modelling in RDF/Introduction to SPARQL. TU Dresden, 30th Oct Markus Krötzsch Knowledge-Based Systems

BUILDING THE SEMANTIC WEB

Semantic Web. RDF and RDF Schema. Morteza Amini. Sharif University of Technology Spring 90-91

SPARQL. Dr Nicholas Gibbins

Knowledge Representation for the Semantic Web

Bringing the Semantic Web closer to reality PostgreSQL as RDF Graph Database

Introduction to a Web of Linked Data

Semantic Web In Depth: Resource Description Framework. Dr Nicholas Gibbins 32/4037

Today s Plan. INF3580/4580 Semantic Technologies Spring Reminder: RDF triples. Outline. Lecture 4: The SPARQL Query Language.

Introduction to RDF & SPARQL

Enhancing Security Exchange Commission Data Sets Querying by Using Ontology Web Language

Semantic Web Technologies: Assignment 1. Axel Polleres Siemens AG Österreich

Linked Data: What Now? Maine Library Association 2017

DC-Text - a simple text-based format for DC metadata

Querying RDF & RDFS. Several query languages exist to retrieve

RDF Next Version. Ivan Herman and Sandro Hawke W3C

Short introduction to the Semantic Web

Query. Ewan Klein. MASWS 12 February Multi-agent Semantic Web Systems: Query. Ewan Klein. Outline. Introduction RSS.

Chapter 3 Querying RDF stores with SPARQL

Linked Data and RDF. COMP60421 Sean Bechhofer

On the Semantics of Heterogeneous Querying of Relational, XML and RDF Data with XSPARQL

Introduction to Semantic Web Databases. Version 1 Prepared By: Amgad Madkour Ph.D. Candidate Purdue University April 2018

Deep integration of Python with Semantic Web technologies

Semantic Web Information Management

Linking Distributed Data across the Web

Orchestrating Music Queries via the Semantic Web

Organizing Existing Metadata Terms and Structural Constraints to Support Metadata Schema Creation

SEMANTIC WEB AN INTRODUCTION. Luigi De

Implementing and extending SPARQL queries over DLVHEX

Today: RDF syntax. + conjunctive queries for OWL. KR4SW Winter 2010 Pascal Hitzler 3

Outline RDF. RDF Schema (RDFS) RDF Storing. Semantic Web and Metadata What is RDF and what is not? Why use RDF? RDF Elements

RDF AND SPARQL. Part IV: Syntax of SPARQL. Dresden, August Sebastian Rudolph ICCL Summer School

Querying the Semantic Web

Day 2. RISIS Linked Data Course

User and Reference Manual

INF3580/4580 Semantic Technologies Spring 2015

Multi-agent and Semantic Web Systems: RDF Data Structures

Introduction to metadata cleansing using SPARQL update queries. April 2014 PwC EU Services

Semantic Web Fundamentals

Flat triples approach to RDF graphs in JSON

SPARQL QUERY LANGUAGE WEB:

RDFa: Embedding RDF Knowledge in HTML

MI-PDB, MIE-PDB: Advanced Database Systems

SPARQL Protocol And RDF Query Language

Part II. Representation of Meta-Information

Representing Linked Data as Virtual File Systems

> Semantic Web Use Cases and Case Studies

Proposal for Implementing Linked Open Data on Libraries Catalogue

RDFS. Suresh Manandhar* & Dimitar Kazakov

Towards the Semantic Desktop. Dr. Øyvind Hanssen University Library of Tromsø

O.Curé [1 ] Mashup, Microformats, RDFa and GRDDL

Bridging the Gap between Semantic Web and Networked Sensors: A Position Paper

SEMANTIC WEB 07 SPARQL TUTORIAL BY EXAMPLE: DBPEDIA IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Unit 2 RDF Formal Semantics in Detail

Bringing the Wiki-Way to the Semantic Web with Rhizome

JENA: A Java API for Ontology Management

Alexander Haffner. RDA and the Semantic Web

Semantic Web Systems Querying Jacques Fleuriot School of Informatics

Introduction to RDF and the Semantic Web for the life sciences

The Semantic Web Revisited. Nigel Shadbolt Tim Berners-Lee Wendy Hall

Semantic Web. Lecture 12: SW Programming Dr. Knarig Arabshian

SPARQL (RDF Query Language)

Metadata for general purposes

Formalising the Semantic Web. (These slides have been written by Axel Polleres, WU Vienna)

CHAPTER 1 INTRODUCTION

Resilient Linked Data. Dave Reynolds, Epimorphics

Incremental Export of Relational Database Contents into RDF Graphs

INFO216: Advanced Modelling

Filter: Evaluable Expression. List Syntax. Tests. Filter: Evaluable Expression. Tests : functions. Tests 06/09/2013. (1?x v )

D-RDF: Dynamic Resource Description Framework

Usage of Linked Data Introduction and Application Scenarios. Presented by: Barry Norton

Library of Congress BIBFRAME Pilot. NOTSL Fall Meeting October 30, 2015

Semantic Web Technologies: RDF + RDFS

SPARQL เอกสารหล ก ใน มคอ.3

RDF & RDF QUERY LANGUAGES BUILDING BLOCKS FOR THE SEMANTIC WEB

Knowledge Representation RDF Turtle Namespace

Ontological Modeling: Part 2

Linked Data and RDF. COMP60421 Sean Bechhofer

ITARC Stockholm Olle Olsson World Wide Web Consortium (W3C) Swedish Institute of Computer Science (SICS)

ITARC Stockholm Olle Olsson World Wide Web Consortium (W3C) Swedish Institute of Computer Science (SICS)

Graph Databases. Guilherme Fetter Damasio. University of Ontario Institute of Technology and IBM Centre for Advanced Studies IBM Corporation

Linked Open Data: a short introduction

Transcription:

PyCon 2009 IISc, Bangalore, India Semantic Web and Python Concepts to Application development Vinay Modi Voice Pitara Technologies Private Limited

Outline Web Need better web for the future Knowledge Representation (KR) to Web Challenges Data integration challenges KR to Web - solutions for challenges Metadata and Semantic Web protocol stack RDF, RDFS and SPARQL basic concepts Using RDFLib adding triples RDFLib serialization RDFLib RDFS ontology Blank node SPARQL querying Graph merging Some possible things one can do with RDFLib

Multimedia Text in Natural Languages Web Images Deduce the facts; create mental relationships

Need better Web for the future I Know What You Mean

KR to Web Challenges Traditional KR techniques and Network effect Algorithmic complexity and Performance for information space like W3 Scaling KR

KR to Web Challenges Continue 1 Representational Inconsistencies Machine down Partial Information

Data integration - Challenges Web pages, Corporate databases, Institutions Different content and structure Manage for Company mergers Inter department data sharing (like egovernment) Research activities/output across labs/nations Accessible from the web but not public.

Data Integration Challenges Example: Social sites add your contacts every time. Continue 1 Requires standard so that applications can work autonomously and collaboratively.

What is needed Some data should be available for machines for further processing Data should be possibly combined, merged on Web scale Some time data may describe other data i.e. metadata. Some times data needs to be exchanged. E.g. between Travel preferences and Ticket booking.

Metadata Data about data Two ways of associating with a resource Physical embedding Separate resource Resource identifier Globally unique identifier Advantages of explicit metadata Dublin core, FOAF

KR to Web Solution for Challenges Extra-logical infrastructure. Network effect Solve syntactic interoperability. Standards Semantic Web Scalable Representation languages Continue 2 Use Web Infrastructure

Semantic Web Web extension Exchange Integrate Process Information Machine automated

RDF basic concepts W3C decided to build infrastructure for allowing people to make their own vocabularies for talking about different objects. RDF data model: Resource Property Literal value Resource Property Resource

RDF basic concepts RDF graphs and triples: Subject Predicate Object Continue 1 http://in.pycon.org/s media/slides/semant icweb_python.pdf title Semantic Web and Python RDF Syntax (N3 format): @prefix dc: <http://http://purl.org/dc/elements/1.1/>. <http://in.pycon.org/smedia/slides/semanticweb_pyt hon.pdf> dc:title Semantic Web and Python

Subject (URI) RDF basic concepts Predicate (Namespace URI) Object (URI or Literal) Continue 2 Blank Node (Anonymous node; unique to boundary of the domain) Addison- Wesley http://.../isbn/ 67239786 a:publisher Boston

RDF basic concepts Ground assertions only. No semantic constraints Can make anomalous statements Continue 3

RDFS basic concepts Extending RDF to make constraints Allows to represent extra-knowledge: define the terms we can use define the restrictions What other relationships exist Ontologies

RDFS basic concepts Classes Instances Sub Classes Properties Sub properties Domain Range Continue 1

SPARQL basic concepts Data @prefix foaf: <http://xmlns.com/foaf/0.1/>. _:a foaf:name Vinay". _:b foaf:name Hari". Query PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT?name WHERE {?x foaf:name?name. } Results (as Python List) [ Vinay", Hari"]

SPARQL basic concepts Query matches the graph: find a set of variable -> value bindings, such that result of replacing variables by values is a triple in the graph. SELECT (find values for the given variable and constraint) CONSTRUCT (build a new graph by inserting new values in a triple pattern) ASK (Asks whether a query has a solution in a graph)

RDFLib Contains Parsers and Serializes for various RDF syntax formats In memory and persistent graph backend RDFLib graphs emulate Python container types best thought of a 3-item triples. [(subject, object, predicate), (subject, object, predicate), ] Ordinary set operations; e.g. add a triple, methods to search triples and return in arbitrary order

RDFLib Adding triple to a graph from rdflib.graph import Graph from rdflib import URIRef, Namespace inpyconslides = Namespace(''http://in.pycon.org/smedia/slides/'') dc = Namespace("http://purl.org/dc/elements/1.1/") g = Graph() g.add((inpyconslides['semanticweb_python.pdf'], dc:title, Literal('Semantic Web and Python concepts to application development')

RDFLib adding triple by reading file/string str = '''@prefix dc: <''' + dc + '''>. @prefix inpyconslides : <''' + inpyconslides + '''>. inpyconslides :'Semanticweb_Python' dc:title 'Semantic Web and Python concepts to application development'. ''' from rdflib import StringInputSource rdfstr = StringInputSource(str) g.parse(rdfstr, format='n3')

RDFLib adding triple from a remote document inpyconslides _rdf = 'http://in.pycon.org/rdf_files/slides.rdf' g.parse(inpyconslides_rdf, format='n3')

Creating RDFS ontology Ontology reuse <http://in.pycon.org> rdf:type <http://swrc.ontoware.org/ ontology#conference>. <http://in.pycon.org/hasslidesat> rdf:type rdfs:property. <http://in.pycon.org> rdfs:label 'Python Conference, India'

RDFLib SPARQL query Querying graph instance # using previous rdf triples q = '''PREFIX dc: <http://purl.org/rss/1.0/> ''' PREFIX inpyconslides : <http://in.pycon.org/smedia/slides/> SELECT?x?y WHERE {?x dc:title?y. } result = g.query(q).serialize(format='n3') Unbound symbols Graph pattern

RDFLib creating BNode from rdflib import BNode profilebnode = BNode() Vinay Modi http://.../deleg ate/vinaymodi hasprofile hastutorial http://in.pyco n.org/.../.../ Sematicweb_ Python http://www. voicepitara.com

RDFLib graph merging g.parse(inpyconslides_rdf, format='n3') g1 = Graph() myns = Namespace('http://example.com/') # object of the triple in g1 is subject of a triple in g. g1.add(('http://vinaymodi.googlepages.com/', myns['hastutorial'], inpyconslides['semanticweb_python.pdf']) mgraph = g + g1 g1 g

RDFLib some possible things you can do Creating named graphs Quoted graphs Fetching remote graphs and querying over them RDF Literals are XML Schema datatype; Convert Python datatype to RDF Literal and vice versa. Persistent datastore in MySQL, Sqlite, Redland, Sleepycat, ZODB, SQLObject Graph serialization in RDF/XML, N3, NT, Turtle, TriX, RDFa

End of the Tutorial Thank you for listening patiently. Contact: Vinay Modi Voice Pitara Technologies (P) Ltd vinay@voicepitara.com (Queries for project development, consultancy, workshops, tutorials in Knowledge representation and Semantic Web are welcome)