Using JavaScript in Linked Data Applications Oshani Seneviratne Oct 12, 2010.

Slides:



Advertisements
Similar presentations
InterScan AppletTrap Zhang Hong Trend Micro, AppletTrap Team (Nanjing)
Advertisements

© 2006 IBM Corporation Integrating Life Sciences Data on the Web using SPARQL Lee Feigenbaum May, 2006.
LIS650lecture 1 XHTML 1.0 strict Thomas Krichel
XPointer and HTTP Range A possible design for a scalable and extensible RDF Data Access protocol. Bryan Thompson draft Presented to the RDF.
The GridSite Toolbar Shiv Kaushal The University of Manchester All Hands Meeting 2006.
The OWASP Foundation Web Application Security Host Apps Firewall Host Apps Database Host Web serverApp serverDB server Securing the.
CS 22: Enhanced Web Site Design - Week 8Slide 1 of 15 Enhanced Web Site Design Stanford University Continuing Studies CS 22 Mark Branom
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
Introduction to Computing Using Python CSC Winter 2013 Week 8: WWW and Search  World Wide Web  Python Modules for WWW  Web Crawling  Thursday:
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.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
Semantic Web Introduction
JavaScript and Data Visualization Dominic DiFranzo.
 Copyright 2010 Digital Enterprise Research Institute. All rights reserved. Digital Enterprise Research Institute Transforming between RDF.
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
Using Java in Linked Data Applications Fuming Shih Oct 12.
Using PHP in Linked Data Applications Jie Bao Oct 12.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Computer Concepts 2014 Chapter 7 The Web and .
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
2013Dr. Ali Rodan 1 Handout 1 Fundamentals of the Internet.
Web application architecture
JavaScript, Fourth Edition
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
The Semantic Web Web Science Systems Development Spring 2015.
HTML5 Communication. The Setup Somewhere on the web, a server makes a ”service” available, that we wish to use in a web application The service may offer.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Cross Site Integration “mashups” cross site scripting.
A bad case of content reuse Validator Website to Validate License Violations Validator – Only requires the URI of the site to check This work by Oshani.
A bad case of content reuse Validator Website to Validate License Violations Validator – Only requires the URI of the site to check for a license violation.
1 Welcome to CSC 301 Web Programming Charles Frank.
JavaScript Tutorial 1 - Introduction to JavaScript1 Tutorial 1 Introduction to JavaScript Section A – Programming, HTML, and JavaScript.
Semantic Clipboard User Interface is integrated in the Browser Architecture of the Semantic Clipboard Illustration of a license incompliant content reuse.
The Semantic Logger: Supporting Service Building from Personal Context Mischa M Tuffield et al. Intelligence, Agents, Multimedia Group University of Southampton.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
JavaScript and Ajax (Internet Background) Week 1 Web site:
Matthew Baillie, Luke Day THE INTERNET. HISTORY OF THE INTERNET J.C.R. Licklider authored a series of memos concerning theoretical network structures.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
JavaScript, Sixth Edition Chapter 11 Updating Web Pages with Ajax.
#SummitNow CORS 6 Nov 2013 / 14 Nov 2013 Jared Ottley / Alfresco Software.
Web Services Essentials. What is a web service? web service: software functionality that can be invoked through the internet using common protocols like.
X2R Spec 1. Change log DateVersionPeopleNote 2013/11/01V0.0.1Chien-Wei Yu, Anderson Ou First draft, add X2R files spec. 2013/12/16V0.0.2Anderson Ou, Doc.
1 Mashup Workflow. 2 What We Have 3 Challenges with REST APIs * Only ask what its built to answer * No standard - must relearn each time * Opaque - no.
X2R Spec 1. Change log DateVersionPeopleNote 2013/11/01V0.0.1Chien-Wei Yu, Anderson Ou First draft, add X2R files spec. 2013/12/16V0.0.2Anderson Ou, Doc.
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
RDFLib for your Linked Data Venture Mathew Cherian Oct 12, 2010.
Distributed Control and Measurement via the Internet
Tonga Institute of Higher Education IT 141: Information Systems
Web Technologies Computing Science Thompson Rivers University
Essential tools for implementing and testing websites
JavaScript and Ajax (Internet Background)
CNIT 131 Internet Basics & Beginning HTML
INFO 344 Web Tools And Development
Database Driven Websites
Session V HTML5 APIs - AJAX & JSON
Web Browser server client 3-Tier Architecture Apache web server PHP
Tonga Institute of Higher Education IT 141: Information Systems
HTML Level II (CyberAdvantage)
HTML5 AJAX & JSON APIs
Tonga Institute of Higher Education IT 141: Information Systems
Research Lesson 1 URLs & Hyperlinks How to access the World Wide Web.
Research Lesson 1 URLs & Hyperlinks How to access the World Wide Web.
Introduction to World Wide Web
Web Technologies Computing Science Thompson Rivers University
Presentation transcript:

Using JavaScript in Linked Data Applications Oshani Seneviratne Oct 12, 2010

Why HTML and Javascript? It would: – Make the application available widely, almost universally – Allow the application to be delivered over HTTP – Run in the browser thus making use of the existing client side cache – Provide all the UI elements we need very easily

Javascript Libraries Rdflib + Widget Library – Written by Tabulator developers – Can be used to create user interfaces that use Semantic Web Data – Download from: widgets/download.htmlhttp://dig.csail.mit.edu/2010/rdf- widgets/download.html RDFQuery – Written by Jeni Tennison et al – Can be used to parse RDFa, query over facts and reason to produce more facts – Depends on jQuery – Download from: More Javascript libraries are available at: rs rs

Same Origin Policy Rule enforced in browsers for security Javascript code running on a webpage cannot access any resources from other domains

But there are some workarounds You can: – Run your code in a trusted environment (standalone app, iPhone app, browser, browser extension, greasemonkey script) – Use a “proxy” server – Use browsers that support CORS (Firefox 3.5, Safari 4). However, the servers have to accept the headers sent by the browsers. – Use JSONP (JSON with Padding)

Our Solution Use a proxy server to provide JSONP translation of data available at any location on the Web. – Talis Metamorph web service ( allows for converting between different RDF syntaxes – JSONP output format is available from the Metamorph service – Cross domain transfer of JSON is supported natively in libraries like jQuery

Our Task 1Look up a FOAF URI 2Extract that person’s friends 3Look at the friends’ FOAF files 4See where they work 5Use the workplace URI to query dbpedia for it’s location 6Print a list of Tim’s friends, their workplaces and where the workplaces are located

1 Look up Tim’s FOAF URI var url = ' uri[]= Lee/card#i&input=&output=jsonp&callback=?' ; $.getJSON(url, function(data){ //Do something with the data });

2 Extract his friends var tim = " Lee/card#i" var FOAF_KNOWS = “ $.each(data[tim][”FOAF_KNOWS"], function{ //Process the friend data here. });

3 Look at the friends’ FOAF files Same as 1. Use the metamorph service to load all the data of Tim’s friends. var url = ' uri[]= &input=&output=jsonp&callback=?'; $.getJSON(url, function(data){ //Do something with the data });

4 See where the friends work var WOKPLACE_HOMEPAGE = " ge"; friend.workplaceHomepage = friend_data[friend.id][WOKPLACE_HOMEPAGE][ 0].value;

5 Query DBpedia PREFIX prop: PREFIX ont: PREFIX foaf: PREFIX geo: SELECT DISTINCT ?label ?lat ?long WHERE { { {?resource prop:website.} UNION {?resource foaf:homepage.}} { {?resource ont:location ?location. OPTIONAL {?location geo:lat ?lat. ?location geo:long ?long.} OPTIONAL {?location rdfs:label ?label.} } UNION {?subject prop:employer ?resource} UNION {?subject prop:institution ?resource} UNION {?subject prop:workInstitution ?resource} UNION {?subject prop:workInstitutions ?resource} UNION {?subject prop:workplaces ?resource} UNION {?subject ont:occupation ?resource} OPTIONAL {?resource geo:lat ?lat. ?resource geo:long ?long.} OPTIONAL {?resource rdfs:label ?label.}} FILTER langMatches( lang(?label), 'en')}

5.1 Sending the Query to dbpedia " default-graph-uri= should-sponge=soft& query=*query_goes_in_here*& format=application/json& callback=?"

Demo Available at: – braries/javascript/demo/

Tools that are helpful in debugging Firebug – US/firefox/addon/1843 JSON formatter –

Quiz Tim has alternate URIs specified in his FOAF file at Lee/card#i. How can you modify this code to look up the workplaces of friends specified in those FOAF uris as well? How do you find whether people in Tim’s FOAF file are in the same group (foaf:group) as Tim?