2. 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 provide
more relevant and automated technology
12.10.2012MATHM-57300 | Ville Seppänen 2
3. 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
6. Example of JSON response
12.10.2012MATHM-57300 | Ville Seppänen 6
7. Foursquare API and 5-star
Open 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 that
people can point at your stuff”
“link your data to other data to provide
context”
12.10.2012MATHM-57300 | Ville Seppänen 7
8. Foursquare API and 5-star
Open 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 that
people can point at your stuff”
“link your data to other data to provide
context”
12.10.2012MATHM-57300 | Ville Seppänen 8
9. Foursquare API and 5-star
Open 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 that
people can point at your stuff”
Very little
(links to Facebook)
“link your data to other data to provide
context”
12.10.2012MATHM-57300 | Ville Seppänen 9
10. Not far from JSON-LD
Foursquare: "venue":{
"id":"4b613a3cf964a5207b0d2ae3",
"name":"Tampere University of Technology", … }
https://api.foursquare.com/v2/venues/4b613a3cf964a5207b0d2ae3
https://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
11. Let’s write some Python!
“This application uses the foursquare® application programming interface
but 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-LD
linkified_json = json.loads(load_data_blob(query_type, query_id,
query_aspect).replace('"id"','"@id"'))['response']
• Filter out uninteresting properties
for 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 Graph
g = Graph().parse(data=json.dumps(linkified_json), format='json-ld')
• Print RDF/XML
print(g.serialize(format=”pretty-xml"))
12.10.2012MATHM-57300 | Ville Seppänen 11
12. 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 JSON
response
– Contains TUT venue, its mayor, several photos and
their creators
12.10.2012MATHM-57300 | Ville Seppänen 12
13. 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
14. Side note: Privacy
• Linking social accounts
together is powerful
– People should be aware of the
”union of social web data”
• We will have more links
between data and more
(detailed) data
• What about Terms of Service
and research usage?
12.10.2012MATHM-57300 | Ville Seppänen 14
15. 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