LDScript : a Linked Data Script Language

Size: px
Start display at page:

Download "LDScript : a Linked Data Script Language"

Transcription

1 LDScript : a Linked Data Script Language Olivier Corby, Catherine Faron-Zucker, Fabien Gandon Université Côte d'azur Inria, I3S, UNS, CNRS olivier.corby@inria.fr

2 Context RDF: Semantic Web of Linked Data SPARQL: Query RDF graph Focus: SPARQL extension functions for computing LDScript: Linked Data Script Language 2

3 Computing? Find resources whose income is greater that n!?income >= factorial(?n) Find a function name associated to a resource and call it funcall(?fun,?x) Define a formula and share it among queries area = width * length Deal with exotic datatype "XIX"^^dt:roman + "I"^^dt:roman Define extended aggregate aggregate(?income) as?list median(?list) as?median LDScript: Linked Data Script Language 3

4 prefix fun: <function://fr.inria.sparql.extension> select * where {?x us:income?inc filter (?inc >= fun:fac(10)) package fr.inria.sparql; class Extension { public Datatype fac(datatype dt) { return Datatype.create(fac(dt.longValue())); LDScript: Linked Data Script Language 4

5 prefix fun: <function://fr.inria.sparql.extension> select * where {?x us:income?inc filter (?inc >= fun:fac(10)) package fr.inria.sparql; class Extension { public Datatype fac(datatype dt) { return Datatype.create(fac(dt.longValue())); long fac(long n) { if (n == 0) { return 1; else { return n * fac(n-1); Needs to be compiled and linked LDScript: Linked Data Script Language 5

6 prefix fun: < select * where {?x us:income?inc filter (?inc >= fun:fac(10)) function fun:fac(?n) { if (?n = 0, 1,?n * fun:fac(?n 1)) No Compiling, nor Linking LDScript: Linked Data Script Language 6

7 Requirements for LDScript Language Define SPARQL extension function SPARQL compliant as much as possible Manipulate RDF and SPARQL entities Execute SPARQL query in function Facilitate SPARQL extension No API, no cast, no compiling, no linking LDScript: Linked Data Script Language 7

8 Research Questions Is it possible to define a Linked Data Script Language on top of SPARQL? Is it possible to share the same core SPARQL interpreter? LDScript: Linked Data Script Language 8

9 Solution LDScript language on top of SPARQL Filter LDScript: Linked Data Script Language 9

10 SPARQL Filter Constant: 2.718, true, " "^^xsd:date Variable:?x,?y,?z,?t Expression:?x + 1,?x = (10 *?y) /?z,?t >= 3.14 Connector:! (?x < 0?y = "Keynes" ) && Graph match: exists {?x a us:scriptlanguage If then else: if (?deficit <=.03, true, true) Function call: regex(?uri, ".*cnrs"), us:fac(?n) LDScript: Linked Data Script Language 10

11 SPARQL Filter LDScript Extension Constant: 2.718, true, " "^^xsd:date Variable:?x,?y,?z,?t Expression:?x + 1,?x = (10 *?y) /?z,?t >= 3.14 Connector:! (?x < 0?y = "Keynes" ) && Graph match : exists {?x a us:scriptlanguage If then else: if (?deficit <=.03, true, true) Function call: regex(?uri, ".*cnrs"), us:fac(?n) Function: function us:fun(?x) { 1 / (?x *?x) LDScript: Linked Data Script Language 11

12 LDScript Function function LDScript: Linked Data Script Language 12

13 LDScript Function function us:fac LDScript: Linked Data Script Language 13

14 LDScript Function function us:fac(?n) LDScript: Linked Data Script Language 14

15 LDScript Function function us:fac(?n) { LDScript: Linked Data Script Language 15

16 LDScript Function function us:fac(?n) { if (?n = 0, 1,?n * us:fac(?n 1)) LDScript: Linked Data Script Language 16

17 LDScript Function function us:fac(?n) { if (?n = 0, 1,?n * us:fac(?n 1)) Manage variables in a stack LDScript: Linked Data Script Language 17

18 LDScript SPARQL Filter Function Definition LDScript: Linked Data Script Language 18

19 LDScript Statements SPARQL Filter Function Definition 1. Let 2. For 3. Query 4. Pattern Matching 5. Second Order Function 6. Lambda Expression LDScript: Linked Data Script Language 19

20 Let let (?y = us:foo(?x)) { us:bar(?y) LDScript: Linked Data Script Language 20

21 For for (?x in xt:list(1, 2, 3, 4, 5)) { xt:display(?x) LDScript: Linked Data Script Language 21

22 Query in Let function us:circlearea(?x) { let (query) { body LDScript: Linked Data Script Language 22

23 Query in Let function us:circlearea(?x) { let (select?x?r where {?x us:radius?r ) { body LDScript: Linked Data Script Language 23

24 Query in Let function us:circlearea(?x) { let (select?x?r where {?x us:radius?r ) { ( *?r *?r) LDScript: Linked Data Script Language 24

25 Query in Let: variable binding function us:circlearea(?x) { let (select?x?r where {?x us:radius?r ) { ( *?r *?r) #?x = v LDScript: Linked Data Script Language 25

26 Query in Let: variable binding function us:circlearea(?x) { #?x = v let (select?x?r where { values?x { v?x us:radius?r ) { ( *?r *?r) LDScript: Linked Data Script Language 26

27 Query in For for (query) { body LDScript: Linked Data Script Language 27

28 Query in For for (select?x?y where {?x foaf:knows?y ) { xt:display(?x,?y) Iterate?x and?y on every query solutions LDScript: Linked Data Script Language 28

29 Query in For for (?t in construct where {?x foaf:knows?y ) { xt:display(?t) Iterate?t on triples of the result graph LDScript: Linked Data Script Language 29

30 Pattern Matching for ((?s,?p,?o) in?graph) for ((?var,?val) in?map) for ((?a,?b) in?listoflist) LDScript: Linked Data Script Language 30

31 Literal Extension Datatypes (New) prefix dt: < 1. dt:list 2. dt:graph 3. dt:triple 4. dt:mappings 5. dt:mapping LDScript: Linked Data Script Language 31

32 Second order functions Function whose first argument is an expression that returns a function 1. funcall funcall(?fun,?x,?y) 2. apply apply(?fun,?list) 3. map map(?fun,?list) 4. reduce reduce(rq:plus,?list) (New) LDScript: Linked Data Script Language 32

33 Lambda Expression (New) Declaration of an anonymous function lambda(?x) { 1 / (?x *?x) Call of an anonymous function maplist( lambda(?x) { 1 / (?x *?x),?list) LDScript: Linked Data Script Language 33

34 SPARQL Extension with LDScript Custom Aggregate Values with Expression SPARQL with Recursion LDScript: Linked Data Script Language 34

35 SPARQL Custom aggregate select (aggregate(?x) as?list) (ag:median(?list) as?med) where { function ag:median(?list) { xt:get(xt:sort(?list), xt:size(?list) / 2) LDScript: Linked Data Script Language 35

36 SPARQL Values with Expression construct {?s?p?o where { values (?s?p?o) { unnest(xt:load(?uri)) LDScript: Linked Data Script Language 36

37 SPARQL with Recursion Count descendants on the woman side LDScript: Linked Data Script Language 37

38 SPARQL with Recursion select?x (count(?y) where {?x us:child?y.?y a us:woman group by?x as?c) LDScript: Linked Data Script Language 38

39 SPARQL with Recursion function us:pattern(?x) { let (select?x (count(?y) where {?x us:child?y.?y a us:woman group by?x) {?c as?c) LDScript: Linked Data Script Language 39

40 SPARQL with Recursion function us:pattern(?x) { let (select?x (count(?y) + sum(us:pattern(?y)) as?c) where {?x us:child?y.?y a us:woman group by?x) {?c LDScript: Linked Data Script Language 40

41 Validation: Implementation Implementation: Corese Semantic Web Factory LDScript: Linked Data Script Language 41

42 Validation: Application SHACL validator (with STTL) Day of date Roman to decimal and converse Fibonacci, factorial, sort, standard deviation, etc LDScript: Linked Data Script Language 42

43 Validation: Benchmark function us:fib(?n) { if (?n<=2, 1, us:fib(?n-1) + us:fib(?n-2)) LDScript IDatatype fib(idatatype dt) { Java if (dt.le(datatype.two).booleanvalue()){ return Datatype.ONE; else { return fib(dt.minus(datatype.one)).plus(fib(dt.minus(datatype.two))); fib(35) = nb function call: Java : s LDScript : s 25,6 M funcall / s 10,3 M funcall / s LDScript = 2.5 Java LDScript: Linked Data Script Language 43

44 Conclusion Script Language on top of SPARQL filter SPARQL extension function Second order function Query in function Recursive query Pattern matching Custom aggregate LDScript: Linked Data Script Language 44

45 Perspective Linked functions Method attached to class, inheritance Type checking Two implementations Leverage performance LDScript: Linked Data Script Language 45

46 Perspective Linked functions (done) Method attached to class, inheritance Type checking Two implementations Leverage performance LDScript: Linked Data Script Language 46

47 Perspective Linked functions (done) Method attached to class, inheritance (done) Type checking Two implementations Leverage performance LDScript: Linked Data Script Language 47

48 Method LDScript: Linked Data Script Language 48

49 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:rectangle LDScript: Linked Data Script Language 49

50 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:circle function us:area(?x) { LDScript: Linked Data Script Language 50

51 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:circle function us:area(?x) us:rectangle function us:area(?x) { LDScript: Linked Data Script Language 51

52 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:circle function us:area(?x) us:rectangle function us:area(?x) { method(us:area,?f) LDScript: Linked Data Script Language 52

53 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:circle function us:area(?x) us:rectangle function us:area(?x) { method(us:area,?f) -- a Circle LDScript: Linked Data Script Language 53

54 Method us:circle rdfs:subclassof us:figure us:square rdfs:subclassof us:circle function us:area(?x) us:rectangle function us:area(?x) { method(us:area,?f) -- a Square, a Rectangle LDScript: Linked Data Script Language 54

LDScript: a Linked Data Script Language

LDScript: a Linked Data Script Language LDScript: a Linked Data Script Language Olivier Corby (0000-0001-6610-0969), Catherine Faron-Zucker (0000-0001-5959-5561), and Fabien Gandon (0000-0003-0543-1232) Université Côte d Azur, Inria, CNRS, I3S,

More information

Validating Ontologies against OWL 2 Profiles with the SPARQL Template Transformation Language

Validating Ontologies against OWL 2 Profiles with the SPARQL Template Transformation Language Validating Ontologies against OWL 2 Profiles with the SPARQL Template Transformation Language Olivier Corby, Catherine Faron Zucker, Raphaël Gazzotti To cite this version: Olivier Corby, Catherine Faron

More information

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

Filter: Evaluable Expression. List Syntax. Tests. Filter: Evaluable Expression. Tests : functions. Tests 06/09/2013. (1?x v ) SPARQL 2 W3C RDF Data Access SPARQL W3C Simple Protocol And RDF Query Language olivier.corby@inria.fr Use Case and Requirements : http://www.w3.org/tr/rdf-dawg-uc Query language : http://www.w3.org/tr/rdf-sparql-query

More information

STTL SPARQL Template Transformation Language for RDF Graphs

STTL SPARQL Template Transformation Language for RDF Graphs STTL SPARQL Template Transformation Language for RDF Graphs Olivier Corby INRIA Sophia Antipolis olivier.corby@inria.fr STTL STTL : transformation language for RDF XSLT : transformation language for XML

More information

RDF/SPARQL Design Pattern for Contextual Metadata

RDF/SPARQL Design Pattern for Contextual Metadata RDF/SPARQL Design Pattern for Contextual Metadata Olivier Corby, Catherine Faron Zucker To cite this version: Olivier Corby, Catherine Faron Zucker. RDF/SPARQL Design Pattern for Contextual Metadata. IEEE/WIC/ACM

More information

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT Functional programming FP Foundations, Scheme (2 In Text: Chapter 15 LISP: John McCarthy 1958 MIT List Processing => Symbolic Manipulation First functional programming language Every version after the

More information

FunSPARQL: Extension of SPARQL with a Functional Language

FunSPARQL: Extension of SPARQL with a Functional Language FunSPARQL: Extension of SPARQL with a Functional Language Olivier Corby, Catherine Faron Zucker To cite this version: Olivier Corby, Catherine Faron Zucker. FunSPARQL: Extension of SPARQL with a Functional

More information

An introduction to Scheme

An introduction to Scheme An introduction to Scheme Introduction A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize

More information

Using RDF to Model the Structure and Process of Systems

Using RDF to Model the Structure and Process of Systems Using RDF to Model the Structure and Process of Systems Marko A. Rodriguez Jennifer H. Watkins Johan Bollen Los Alamos National Laboratory {marko,jhw,jbollen}@lanl.gov Carlos Gershenson New England Complex

More information

Functional Programming. Pure Functional Programming

Functional Programming. Pure Functional Programming Functional Programming Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends only on the values of its sub-expressions (if any).

More information

Querying the Semantic Web

Querying the Semantic Web Querying the Semantic Web CSE 595 Semantic Web Instructor: Dr. Paul Fodor Stony Brook University http://www3.cs.stonybrook.edu/~pfodor/courses/cse595.html Lecture Outline SPARQL Infrastructure Basics:

More information

Lambda Calculus and Lambda notation in Lisp II. Based on Prof. Gotshalks notes on Lambda Calculus and Chapter 9 in Wilensky.

Lambda Calculus and Lambda notation in Lisp II. Based on Prof. Gotshalks notes on Lambda Calculus and Chapter 9 in Wilensky. λ Calculus Basis Lambda Calculus and Lambda notation in Lisp II Based on Prof. Gotshalks notes on Lambda Calculus and Chapter 9 in Wilensky Mathematical theory for anonymous functions» functions that have

More information

Day 2. RISIS Linked Data Course

Day 2. RISIS Linked Data Course Day 2 RISIS Linked Data Course Overview of the Course: Friday 9:00-9:15 Coffee 9:15-9:45 Introduction & Reflection 10:30-11:30 SPARQL Query Language 11:30-11:45 Coffee 11:45-12:30 SPARQL Hands-on 12:30-13:30

More information

DESIRR. Semantic platform for organizing, sharing and reusing R functions

DESIRR. Semantic platform for organizing, sharing and reusing R functions DESIRR Semantic platform for organizing, sharing and reusing R functions Pascal Neveu a, Yuan Lin a, Caroline Domerg a, Juliette Fabre a, Alexandre Granier a, Anne Tireau a, Vincent Negre a, Isabelle Mirbel

More information

Object. OutputStream write(int) write(byte[]) write(byte[], int, int) FilterOutputStream write(int) write(byte[]) write(byte[], int, int)

Object. OutputStream write(int) write(byte[]) write(byte[], int, int) FilterOutputStream write(int) write(byte[]) write(byte[], int, int) Inheritance Object OutputStream write(int) write(byte[]) write(byte[], int, int) FilterOutputStream write(int) write(byte[]) write(byte[], int, int) PrintStream write(int) write(byte[]) Early binding Consider

More information

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University Functional Languages CSE 307 Principles of Programming Languages Stony Brook University http://www.cs.stonybrook.edu/~cse307 1 Historical Origins 2 The imperative and functional models grew out of work

More information

Introduction to a Web of Linked Data

Introduction to a Web of Linked Data Introduction to a Web of Linked Data Week 3: SPARQL Query Language Accessing Data Sources on the Web Olivier Corby Week 3: SPARQL Query Language Query RDF triple stores published on the Web 1 Week 3: SPARQL

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Unit 7. Functions. Need of User Defined Functions

Unit 7. Functions. Need of User Defined Functions Unit 7 Functions Functions are the building blocks where every program activity occurs. They are self contained program segments that carry out some specific, well defined task. Every C program must have

More information

UMBC CMSC 331 Final Exam

UMBC CMSC 331 Final Exam UMBC CMSC 331 Final Exam Name: UMBC Username: You have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for answers that are needlessly wordy

More information

Scala : an LLVM-targeted Scala compiler

Scala : an LLVM-targeted Scala compiler Scala : an LLVM-targeted Scala compiler Da Liu, UNI: dl2997 Contents 1 Background 1 2 Introduction 1 3 Project Design 1 4 Language Prototype Features 2 4.1 Language Features........................................

More information

Making BioPAX SPARQL

Making BioPAX SPARQL Making BioPAX SPARQL hands on... start a terminal create a directory jena_workspace, move into that directory download jena.jar (http://tinyurl.com/3vlp7rw) download biopax data (http://www.biopax.org/junk/homosapiens.nt

More information

Leveraging the Expressivity of Grounded Conjunctive Query Languages

Leveraging the Expressivity of Grounded Conjunctive Query Languages Leveraging the Expressivity of Grounded Conjunctive Query Languages Alissa Kaplunova, Ralf Möller, Michael Wessel Hamburg University of Technology (TUHH) SSWS 07, November 27, 2007 1 Background Grounded

More information

[CHAPTER] 1 INTRODUCTION 1

[CHAPTER] 1 INTRODUCTION 1 FM_TOC C7817 47493 1/28/11 9:29 AM Page iii Table of Contents [CHAPTER] 1 INTRODUCTION 1 1.1 Two Fundamental Ideas of Computer Science: Algorithms and Information Processing...2 1.1.1 Algorithms...2 1.1.2

More information

1.3. Conditional expressions To express case distinctions like

1.3. Conditional expressions To express case distinctions like Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a

More information

Corese : a Corporate Semantic Web Engine

Corese : a Corporate Semantic Web Engine Corese : a Corporate Semantic Web Engine Olivier Corby, Catherine Faron Zucker To cite this version: Olivier Corby, Catherine Faron Zucker. Corese : a Corporate Semantic Web Engine. International Workshop

More information

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix PGJC4_JSE8_OCA.book Page ix Monday, June 20, 2016 2:31 PM Contents Figures Tables Examples Foreword Preface xix xxi xxiii xxvii xxix 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring

More information

Introduction to Typed Racket. The plan: Racket Crash Course Typed Racket and PL Racket Differences with the text Some PL Racket Examples

Introduction to Typed Racket. The plan: Racket Crash Course Typed Racket and PL Racket Differences with the text Some PL Racket Examples Introduction to Typed Racket The plan: Racket Crash Course Typed Racket and PL Racket Differences with the text Some PL Racket Examples Getting started Find a machine with DrRacket installed (e.g. the

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Inheritance and object compatibility

Inheritance and object compatibility Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not the other way around Examples: reference/pointer can

More information

Oracle Database: Introduction to SQL/PLSQL Accelerated

Oracle Database: Introduction to SQL/PLSQL Accelerated Oracle University Contact Us: Landline: +91 80 67863899 Toll Free: 0008004401672 Oracle Database: Introduction to SQL/PLSQL Accelerated Duration: 5 Days What you will learn This Introduction to SQL/PLSQL

More information

CS4215 Programming Language Implementation

CS4215 Programming Language Implementation CS4215 Programming Language Implementation You have 45 minutes to complete the exam. Use a B2 pencil to fill up the provided MCQ form. Leave Section A blank. Fill up Sections B and C. After finishing,

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

Organization of Programming Languages CS3200/5200N. Lecture 11

Organization of Programming Languages CS3200/5200N. Lecture 11 Organization of Programming Languages CS3200/5200N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Functional vs. Imperative The design of the imperative languages

More information

What s different about Factor?

What s different about Factor? Harshal Lehri What s different about Factor? Factor is a concatenative programming language - A program can be viewed as a series of functions applied on data Factor is a stack oriented program - Data

More information

known as non-void functions/methods in C/C++/Java called from within an expression.

known as non-void functions/methods in C/C++/Java called from within an expression. FUNCTIONS 1 OUTLINE Basic Terminology Function Call and Return Parameters Parameter Passing Mechanisms Activation Records Recursive Functions Run Time Stack Function Declaration and Call in Clite Completing

More information

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 2. true / false ML can be compiled. 3. true / false FORTRAN can reasonably be considered

More information

CORE JAVA TRAINING COURSE CONTENT

CORE JAVA TRAINING COURSE CONTENT CORE JAVA TRAINING COURSE CONTENT SECTION 1 : INTRODUCTION Introduction about Programming Language Paradigms Why Java? Flavors of Java. Java Designing Goal. Role of Java Programmer in Industry Features

More information

Introduction to SQL/PLSQL Accelerated Ed 2

Introduction to SQL/PLSQL Accelerated Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Introduction to SQL/PLSQL Accelerated Ed 2 Duration: 5 Days What you will learn This Introduction to SQL/PLSQL Accelerated course

More information

Functional Programming Languages (FPL)

Functional Programming Languages (FPL) Functional Programming Languages (FPL) 1. Definitions... 2 2. Applications... 2 3. Examples... 3 4. FPL Characteristics:... 3 5. Lambda calculus (LC)... 4 6. Functions in FPLs... 7 7. Modern functional

More information

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U C A N A D I A N I N T E R N A T I O N A L S C H O O L O F H O N G K O N G INHERITANCE & POLYMORPHISM P2 LESSON 12 P2 LESSON 12.1 INTRODUCTION inheritance: OOP allows a programmer to define new classes

More information

Lecture 12: Data Types (and Some Leftover ML)

Lecture 12: Data Types (and Some Leftover ML) Lecture 12: Data Types (and Some Leftover ML) COMP 524 Programming Language Concepts Stephen Olivier March 3, 2009 Based on slides by A. Block, notes by N. Fisher, F. Hernandez-Campos, and D. Stotts Goals

More information

Object Oriented Programming. Java-Lecture 11 Polymorphism

Object Oriented Programming. Java-Lecture 11 Polymorphism Object Oriented Programming Java-Lecture 11 Polymorphism Abstract Classes and Methods There will be a situation where you want to develop a design of a class which is common to many classes. Abstract class

More information

Using ontologies function management

Using ontologies function management for Using ontologies function management Caroline Domerg, Juliette Fabre and Pascal Neveu 22th July 2010 O. Corby C.Faron-Zucker E.Gennari A. Granier I. Mirbel V. Negre A. Tireau Semantic Web tools Ontology

More information

Programming Language Pragmatics

Programming Language Pragmatics Chapter 10 :: Functional Languages Programming Language Pragmatics Michael L. Scott Historical Origins The imperative and functional models grew out of work undertaken Alan Turing, Alonzo Church, Stephen

More information

Answers to review questions from Chapter 2

Answers to review questions from Chapter 2 Answers to review questions from Chapter 2 1. Explain in your own words the difference between a method and a program. A method computes a value or performs some operation on behalf of the code for a program.

More information

MonoLog - Logging and Monitoring Specifications

MonoLog - Logging and Monitoring Specifications The ObjectWeb Consortium Interface Specification MonoLog - Logging and Monitoring Specifications AUTHORS: S. Chassande-Barrioz (INRIA) CONTRIBUTORS: JB. Stefani (INRIA) B. Dumant (Kelua) Released: March

More information

Compiler principles, PS1

Compiler principles, PS1 Compiler principles, PS1 1 Compiler structure A compiler is a computer program that transforms source code written in a programming language into another computer language. Structure of a compiler: Scanner

More information

Recursion Chapter 4 Self-Reference. Recursive Definitions Inductive Proofs Implementing Recursion

Recursion Chapter 4 Self-Reference. Recursive Definitions Inductive Proofs Implementing Recursion Recursion Chapter 4 Self-Reference Recursive Definitions Inductive Proofs Implementing Recursion Imperative Algorithms Based on a basic abstract machine model - linear execution model - storage - control

More information

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.asp...

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.asp... 1 of 8 8/27/2014 2:15 PM Units: Teacher: ProgIIIAPCompSci, CORE Course: ProgIIIAPCompSci Year: 2012-13 Computer Systems This unit provides an introduction to the field of computer science, and covers the

More information

Certification In Java Language Course Course Content

Certification In Java Language Course Course Content Introduction Of Java * What Is Java? * How To Get Java * A First Java Program * Compiling And Interpreting Applications * The JDK Directory Structure Certification In Java Language Course Course Content

More information

Available online at ScienceDirect. Procedia Computer Science 60 (2015 )

Available online at  ScienceDirect. Procedia Computer Science 60 (2015 ) Available online at www.sciencedirect.com ScienceDirect Procedia Computer Science 60 (2015 ) 302 311 19th International Conference on Knowledge Based and Intelligent Information and Engineering Systems

More information

functional programming in Python, part 2

functional programming in Python, part 2 Programming Languages Week 2 functional programming in Python, part 2 College of Information Science and Engineering Ritsumeikan University review of part 1 eliminating assignment makes programs easier

More information

Semantic Web and Linked Data

Semantic Web and Linked Data Semantic Web and Linked Data Petr Křemen December 2012 Contents Semantic Web Technologies Overview Linked Data Semantic Web Technologies Overview Semantic Web Technology Stack from Wikipedia. http://wikipedia.org/wiki/semantic_web,

More information

Functions and Recursion. Dr. Philip Cannata 1

Functions and Recursion. Dr. Philip Cannata 1 Functions and Recursion Dr. Philip Cannata 1 10 High Level Languages This Course Java (Object Oriented) Jython in Java Relation ASP RDF (Horn Clause Deduction, Semantic Web) Dr. Philip Cannata 2 let transformation,

More information

Programming in Visual Basic with Microsoft Visual Studio 2010

Programming in Visual Basic with Microsoft Visual Studio 2010 Programming in Visual Basic with Microsoft Visual Studio 2010 Course 10550; 5 Days, Instructor-led Course Description This course teaches you Visual Basic language syntax, program structure, and implementation

More information

Whom Is This Book For?... xxiv How Is This Book Organized?... xxiv Additional Resources... xxvi

Whom Is This Book For?... xxiv How Is This Book Organized?... xxiv Additional Resources... xxvi Foreword by Bryan Hunter xv Preface xix Acknowledgments xxi Introduction xxiii Whom Is This Book For?... xxiv How Is This Book Organized?... xxiv Additional Resources... xxvi 1 Meet F# 1 F# in Visual Studio...

More information

Chapter 15. Functional Programming Languages

Chapter 15. Functional Programming Languages Chapter 15 Functional Programming Languages Copyright 2009 Addison-Wesley. All rights reserved. 1-2 Chapter 15 Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages

More information

Data Types The ML Type System

Data Types The ML Type System 7 Data Types 7.2.4 The ML Type System The following is an ML version of the tail-recursive Fibonacci function introduced Fibonacci function in ML in Section 6.6.1: EXAMPLE 7.96 1. fun fib (n) = 2. let

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

SPARQL ME-E4300 Semantic Web,

SPARQL ME-E4300 Semantic Web, SPARQL ME-E4300 Semantic Web, 27.1.2016 Jouni Tuominen Semantic Computing Research Group (SeCo), http://seco.cs.aalto.fi jouni.tuominen@aalto.fi SPARQL SPARQL Protocol and RDF Query Language sparkle 2

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

Microsoft. Microsoft Visual C# Step by Step. John Sharp

Microsoft. Microsoft Visual C# Step by Step. John Sharp Microsoft Microsoft Visual C#- 2010 Step by Step John Sharp Table of Contents Acknowledgments Introduction xvii xix Part I Introducing Microsoft Visual C# and Microsoft Visual Studio 2010 1 Welcome to

More information

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led CENTER OF KNOWLEDGE, PATH TO SUCCESS Website: PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO 2010 Course: 10550A; Duration: 5 Days; Instructor-led WHAT YOU WILL LEARN This course teaches you

More information

Apache Jena Framework. Philippe Genoud Université Joseph Fourier Grenoble (France)

Apache Jena Framework. Philippe Genoud Université Joseph Fourier Grenoble (France) Apache Jena Framework Philippe Genoud Université Joseph Fourier Grenoble (France) (Philippe.Genoud@imag.fr) Astrakhan State University November 2012 1 What is Jena? Introduction An open source semantic

More information

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery. HTML5/CSS3/JavaScript Programming Course Summary Description This class is designed for students that have experience with basic HTML concepts that wish to learn about HTML Version 5, Cascading Style Sheets

More information

Introduction to Scientific Computing

Introduction to Scientific Computing Introduction to Scientific Computing Dr Hanno Rein Last updated: October 12, 2018 1 Computers A computer is a machine which can perform a set of calculations. The purpose of this course is to give you

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

CPS 506 Comparative Programming Languages. Programming Language Paradigm

CPS 506 Comparative Programming Languages. Programming Language Paradigm CPS 506 Comparative Programming Languages Functional Programming Language Paradigm Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming

More information

This page intentionally left blank

This page intentionally left blank This page intentionally left blank arting Out with Java: From Control Structures through Objects International Edition - PDF - PDF - PDF Cover Contents Preface Chapter 1 Introduction to Computers and Java

More information

Functional Programming. Pure Functional Programming

Functional Programming. Pure Functional Programming Functional Programming With examples in F# Pure Functional Programming Functional programming involves evaluating expressions rather than executing commands. Computation is largely performed by applying

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

8. Functions (II) Control Structures: Arguments passed by value and by reference int x=5, y=3, z; z = addition ( x, y );

8. Functions (II) Control Structures: Arguments passed by value and by reference int x=5, y=3, z; z = addition ( x, y ); - 50 - Control Structures: 8. Functions (II) Arguments passed by value and by reference. Until now, in all the functions we have seen, the arguments passed to the functions have been passed by value. This

More information

Two Approaches to Algorithms An Example (1) Iteration (2) Recursion

Two Approaches to Algorithms An Example (1) Iteration (2) Recursion 2. Recursion Algorithm Two Approaches to Algorithms (1) Iteration It exploits while-loop, for-loop, repeat-until etc. Classical, conventional, and general approach (2) Recursion Self-function call It exploits

More information

ENVIRONMENT DIAGRAMS AND RECURSION 2

ENVIRONMENT DIAGRAMS AND RECURSION 2 ENVIRONMENT DIAGRAMS AND RECURSION 2 COMPUTER SCIENCE 61A February 4, 2016 1 Environment Diagrams An environment diagram keeps track of all the variables that have been defined and the values they are

More information

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits.

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. LISP Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. From one perspective, sequences of bits can be interpreted as a code for ordinary decimal digits,

More information

Functions and Recursion

Functions and Recursion Programming Languages Functions and Recursion Dr. Philip Cannata 1 10 High Level Languages This Course Jython in Java Java (Object Oriented) ACL2 (Propositional Induction) Relation Algorithmic Information

More information

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-00 014 Subject: PPL Class : CSE III 1 P a g e DEPARTMENT COMPUTER SCIENCE AND ENGINEERING S No QUESTION Blooms Course taxonomy level Outcomes UNIT-I

More information

R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA.

R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA. R13 SET - 1 III B. Tech I Semester Regular Examinations, November - 2015 1 a) What constitutes a programming environment? [3M] b) What mixed-mode assignments are allowed in C and Java? [4M] c) What is

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

The Warhol Language Reference Manual

The Warhol Language Reference Manual The Warhol Language Reference Manual Martina Atabong maa2247 Charvinia Neblett cdn2118 Samuel Nnodim son2105 Catherine Wes ciw2109 Sarina Xie sx2166 Introduction Warhol is a functional and imperative programming

More information

Jena.

Jena. Jena http://openjena.org/ The Beginning... From: McBride, Brian Date: Mon, 28 Aug 2000 13:40:03 +0100 To: "RDF Interest (E-mail)" A few weeks ago I posted

More information

Representing Linked Data as Virtual File Systems

Representing Linked Data as Virtual File Systems Representing Linked Data as Virtual File Systems Bernhard Schandl University of Vienna Department of Distributed and Multimedia Systems http://events.linkeddata.org/ldow2009#ldow2009 Madrid, Spain, April

More information

11/2/2017 RECURSION. Chapter 5. Recursive Thinking. Section 5.1

11/2/2017 RECURSION. Chapter 5. Recursive Thinking. Section 5.1 RECURSION Chapter 5 Recursive Thinking Section 5.1 1 Recursive Thinking Recursion is a problem-solving approach that can be used to generate simple solutions to certain kinds of problems that are difficult

More information

Lambda Calculus see notes on Lambda Calculus

Lambda Calculus see notes on Lambda Calculus Lambda Calculus see notes on Lambda Calculus Shakil M. Khan adapted from Gunnar Gotshalks recap so far: Lisp data structures basic Lisp programming bound/free variables, scope of variables Lisp symbols,

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 12/02/2013 OCaml 1 Acknowledgement The material on these slides is based on notes provided by Dexter Kozen. 2 About OCaml A functional programming language All computation

More information

3. Functional Programming. Oscar Nierstrasz

3. Functional Programming. Oscar Nierstrasz 3. Functional Programming Oscar Nierstrasz Roadmap > Functional vs. Imperative Programming > Pattern Matching > Referential Transparency > Lazy Evaluation > Recursion > Higher Order and Curried Functions

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions) By the end of this course, students should CIS 1.5 Course Objectives a. Understand the concept of a program (i.e., a computer following a series of instructions) b. Understand the concept of a variable

More information

MI-PDB, MIE-PDB: Advanced Database Systems

MI-PDB, MIE-PDB: Advanced Database Systems MI-PDB, MIE-PDB: Advanced Database Systems http://www.ksi.mff.cuni.cz/~svoboda/courses/2015-2-mie-pdb/ Lecture 11: RDF, SPARQL 3. 5. 2016 Lecturer: Martin Svoboda svoboda@ksi.mff.cuni.cz Author: Martin

More information

Modern Trends in Semantic Web

Modern Trends in Semantic Web Modern Trends in Semantic Web Miroslav Blaško miroslav.blasko@fel.cvut.cz January 15, 2018 Miroslav Blaško (miroslav.blasko@fel.cvut.cz) Modern Trends in Semantic Web January 15, 2018 1 / 23 Outline 1

More information

recursive algorithms 1

recursive algorithms 1 COMP 250 Lecture 11 recursive algorithms 1 Oct. 2, 2017 1 Example 1: Factorial (iterative)! = 1 2 3 1 factorial( n ){ // assume n >= 1 result = 1 for (k = 2; k

More information

CS115 INTRODUCTION TO COMPUTER SCIENCE 1. Additional Notes Module 5

CS115 INTRODUCTION TO COMPUTER SCIENCE 1. Additional Notes Module 5 CS115 INTRODUCTION TO COMPUTER SCIENCE 1 Additional Notes Module 5 Example my-length (Slide 17) 2 (define (my-length alos) [(empty? alos) 0] [else (+ 1 (my-length (rest alos)))])) (my-length empty) alos

More information

Chapter 1. Fundamentals of Higher Order Programming

Chapter 1. Fundamentals of Higher Order Programming Chapter 1 Fundamentals of Higher Order Programming 1 The Elements of Programming Any powerful language features: so does Scheme primitive data procedures combinations abstraction We will see that Scheme

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) Introduction This semester, through a project split into 3 phases, we are going

More information

Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1

Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1 Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1 Inheritance Consider a new type Square. Following how we declarations for the Rectangle and Circle classes we could declare it as follows:

More information

III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I

III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I Total No. of Questions 4] [Total No. of Printed Pages 4 Seat No. [4718]-31 T.Y. B.Sc. (Computer Science) (Semester III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I Paper I (2008

More information

A Generic Mapping-based Query Translation from SPARQL to Various Target Database Query Languages

A Generic Mapping-based Query Translation from SPARQL to Various Target Database Query Languages A Generic Mapping-based Query Translation from SPARQL to Various Target Database Query Languages F. Michel, C. Faron-Zucker, J. Montagnat I3S laboratory, CNRS, Univ. Nice Sophia 1 Towards a Web of Data

More information