Using Semantic Web Data: Inference Lalana Kagal Decentralized Information Group MIT CSAIL Eric Prud'hommeaux Engineer World Wide Web Consortium.

Slides:



Advertisements
Similar presentations
Dr. Leo Obrst MITRE Information Semantics Information Discovery & Understanding Command & Control Center February 6, 2014February 6, 2014February 6, 2014.
Advertisements

CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Semantics Static semantics Dynamic semantics attribute grammars
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Semantic Web Thanks to folks at LAIT lab Sources include :
Introduction to RDF Based on tutorial at
An Introduction to RDF(S) and a Quick Tour of OWL
RDFa: Embedding RDF Knowledge in HTML Some content from a presentation by Ivan Herman of the W3c, Introduction to RDFa, given at the 2011 Semantic Technologies.
Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
Building and Analyzing Social Networks Web Data and Semantics in Social Network Applications Dr. Bhavani Thuraisingham February 15, 2013.
AIR Policy Language Overview V2. AIR Facts AIR -- Accountability In RDF a policy language for dependency tracking represented in Turtle (an RDF syntax)
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
Dr. Alexandra I. Cristea RDF.
1 CIS607, Fall 2005 Semantic Information Integration Instructor/Organizer: Dejing Dou Week 1 (Sept. 28)
COMP 6703 eScience Project Semantic Web for Museums Student : Lei Junran Client/Technical Supervisor : Tom Worthington Academic Supervisor : Peter Strazdins.
RDF: Building Block for the Semantic Web Jim Ellenberger UCCS CS5260 Spring 2011.
Javascript II Expressions and Data Types. 2 JavaScript Review programs executed by the web browser programs embedded in a web page using the script element.
From SHIQ and RDF to OWL: The Making of a Web Ontology Language
Guide To UNIX Using Linux Third Edition
1 DCS861A-2007 Emerging IT II Rinaldo Di Giorgio Andres Nieto Chris Nwosisi Richard Washington March 17, 2007.
Audumbar Chormale Advisor: Dr. Anupam Joshi M.S. Thesis Defense
An OWL based schema for personal data protection policies Giles Hogben Joint Research Centre, European Commission.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
Semantic Web Series 1 Mohammad M. R. Cowdhury UniK, Kjeller.
A First Program Using C#
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
1 Expert Finding for eCollaboration Using FOAF with RuleML Rules MCeTECH May 2006 Jie Li 1,2, Harold Boley 1,2, Virendrakumar C. Bhavsar 1, Jing.
Practical RDF Chapter 1. RDF: An Introduction
SPARQL Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology.
Logics for Data and Knowledge Representation
Input, Output, and Processing
SPARQL W3C Simple Protocol And RDF Query Language
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 2: RDF Model & Syntax Aidan Hogan
The LOM RDF binding – update Mikael Nilsson The Knowledge Management.
Information Interchange on the Semantic Web an interactive talk by Piotr Kaminski, University of Victoria
Privacy Framework for RDF Data Mining Master’s Thesis Project Proposal By: Yotam Aron.
Turtle – RDF Graph. Turtle – Basic Syntax Triples are terminated with a full stop URLs are encoded in angle brackets ( ) Literals are enclosed by double.
CWM Closed World Machine. CWM Overview CWM is a popular Semantic Web program that can do the following tasks – Parse and pretty-print several RDF formats:
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.
Semantic Technologies and Application to Climate Data M. Benno Blumenthal IRI/Columbia University CDW /04-01.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
SecPAL Presented by Daniel Pechulis CS5204 – Operating Systems1.
Of 33 lecture 1: introduction. of 33 the semantic web vision today’s web (1) web content – for human consumption (no structural information) people search.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
THE SEMANTIC WEB By Conrad Williams. Contents  What is the Semantic Web?  Technologies  XML  RDF  OWL  Implementations  Social Networking  Scholarly.
A Portrait of the Semantic Web in Action Jeff Heflin and James Hendler IEEE Intelligent Systems December 6, 2010 Hyewon Lim.
Knowledge Technologies Manolis Koubarakis 1 Some Other Useful Features of RDF.
Expressions and Data Types Professor Robin Burke.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
1 Authorization Sec PAL: A Decentralized Authorization Language.
Linked Data & Semantic Web Technology The Semantic Web Part 5. Resource Description Framework (2) Dr. Myungjin Lee.
Semantic Web In Depth Resource Description Framework Dr Nicholas Gibbins –
26/02/ WSMO – UDDI Semantics Review Taxonomies and Value Sets Discussion Paper Max Voskob – February 2004 UDDI Spec TC V4 Requirements.
Setting the stage: linked data concepts Moving-Away-From-MARC-a-thon.
CWM Closed World Machine. CWM Overview CWM is a simple Semantic Web program that can do the following tasks – Read and pretty-print several RDF formats.
What's New in RDF 1.1 Cambridge Semantic Web Gathering 9 April 2013
OWL (Ontology Web Language and Applications) Maw-Sheng Horng Department of Mathematics and Information Education National Taipei University of Education.
CWM Closed World Machine
Using Semantic Web Data: Proof
Analyzing and Securing Social Networks
CC La Web de Datos Primavera 2016 Lecture 2: RDF Model & Syntax
Resource Description Framework (RDF)
CWM Closed World Machine
Presentation transcript:

Using Semantic Web Data: Inference Lalana Kagal Decentralized Information Group MIT CSAIL Eric Prud'hommeaux Engineer World Wide Web Consortium

Why do we need Rules on the Web? The Semantic Web provides a unifying representation of richly structured data Adding logic to the Web implies the use of rules to make inferences, choose courses of action, and answer questions This logic must be powerful enough to describe complex properties of objects but not so powerful that agents can be tricked by being asked to consider a paradox

N3Logic: A Logic For the Web N3Logic is a logic that allows rules to be expressed in a Web environment. It extends RDF with syntax for –nested graphs –quantified variables –predicates for implication –accessing resources on the Web –functions including cryptographic, string, math The main goal of N3Logic is to be a minimal extension to the RDF data model such that the same language can be used for logic and data

N3 Versus N3Logic N3 is a compact and readable alternative to RDF's XML syntax N3 adds quoting to Turtle –Turtle : –N3: { } –Does not imply that N3Logic uses N3 syntax and extends RDF with a vocabulary of predicates N3Logic allows rules to be integrated smoothly with RDF and provides certain essential built-in functions

N3Logic Tools N3Logic reasoner – cwm

Installing cwm Prerequisites –Python: –cwm needs Python2.2 or later Download – Alias to executable –Set up an alias (.bat file, etc) to make the cwm command –In bash this is cwm="python /whereverYouPutThem/cwm.py"

Testing cwm At the command prompt > cwm

Executing Cwm You can get a list of these by typing cwm --help --rdf Input & Output in RDF/XML instead of n3 --n3 Input & Output in N3 from now on (Default)‏ --think as -rules but continue until no more rule matches --filter=foo Read rules from foo, apply to store, replacing store with conclusions Examples –Combine data and find all deductions cwm foo.n3 bar.n3 --think –Convert from rdf/xml to rdf/n3 cwm --rdf foo.rdf --n3

If installed correctly At the command prompt > cwm --n3

Scenario: Decentralized Access Control The DIG group has several online resources including pictures, papers, presentations, and proposals that are only accessible to members of the group and to people that members trust. The group has a webpage that lists its members using N3. The page identifies members by their Friend Of A Friend (FOAF) pages. Authentication in this scenario is via OpenID. DIG members provide their OpenID URI (usually the same as their work homepages) in their FOAF pages. Open for this data about the DIG grouphttp://dig.csail.mit.edu/2008/Talks/0518-SemTech-eplk/code/data.n3 Policy: Only group members are allowed to access group resources or people that group members know

Scenario: Decentralized Access Control For simplicity, the data that we check our demo policies against also include a test request for a DIG resource :Req1 a air:Request; foaf:openid ; air:resource.

N3 Overview (RDF Extension) ‏ Quoted formulae –b:mary says { j:Joe foaf:member :DIG }. Universally quantified formulas X. { X a Man } log:implies { X a Mortal }. –shorthand notation ?X { ?X a Man } log:implies { ?X a Mortal }. Existential variables or blank nodes :X. j:Joe foaf:knows :X. :X foaf:name "Fred". –shorthand notation j:Joe foaf:knows [ foaf:name "Fred" ].

N3 Overview (RDF Extension) ‏ Additional builtins with URI references defined in –log: –crypto: –list: –math: –os: –string: –time: N3Logic extends RDF with variables and nested graphs to enable the descriptions of rules shorthand notation for log:implies is => { A } => { B } where A and B are sets of triples

Developing First Rule RULE: A member of DIG is a user in the memberlist of :MEMBER. { :DIG foaf:member :MemberList. :MEMBER air:in :MemberList. } => {:MEMBER foaf:member :DIG}.

Visualising First Rule Open in any editor

Executing First Rule Execute cwm with rule1.n3 and data.n3 > cwm code/data.n3 eplk/cwm-code/rule1.n3 --think

Executing First Rule Produces too much information Need to filter results Only display those results generated by the rule > cwm code/data.n3 eplk/cwm-code/rule1.n3 --think -- filter=” code/rule1.n3”

Executing First Rule

Graph Functions access a file and store its N3 representation in a variable – log:semantics check if one formula can be derived from another formula – log:includes scoped negation as failure of log:includes – log:notIncludes thinking inside – log:conclusion Merging a list of formulae –( ) log:conjunction

Developing Second Rule Read information from SemTech-eplk/cwm-code/data.n3 Print all instances of foaf:Organizations and their foaf:names

Developing Second :F, :G, :N. { log:semantics :F. :F log:includes { :G a foaf:Organization; foaf:name :N }. } => { :G a foaf:Organization; foaf:name :N }.

Executing Second Rule Execute this rule and see if it works > cwm code/rule2.n3 --think --filter=" eplk/cwm-code/rule2.n3"

Executing Second Rule

Developing Third Rule Access the data file and see all attributes passed along with the Request A ValidRequest is one that has both the requester's openID URI as well as a requested resource that is a DIG resource

Developing Third :F, :REQ, :REQUESTER, :RESOURCE. { log:semantics :F. :F log:includes { :REQ a air:Request; foaf:openid :REQUESTER; air:resource :RESOURCE }. :F log:includes { :DIG :owns :RESOURCE }. } => { :REQ a air:ValidRequest }.

Executing Third Rule

Developing Fourth Rule Add another rule to the policy; if the Request is valid, check if the requester is a member of the DIG group If the requester is a member of the DIG group, the request is compatible with the :F, :REQ, :REQUESTER, :RESOURCE, :MEMBERLIST, :MEMBER. { log:semantics :F. :REQ a air:ValidRequest. :F log:includes { :REQ foaf:openid :REQUESTER. :DIG foaf:member :MEMBERLIST. :MEMBER air:in :MEMBERLIST. :MEMBER a foaf:Person; foaf:openid :REQUESTER } } => { :REQ air:compatible-with :DIGPolicy }.

Executing Fourth Rule > cwm -- think --filter=" code/rule4.n3"

Executing Fourth Rule

Developing Fifth Rule –Write a rule that that merges two rules and data –rule1.n3 that infers the list of members of DIG –rule6.n3 that infers that a request is valid if it for a DIG resource and if it includes the openID URI of the requester –data.n3 that includes the data of the DIG group and an example request and uses log:conclusion to think and execute rule1.n3 and rule6.n3 against the data to infer that the request is a PermittedRequest if it is valid and the requester is from the DIG group

Developing Fifth :D, :R1, :R6, :F, :G, :MEMBER, :REQ, :REQUESTER. { log:semantics :D. log:semantics :R1. log:semantics :R6. ( :D :R1 :R6 ) log:conjunction :F. :F log:conclusion :G. :G log:includes { :REQ a air:ValidRequest; air:requester :REQUESTER. :MEMBER foaf:member :DIG. :MEMBER foaf:openid :REQUESTER } } => { :REQ a air:PermittedRequest }.

Executing Fifth Rule > cwm --think --filter=" code/rule5.n3"

Executing Fifth Rule

More N3Logic Builtins –crypto functions – md5, sign, and verify –math functions- cos, sin, greaterThan, notGreaterThan, and difference –os functions for retrieving environment information – argv, baseAbsolute, and baseRelative –string functions – concatenation, matches, and startsWith –time functions – dayOfWeek, gmTime, and localTime

Developing Seventh Rule –Write a rule that when given a temperature in F degrees as a commandline argument, converts it into Celcius degrees –Use os functions to retrieve the commandline argument os:argv arguments passed using “--with” –Use math functions to convert to celcius ( ) math:difference ( ) math:product

Developing Seventh :TF, :T1, :TC. { "1" os:argv :TF. ( :TF 32 ) math:difference :T1. (:T1 "0.5555" ) math:product :TC } => { :TC :tempInCOf :TF }.

Executing Seventh Rule > cwm eplk/cwm-code/rule7.n3 --think -- filter=" eplk/cwm-code/rule7.n3" --with 40

Cwm Resources Cwm tutorial – Commandline arguments – Builtin functions – N3Logic: A Logical Framework for the World Wide Web", Journal of Theory and Practice of Logic Programming (TPLP), Special Issue on Logic Programming and the Web –