Use this title slide only with an image Integrating OData Services into the Semantic Web Marc...

14
Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Publ ic

Transcript of Use this title slide only with an image Integrating OData Services into the Semantic Web Marc...

Page 1: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

Use this title slide only with an image

Integrating OData Services into the Semantic WebMarc KirchhoffSeptember 2014 Public

Page 2: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 2Public

Agenda

Motivation

Problem

Architecture

Semantic description of OData services

Mapping SPARQL queries to OData calls Evaluation semantics for graph templates Creation of OData URIs

Example

Conclusion

Page 3: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 3Public

Motivation

The retrieval of data from ERP-systems is not an easy task.

Equipment A

ID = 71277SerialNr. = 234867ManuName = "XYC"

Document A

ID = 71277Description = "Technical Documentation"

Document B

ID = 89723Description = "User Manual"

Document C

ID = 62435Description = "Quick Guide"

SPARQL:SELECT ?desc WHERE { ?equ rdf:type boo:Equipment . ?equ boo:hasManufacturerSerialID 234867 .

?equ boo:hasManufacturerName "XYC" . ?equ boo:hasDocument ?doc . ?doc boo:hasDescription ?desc }

vs.

Existing interfaces: Several service-/RPC-calls Several hundred lines of code

Page 4: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 4Public

Problem

It is not possible to realize the SPARQL endpoint on top of the database

Solution: Place it on top of the OData interface

OData = Open Data Protocol REST-based protocol (HTTP, AtomPub and JSON) Widespread attention within the industry (Microsoft, eBay, SAP usw.) Query language (filter, select etc.)

OData Interface

SPARQL-OData-Layer

SPARQL

Page 5: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 5Public

Architecture

OData Server

Query Engine

Execution Engine

Triple Store

SPARQL Processor

RDF Adapter

Reasoner

R

R

R

Service Registry

SPARQL-OData-Layer

R

Client Application

R

OData Interface

SPARQL-OData-Layer

SPARQL

Page 6: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 6Public

Entity Data Model

EDM = Entity Data Model

Realization of the entity relationship model Entity Types / Entities Properties / Navigation Properties Inheritance

Described in CSDL

CSDL-description is part of the Service Metadata Document

ExpressOrder

ExtraShippingFee: Edm.Int32

Customer

CustomerID: Edm.Int32CompanyName: Edm.Date

FK_Orders_Customers

*0..1Order

OrderID: Edm.Int32ShippedDate: Edm.DateShipName: Edm.String

Page 7: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 7Public

Extension of CSDL

Goal: Extension of CSDL that allows the definition of mappings from EDM to RDF

Order+OrderID: Edm.Int32+ShippedDate: Edm.Date+ShipName: Edm.String

northwi:3323/Order_<ID><?

>^^ownns:own_data_type

northw:shipped_date<?>^^xsd:int

northw:order_id

<?>@en

northw:ship_name

northw:Order

rdf:type

Entity Type

RDF-Graph-Template

<EntityType Name="Order" sem:Mapping="?order rdf:type northw:Order"> <Property Name="ShippedDate" Type="Edm.DateTime" sem:Mapping="?order northw:shipped_date $^^ownns:own_data_type"/> <Property Name="ShipName" Type="Edm.String" sem:Mapping="?order northw:ship_name $@en" /> …</EntityType>

Page 8: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 8Public

Mapping SPARQL queries to OData calls

SELECT ?s ?oWHERE { ?s_1 rdf:type type_1 . ?s_1 p_1 o_1 OPTIONAL { ?s_1 p_2 ?o_2 } …}

SPARQL Query SPARQL-AlgebraMapping

OData Service Calls

Query Engine

Semantically annotated Service-

Metadata-Documents

LeftJoin

BGP BGP

Project

GET URL_1 GET URL_2 GET URL_3

Page 9: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 9Public

Evaluation semantics for graph templates

SPARQL-AlgebraSemantically annotated

CSDL-documents

Graph-Template

Project(LeftJoin(,),{?s,?o}) = GET URL_1 GET URL_2 GET URL_3

LeftJoin

BGP BGP

Project

Triple-Patterns

Page 10: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 10Public

Example

SELECT *WHERE { ?or rdf:type ens:Order . ?or ens:ordered_by ?cu . OPTIONAL { ?cu ens:city ?city . ?cu ens:country 'Germany' }}

LeftJoin(BGP(?or rdf:type ens:Order. ?or ens:ordered_by ?cu), BGP(?cu ens:city ?city. ?cu ens:country 'Germany'),true)

SPARQL-Algebra

SPARQL

Page 11: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 11Public

Example

?order rdf:type ens:Order .?order ens:ordered_by ?customer .?customer ens:city $City .?customer ens:country $Country .?employee ens:city $City .?employee ens:country $Country .

?or rdf:type ens:Order .?or ens:ordered_by ?cu .

?cu ens:city ?city .?cu ens:country 'Germany' .

<Root-URI>/Orders ?$select=OrderID,Customers/CustomerID &$expand=Customers

<Root-URI>/Customers?$select=CustomerID,City &$filter=Country eq 'Germany'

<Root-URI>/Employees?$select=EmployeeID,City &$filter=Country eq 'Germany'

Page 12: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 12Public

Example

LeftJoin(BGP(?or rdf:type ens:Order. ?or ens:ordered_by ?cu), BGP(?cu ens:city ?city. ?cu ens:country 'Germany'),true)

LeftJoin({},{, },true) =

<Root-URI>/Orders ?$select=OrderID,Customers/CustomerID &$expand=Customers

<Root-URI>/Customers?$select=CustomerID,City &$filter=Country eq 'Germany'

Page 13: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. 13Public

Conclusion

Motivation and problem Simplify the retrieval of data from ERP-systems Realization of SPARQL-endpoint based on a relational database is not possible

Solution Semantic description of OData services Evaluation semantics for graph templates Concepts for the creation of OData URIs

Contributions Simplification of specific queries Integration of different systems Integration of OData services into the Semantic Web

Page 14: Use this title slide only with an image Integrating OData Services into the Semantic Web Marc Kirchhoff September 2014 Public.

© 2014 SAP AG or an SAP affiliate company. All rights reserved.

Thank you

Contact information:

Marc KirchhoffChemnitzer Straße 48, 01187 Dresden+49 351 [email protected]