16
Context-aware systems and Linked Data Ville Seppänen [email protected] MATHM-57300 Semantic Techniques and Applications

Context-aware systems and Linked Data

Embed Size (px)

Citation preview

Context-aware systemsand Linked Data

Ville Seppä[email protected]

MATHM-57300Semantic Techniques and Applications

My research area

• The Internet of Things (IoT)– Everything is connected via RFID+URI– Scale of 50-100 trillion things

• Main issues are scalability, interoperability,security

• The data IoT provides can be used to providemore relevant and automated technology

12.10.2012MATHM-57300 | Ville Seppänen 2

A problem I have had

• Where to get a test data source that has…– Dynamic, ever-changing data?– Connections between People, Locations

and Devices?– Massive amount of real data (instead of

computer-generated or simulated)?

12.10.2012MATHM-57300 | Ville Seppänen 3

Solution: Foursquare!

12.10.2012MATHM-57300 | Ville Seppänen 4

REST-based API outputtingJSON

12.10.2012MATHM-57300 | Ville Seppänen 5

UsersVenues

Venuegroups

Checkins

Tips

Lists

Photos

Events

Example of JSON response

12.10.2012MATHM-57300 | Ville Seppänen 6

Foursquare API and 5-starOpen Data

“make your stuff available on the Web(whatever format) under an open license”

“make it available as structured data (e.g.,Excel instead of image scan of a table)”

“use non-proprietary formats(e.g., CSV instead of Excel)”

“use URIs to identify things, so thatpeople can point at your stuff”

“link your data to other data to providecontext”

12.10.2012MATHM-57300 | Ville Seppänen 7

Foursquare API and 5-starOpen Data

Yes(not fully open)

“make your stuff available on the Web(whatever format) under an open license”

Yes “make it available as structured data (e.g.,Excel instead of image scan of a table)”

Yes “use non-proprietary formats(e.g., CSV instead of Excel)”

“use URIs to identify things, so thatpeople can point at your stuff”

“link your data to other data to providecontext”

12.10.2012MATHM-57300 | Ville Seppänen 8

Foursquare API and 5-starOpen Data

Yes(not fully open)

“make your stuff available on the Web(whatever format) under an open license”

Yes “make it available as structured data (e.g.,Excel instead of image scan of a table)”

Yes “use non-proprietary formats(e.g., CSV instead of Excel)”

Partially(IDs for entities)

“use URIs to identify things, so thatpeople can point at your stuff”

Very little(links to Facebook)

“link your data to other data to providecontext”

12.10.2012MATHM-57300 | Ville Seppänen 9

Not far from JSON-LDFoursquare: "venue":{

"id":"4b613a3cf964a5207b0d2ae3","name":"Tampere University of Technology", … }

https://api.foursquare.com/v2/venues/4b613a3cf964a5207b0d2ae3https://foursquare.com/v/tampere-university-of-technology/4b613a3cf964a5207b0d2ae3

JSON-LD: { "@context": "http://json-ld.org/contexts/person.jsonld","@id": "http://dbpedia.org/resource/John_Lennon","name": "John Lennon", … }

person.jsonld: "@context": {"Person": "http://xmlns.com/foaf/0.1/Person","xsd": "http://www.w3.org/2001/XMLSchema#","name": "http://xmlns.com/foaf/0.1/name", … }

12.10.2012MATHM-57300 | Ville Seppänen 10

Let’s write some Python!“This application uses the foursquare® application programming interfacebut is not endorsed or certified by Foursquare Labs, Inc.”

• Fetch description of venue (and cache the response for future usage)data_blob = urllib2.urlopen('https://api.foursquare.com...').read()

• Make some initial text-level transformations towards JSON-LDlinkified_json = json.loads(load_data_blob(query_type, query_id,query_aspect).replace('"id"','"@id"'))['response']

• Filter out uninteresting propertiesfor i in list_of_deletables: del linkified_json['venue'][i]

• Make the rest of JSON-LD enrichment by adding @context entries# Damn it, ran out of time! Have to make triples manually. :(

• Parse the JSON-LD into a RDFlib Graphg = Graph().parse(data=json.dumps(linkified_json), format='json-ld')

• Print RDF/XMLprint(g.serialize(format=”pretty-xml"))

12.10.2012MATHM-57300 | Ville Seppänen 11

About the assignment

• My SKOS scheme is based loosely on:– SOUPA: ”Standard ontology for ubiquitous and

pervasive applications”– CONON: ”The Context Ontology”

• User, Device, Location, Photo, Content,Service…

• Handmade dataset based on the JSONresponse– Contains TUT venue, its mayor, several photos and

their creators12.10.2012MATHM-57300 | Ville Seppänen 12

What can we do with it?

• Simple examples:– List places which have women as the majority of contributors– Compare photos taken by locals vs. foreigners– List venues that are shared by active contributors of a venue

• On a more wider scale:– Analyze the effects of (hosted) events– Predict customer/visitor flow– Learn about correlation between places and people

• The ultimate goal:– More relevant services that accommodate to context

12.10.2012MATHM-57300 | Ville Seppänen 13

Side note: Privacy

• Linking social accountstogether is powerful– People should be aware of the

”union of social web data”

• We will have more linksbetween data and more(detailed) data

• What about Terms of Serviceand research usage?

12.10.2012MATHM-57300 | Ville Seppänen 14

References

In order of appearance:• TUT in Foursquare• Foursquare API for developers• JSON Parser Online for visualization• 5-star Open Data• JSON-LD• SOUPA: Chen, Perich, Finin, Joshi. SOUPA: Standard ontology for

ubiquitous and pervasive applications. 2004.• CONON: Wang, Zhang, Gu, Pung. Ontology based context

modeling and reasoning using OWL. 2004.

12.10.2012MATHM-57300 | Ville Seppänen 15

Thank you!

Questions?

[email protected]

12.10.2012MATHM-57300 | Ville Seppänen 16