Top Banner
Terp: Syntax for OWL-friendly SPARQL queries Evren Sirin, Blazej Bulka and Michael Smith Clark & Parsia, LLC
27

Terp: An OWL-friendly SPARQL

Dec 18, 2014

Download

Technology

Terp is a SPARQL syntax that makes querying OWL ontologies much easier.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Terp: An OWL-friendly SPARQL

Terp Syntax for OWL-friendly SPARQL queries

Evren Sirin Blazej Bulka and Michael SmithClark amp Parsia LLC

Who are webull Clark amp Parsia is a semantic software startup

o HQ in Washington DC amp office in Bostonbull Provides software development and integration

servicesbull Specializing in Semantic Web web services and

advanced AI technologies for federal and enterprise customers

httpclarkparsiacom Twitter candp

Motivation

bull Make it easy to read and write queries for OWL ontologies

bull Allow both schema and instance queries

bull Without inventing a completely new query language

bull Not hard to learn

Querying OWL

bull The most commonly used Semantic Web query language is SPARQL

bull SPARQL intended for RDF

bull Semantics based on pattern matching over RDF graphs

bull Semantics extensions possible via entailment regimes

bull SPARQL-DL extension [OWLED 2008 paper]

bull SPARQL 11 entailment regime [SPARQL WG]

Simple SPARQL Query

bull Query Find the flavors of red French wines

PREFIX rdf lthttpgtPREFIX wine lthttpgt

SELECT wine flavor wine rdftype wineFrenchWine wine rdftype wineRedWine wine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 2: Terp: An OWL-friendly SPARQL

Who are webull Clark amp Parsia is a semantic software startup

o HQ in Washington DC amp office in Bostonbull Provides software development and integration

servicesbull Specializing in Semantic Web web services and

advanced AI technologies for federal and enterprise customers

httpclarkparsiacom Twitter candp

Motivation

bull Make it easy to read and write queries for OWL ontologies

bull Allow both schema and instance queries

bull Without inventing a completely new query language

bull Not hard to learn

Querying OWL

bull The most commonly used Semantic Web query language is SPARQL

bull SPARQL intended for RDF

bull Semantics based on pattern matching over RDF graphs

bull Semantics extensions possible via entailment regimes

bull SPARQL-DL extension [OWLED 2008 paper]

bull SPARQL 11 entailment regime [SPARQL WG]

Simple SPARQL Query

bull Query Find the flavors of red French wines

PREFIX rdf lthttpgtPREFIX wine lthttpgt

SELECT wine flavor wine rdftype wineFrenchWine wine rdftype wineRedWine wine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 3: Terp: An OWL-friendly SPARQL

Motivation

bull Make it easy to read and write queries for OWL ontologies

bull Allow both schema and instance queries

bull Without inventing a completely new query language

bull Not hard to learn

Querying OWL

bull The most commonly used Semantic Web query language is SPARQL

bull SPARQL intended for RDF

bull Semantics based on pattern matching over RDF graphs

bull Semantics extensions possible via entailment regimes

bull SPARQL-DL extension [OWLED 2008 paper]

bull SPARQL 11 entailment regime [SPARQL WG]

Simple SPARQL Query

bull Query Find the flavors of red French wines

PREFIX rdf lthttpgtPREFIX wine lthttpgt

SELECT wine flavor wine rdftype wineFrenchWine wine rdftype wineRedWine wine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 4: Terp: An OWL-friendly SPARQL

Querying OWL

bull The most commonly used Semantic Web query language is SPARQL

bull SPARQL intended for RDF

bull Semantics based on pattern matching over RDF graphs

bull Semantics extensions possible via entailment regimes

bull SPARQL-DL extension [OWLED 2008 paper]

bull SPARQL 11 entailment regime [SPARQL WG]

Simple SPARQL Query

bull Query Find the flavors of red French wines

PREFIX rdf lthttpgtPREFIX wine lthttpgt

SELECT wine flavor wine rdftype wineFrenchWine wine rdftype wineRedWine wine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 5: Terp: An OWL-friendly SPARQL

Simple SPARQL Query

bull Query Find the flavors of red French wines

PREFIX rdf lthttpgtPREFIX wine lthttpgt

SELECT wine flavor wine rdftype wineFrenchWine wine rdftype wineRedWine wine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 6: Terp: An OWL-friendly SPARQL

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 7: Terp: An OWL-friendly SPARQL

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 8: Terp: An OWL-friendly SPARQL

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 9: Terp: An OWL-friendly SPARQL

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colon

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 10: Terp: An OWL-friendly SPARQL

SPARQL Abbreviations

bull Query Find the flavors of red French wines

PREFIX wine lthttpgt

SELECT wine flavor wine a wineFrenchWine wineRedWine winehasFlavor flavor Turtle keyword a

instead of rdftype

Object listsseparated by comma

Predicate-object lists separated by

semi-colonbull Result a concise query

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 11: Terp: An OWL-friendly SPARQL

OWL over RDF

bull RDF knows about triples (and only triples)

bull OWL has many different constructs

bull Classpropertydata expressions axioms etc

bull Triple-based representation of OWL can be

bull verbose

bull unintuitive

bull hard to read or understand

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 12: Terp: An OWL-friendly SPARQL

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 13: Terp: An OWL-friendly SPARQL

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 14: Terp: An OWL-friendly SPARQL

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 15: Terp: An OWL-friendly SPARQL

SPARQL over OWL

bull Query Find wines that are made of at least two grapesSELECT wine flavor wine a [ owlintersectionOf ( wineWine [ a owlRestriction owlonProperty winemadeFromGrape owlminCardinality 2 ])]

RDF List abbreviation

Bnode abbreviation

bull Result less than ideal (no OWL shortcuts)

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 16: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 17: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 18: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 19: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 20: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 21: Terp: An OWL-friendly SPARQL

We have a syntax for that

bull Pick the OWL syntax suitable for you

bull I want a formal syntax Use Functional Syntax

bull I want a syntax that plays nicely with XQuery and XML schema Use OWLXML syntax

bull I want to write OWL expressions easily Use Manchester Syntax

bull I want a triple-friendly syntax Use Turtle syntax

bull I donrsquot need your help Use RDFXML syntax

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 22: Terp: An OWL-friendly SPARQL

Terp Syntax

bull Combine Turtle with Manchester syntax

bull Use Manchester syntax for expressing class property or datatype expressions

bull Manchester syntax expressions can appear in subject or object position of triples

SELECT wine flavor wine a ( wineWine and winemadeFromGrape min 2 )

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 23: Terp: An OWL-friendly SPARQL

Complex Terp Example

bull Query Find meal courses that go with full-bodied wines if exists return the associated label order results by labels but donrsquot include owlNothingSELECT wine flavor mealCourse rdfssubClassOf foodMealCourse foodhasDrink some ( wineWine and winehasBody value wineFull ) OPTIONAL mealCourse rdfslabel label FILTER ( mealCourse = owlNothing )ORDER BY rdfslabel

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 24: Terp: An OWL-friendly SPARQL

Terp Grammar

bull Merge SPARQL grammar with Manchester syntax grammar

bull Keep all the syntax features of SPARQL

bull A few cases where ambiguity arises

bull Ex Parentheses are used for lists in SPARQL and for nesting in Manchester syntax

bull Try to resolve ambiguity by the context

bull Assume SPARQL intent otherwise

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 25: Terp: An OWL-friendly SPARQL

Implementation

bull Terp parser implemented in Pellet and available as of version 21

bull Integrated through Jena ARQ architecture

bull Can translate any Terp query to regular SPARQL syntax

bull Can be used programmatically or through CLI

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 26: Terp: An OWL-friendly SPARQL

Possible Extensions

bull Allow Manchester syntax in predicate position

bull Ex Use equivalentTo instead of owlequivalentClass and owlequivalentProperty

bull Support for additional OWL 2 constructs

bull Ex Negative property assertions axiom annotations

bull More syntactic sugar for frequently used OWL features

Questions

Page 27: Terp: An OWL-friendly SPARQL

Questions