40
Prof. Dr. Thomas Schwotzer Computer Science / Mobile Applications [email protected] Shark Framework (Building Context Aware P2P Applications) work in progress

Building Context Aware P2P Systems with the Shark Framework

  • Upload
    tmra

  • View
    1.582

  • Download
    0

Embed Size (px)

DESCRIPTION

Shark Framework is framework supporting implementation of context aware P2P systems. Shark is an acronym and stand for Shared Knowledge. There is already a theory on context aware P2P systems which is implemented by the Shark framework.Target platforms are in the first step J2SE, J2ME and Android. In next steps iPhone and Microsoft based mobile devices will be supported.Shark FW supports the Knowledge Exchange Protocol (KEP) which is a stateless P2P protocol. Currently KEP has been ported to UDP and TCP. A Bluetooth L2CAP implementation will be available in October. This paper (briefly) explains core concepts of the framework. Sample code illustrates usage of Shark. It is illustrated that just two lines of code are sufficient to set up a peer that exchanges knowledge. This paper is also a call for participation. Shark is an open source project and is open to developers and users. Join us!

Citation preview

Page 1: Building Context Aware P2P Systems with the Shark Framework

Prof. Dr. Thomas Schwotzer Computer Science / Mobile Applications

[email protected]

Shark Framework(Building Context Aware P2P

Applications)

work in progress

Page 2: Building Context Aware P2P Systems with the Shark Framework

TOC

• Knowledge• Knowledge Exchange• A model of Knowledge Exchange Process

(Shark)• A knowledge exchanging software engine

(Shark Engine / Shark Framework)• Examples• Status• Summary

Page 3: Building Context Aware P2P Systems with the Shark Framework

Boring....

• Some of your might know Shark– 2001 – 2006 TU Berlin:

• How to apply Semantics to Mobile World• Mobile Shared Knowledge• 1st paper 2002, several technology studies, some

open source projects started• 2006 PhD• work stopped

• Other scientists know such situations :-(• Since April 2008 relaunch

– still an issue– ocean of time, enthusiastic people/students

Page 4: Building Context Aware P2P Systems with the Shark Framework

Message

• Shark Framework will be finished• Will be maintained

– at least in the next 28 years• This isn't and won't be my project• Shark stands for Shared Knowledge• Let's share it• Open Source with LGPL (sourceforge)• www.sharksystem.net

Page 5: Building Context Aware P2P Systems with the Shark Framework

Knowledge

• AI / Knowledge Representation: – An ontology is / contains / comprises

knowledge– A Topic Map is knowledge– Knowledge can be stored in a Topic Map– set of facts (e.g. represented by PROLOG)

• Definition by structure

Page 6: Building Context Aware P2P Systems with the Shark Framework

Knowledge (2)

• Knowledge Management– Knowledge is something that helps people to

perform a task / to solve a problem– Process oriented view on knowledge– BTW: subject isn't anything!

• Somebody must be interested in it! No intelligent life -no subjects.

• Implications:– A document can be knowledge for person A

but just (electronic) paper for B , e.g.• due to lack of background knowledge• can't read the format no PDF reader available• can't understand the spoken, programming,

description or whatever language

Page 7: Building Context Aware P2P Systems with the Shark Framework

Knowledge (3)

• Implications:– A document can be knowledge for person A

but just (electronic) paper for B , e.g.• due to lack of background knowledge• can't read the format no PDF reader available• can't understand the spoken, programming,

description or whatever language

Page 8: Building Context Aware P2P Systems with the Shark Framework

Knowledge (4)

• Is a document D knowledge? – If it helps a person A in a given situation – yes

D is knowledge for A in this situation– If not: D is no knowledge

• It depends on the context– issuer, receiver, current situation (in its broadest

possible sense)

Page 9: Building Context Aware P2P Systems with the Shark Framework

Knowledge in Topic Maps

• Information resources can be knowledge– Can contain descriptions that help

• An association of Topics can be knowledge– Can help to find relations or IR

• Topics– Can be knowledge

if representing subjects that help– Can be context

and help to find knowledge

Page 10: Building Context Aware P2P Systems with the Shark Framework

Is knowledge true?

• With given definition – it's impossible to decide

• No objective independent instance which could decide

• Semantic networks (e.g. Topic Maps) represent meanings / statements of the authors

• Known concept: Reification

Page 11: Building Context Aware P2P Systems with the Shark Framework

Knowledge – a picture

Information

ContextPerson

Statement Knowledge Particle= Statement + Issuer

Page 12: Building Context Aware P2P Systems with the Shark Framework

Knowledge Exchange - Example

Mobile Person Mobile Person

„1… that's interesting“2 „That's what I mean“

3 „I have some documents about it. Want to have look?“4 „Please.“

5 „Sounds good. Thanks!“

Page 13: Building Context Aware P2P Systems with the Shark Framework

Steps

• Negotiation– Who has information about what topics– Who is interested and allowed to send/receive

information– Implicitly: take context into account– Leads to an exchange context

• Knowledge Exchange

Page 14: Building Context Aware P2P Systems with the Shark Framework

Different to Knowledge Retrieval

• Simple query doesn't produce knowledge• Full text search on e.g. “music”• semantic search (e.g. by TMQL) not

fundamentally better• Context is not described explicitly

– Background knowledge– Situation – ...

Page 15: Building Context Aware P2P Systems with the Shark Framework

+

Knowledge Exchange Processpotential sender potential receiver

remote identity

remote interests

sending interests

environment(eavesdropping, ..)

+

+

=Knowledge

Particle

Extraction

KB KB

Assimilation

* I confess: The term assimilation is stolen from the Borg in Star Trek. Hope they'll never find out.

+

remote identity

remote interests

receiving interests

environment(eavesdropping, ..)

+

+

Page 16: Building Context Aware P2P Systems with the Shark Framework

Extraction / Assimilation

• Extraction – Process creates a knowledge – wants receiver to integrate this knowledge– A sender can

• lie • isn't an expert

• Assimilation– Process that integrates (parts) of received

knowledge

Page 17: Building Context Aware P2P Systems with the Shark Framework

Knowledge Exchange Protocol (KEP)

• Interest– exposes topics of which knowledge is welcome

• Offer– exposes topics of which knowledge can be sent

• Accept– sent from a receiver to a dedicated sender– sents a number of topics

• Insert– sent from a sender to a dedicated receiver – Knowledge particle

Page 18: Building Context Aware P2P Systems with the Shark Framework

KEP Example 1

Peer S

Peer R

Musik / * Musik / *

Establish connection / Identifying

offer(musik)

interest(musik)

accept(musik)

insert(KnowledgeParticle kp)

extract(R, Musik);

assimilate(S, kp);

Page 19: Building Context Aware P2P Systems with the Shark Framework

KEP Example 2 (mobile leaflet)

Peer S

Peer R

Musik / * Musik / *

Establish connection / Identifying

interest(musik)

insert(KnowledgeParticle kp)

extract(R, Musik);

assimilate(S, kp);

Page 20: Building Context Aware P2P Systems with the Shark Framework

KEP Example 3 (hide interests)

Peer S

Peer R

Musik / * Musik / *

Establish connection / Identifying

accept(*)

insert(KnowledgeParticle kp)

extract(R, Musik);

assimilate(S, kp);

Page 21: Building Context Aware P2P Systems with the Shark Framework

Shark Data Model (in UML, sketch)

Interest

Topic

Information

Peer

1..*

1..*

*

1

Page 22: Building Context Aware P2P Systems with the Shark Framework

Shark Data Model (as TM)

Topic2

Topic1Peer

APeer

B

T represents a special interest

SendingReceivingInterest

Remote Peer

TopicPeer

Anonymous

Type

Type

Page 23: Building Context Aware P2P Systems with the Shark Framework

Shark Peer

• Software• Implements extraction and assimilation• Implements KEP• Manages Knowledge Ports which store

interests• Process

– Observes environment– If remote peer is detected:– run KEP (in defined flavour)

Page 24: Building Context Aware P2P Systems with the Shark Framework

Autonomy

• Exchanges knowledge only based on rules described in KPs

• Rules can be changed locally – no interaction with any server required

Page 25: Building Context Aware P2P Systems with the Shark Framework

Flow of knowledge

new idea

Alice

Alice

Externalization

BruceI agree

Bruce

Alice

I think I think

author author

Page 26: Building Context Aware P2P Systems with the Shark Framework

Collaboration

Topic Maps expert

company / institute working

(trusts its TM experts)

member / employees

M-TM-P M-TM-P

M-TM-P

M-TM-P

M-TM-P

Page 27: Building Context Aware P2P Systems with the Shark Framework

Knowledge Flow Management

Topic Maps expert

company / institute working

(trusts its TM experts)

member / employees

M-TM-P M-TM-P

M-TM-P

M-TM-P

M-TM-P

TM TMTM

TM

TM

Page 28: Building Context Aware P2P Systems with the Shark Framework

Implicit ontology expansion

MusicMusic/*/*

Music

Music/*/*

HipHop

MP3File

HipHop

MP3File

Page 29: Building Context Aware P2P Systems with the Shark Framework

Individuals KB = patchwork

M-?-P

Page 30: Building Context Aware P2P Systems with the Shark Framework

Architecture

Knowledge Ports / KEP

Knowledge Base ProtocolNetwork Environment

FS TMTMJ2ME

Service Mng Security TCP BT

L2CAPUDP

Sensors

Page 31: Building Context Aware P2P Systems with the Shark Framework

Some classes

PeerKnowledgeBase

fs.KnowledgeBase

inMemo.KnowledgeBase

Environment

SimpleEnvironment// single thread

KnowledgePort

tinyTIM.KnowledgeBase

Page 32: Building Context Aware P2P Systems with the Shark Framework

Code sample

KnowledgeBase = new tinyTIM.KnowledgeBase();Environment env = new SimpleEnvironment();Peer myPeer = new Peer(kb, env);Context any = new Context(Context.ANY);RemotePeer rPeer = new

RemotePeer(RemotePeer.ANONYMOUS)myPeer.createIKP(any, any, rPeer);

Page 33: Building Context Aware P2P Systems with the Shark Framework

myPeer

Code sample - result

tinyTIM

*/*/*

single threadedTCP basedenvironment

Page 34: Building Context Aware P2P Systems with the Shark Framework

Mobile Communities

Mobile Phone

Mobile

Find peers/people withsimilar interests and exchange knowledge/information

Page 35: Building Context Aware P2P Systems with the Shark Framework

Location Based Services

Hotspot

Mobile

Send information to passer-by

Mobile

Mobile

Page 36: Building Context Aware P2P Systems with the Shark Framework

Collaboration / Semantic Grid

Mobile

Exchange documents, rumours, links

PC

PC

Page 37: Building Context Aware P2P Systems with the Shark Framework

Work in progress

• Implementation started April, 2008• Shark-FW-Core exists• KEP exists, used exchange format

– compressed proprietary format– Topic Maps

• Protocols– TCP, UDP work– BT Prototyp

• Knowledge Bases– Filesystem – Prototyp– tinyTIM – implementation has begun

Page 38: Building Context Aware P2P Systems with the Shark Framework

Next steps / priority list

• Applications– Collaboration platform– Mobile Community Application

• Knowledge Base – J2ME

(revive the TM4J2ME project (sourceforge)– Jena-FW (RDF) (I'll be a traitor, sorry!!)

• Protocols– Stable Bluetooth implementation– HTTP

Page 39: Building Context Aware P2P Systems with the Shark Framework

Distributed evolutionary Ontologies

• Knowledge can be – Information resources– Topics and Associations

• A P2P Knowledge Exchange can lead to changes in Topic Maps

• Kind of evolutionary process– Any receiver can accept or drop changes – “survival of the fittest concepts”– Might lead to a drift and groups of peers

sharing same / similar ontologies

Page 40: Building Context Aware P2P Systems with the Shark Framework

Summary

• Shark model describes the process of knowledge exchange

• Shark Framework implements this model• basis for number of applications• Buzzwords for Shark Applications

– Semantic Grid Applicationsmore specific mobile Topic Grid Apps

– context aware P2P Apps