SlideShare a Scribd company logo
Querying Linked Data on
Android
Module 2 adaptation for Android
enabled devices
07.04.2014 1
Outline
• This document complements to webinar
Module 2: Querying Linked Data
• It targets querying linked data on mobile
(Android) devices
• Original queries modified to correspond to
limited resources environments
• Triple store implementation by Ontos AG
(http:// www.ontos.com)
07.04.2014 2
Webinar Structure
• OntoQuad installation instructions
• Deployment of preloaded dataset in
OntoQuad
• Running sample queries against the
OntoQuad SPARQL endpoint
07.04.2014 3
OntoQuad Installation
• RDF store for Android
• Detailed setup instructions already provided
by Ontos AG (attached)
• Fresh installations should be started at least
once to initialize their data directory
structures
• OntoQuad should be completely stopped
before deploying preloaded datasets (next
slides)
07.04.2014 4
Prebuild dataset deployment
• Musicbrainz dataset extract
– 5 million RDF triples subset
– No special hardware requirements (<1GB
external storage)
– Sufficient deployment and query response
times
– Still representative for demonstration and
educational purposes
07.04.2014 5
Prebuild dataset setup
• Download the binary files archive
(musicbrainz-5m-bin.zip) on your PC
• Extract the archive on the local file system
– Important files and folders: ./vm, ./txlogs,
.universe, .commands
• Ensure OntoQuad in not active/running
before performing the next steps
07.04.2014 6
Prebuild dataset setup (2)
• Connect the mobile device via appropriate
USB cable to PC and overwrite the
existing files in folder:
/storage/extSdCard/margot/ with the ones
from the archive
• Disconnect the mobile device and start the
OntoQuad server
07.04.2014 7
Setup Verification
• Start the Admin Console and select the
SPARQL section (it will take some time)
• Execute the following query:
SELECT (COUNT(?s) as ?count)
WHERE { ?s ?p ?o }
• The result count value should be
approximately 5 million
07.04.2014 8
Module 2 for Android
• Based on original Webinar Module 2
content
• SPARQL queries adapted for the extracted
data set and the current implementation
limitations
• Each query description refers to the
original location in the Module 2
presentation
07.04.2014 9
Module 2 for Android (2)
• What albums did Queen make (slide 15) ?
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album a mo:Release ; dc:title ?title
}
ORDER BY ?title
07.04.2014 10
Module 2 for Android (3)
• What albums and tracks did Queen make
(slide 22) ?
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album_name ?track_title
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album dc:title ?album_name ;
mo:record ?record .
?record mo:track ?track .
?track dc:title ?track_title . }
07.04.2014 11
Module 2 for Android (4)
• Retrieve the albums and tracks recorded by Queen,
where the duration of the song is more than 300 secs.
and no longer than 400 secs (slide 23)
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album_name ?track_title ?duration
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album dc:title ?album_name ;
mo:record ?record .
?record mo:track ?track .
?track dc:title ?track_title ;
mo:duration ?duration;
FILTER (?duration > 300000 && ?duration < 400000) }
07.04.2014 12
Module 2 for Android (5)
• Retrieve the name of the albums recorded by
Queen which have at least two different
songs (slide 24)
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT DISTINCT ?album_name
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album dc:title ?album_name ;
mo:record ?record .
?record mo:track ?track1 .
?record mo:track ?track2 .
FILTER (?track1 != ?track2) }
07.04.2014 13
Module 2 for Android (6)
• Retrieve the duration of the albums recorded by
Queen (slide 25)
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album ?album_name (SUM(?track_duration) AS ?album_duration)
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album mo:record ?record ;
dc:title ?album_name.
?record mo:track ?track .
?track mo:duration ?track_duration .
}
GROUP BY ?album ?album_name
HAVING (SUM(?track_duration) > 3600000)
07.04.2014 14
Module 2 for Android (7)
• Create the dc:creator descriptions for albums
and their tracks recorded by Queen (slide
29)*
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT {
?album dc:creator ?band .
?track dc:creator ?band .}
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album mo:record ?record .
?record mo:track ?track . }
*Note: CONSTRUCT queries might not work properly with the current implementation
07.04.2014 15
Module 2 for Android (8)
• Create the dc:creator descriptions of the
albums recorded by Queen whose title
contains the word 'rock’ (slide 31)*
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT { ?album dc:creator ?band }
WHERE {
?band foaf:name "Queen" .
?band foaf:made ?album .
?album dc:title ?album_name .
FILTER (REGEX(?album_name, ".*rock.*", "i"))
}
*Note: CONSTRUCT queries might not work properly with the current implementation
07.04.2014 16
Module 2 for Android
Thank you!
07.04.2014 17

More Related Content

PDF
Mon norton tut_queryinglinkeddata02
PPTX
GDG Meets U event - Big data & Wikidata - no lies codelab
PPTX
Interaction with Linked Data
PPTX
The Semantic Web #10 - SPARQL
PDF
PPTX
Big Linked Data - Creating Training Curricula
PPTX
Saveface - Save your Facebook content as RDF data
PPTX
Hack U Barcelona 2011
Mon norton tut_queryinglinkeddata02
GDG Meets U event - Big data & Wikidata - no lies codelab
Interaction with Linked Data
The Semantic Web #10 - SPARQL
Big Linked Data - Creating Training Curricula
Saveface - Save your Facebook content as RDF data
Hack U Barcelona 2011

What's hot (20)

PPTX
RDFa Tutorial
PPTX
The Semantic Web #5 - RDF (2)
PPT
SPARQL in the Semantic Web
PPTX
4 sw architectures and sparql
PPTX
Lecture linked data cloud & sparql
PPTX
OWL: Yet to arrive on the Web of Data?
PDF
쉽게 이해하는 LOD
PPTX
The Semantic Web #4 - RDF (1)
PPTX
Linked data for librarians
PPTX
NISO/DCMI Webinar: Cooperative Authority Control: The Virtual International A...
PPTX
SWT Lecture Session 2 - RDF
PDF
Linked (Open) Data
PPTX
Publishing and Using Linked Open Data - Day 1
PDF
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
ODP
2010 06 ipaw_prv
PPTX
Linked Data for Libraries: Experiments between Cornell, Harvard and Stanford
PDF
The Semantics of SPARQL
PDF
Ontology, Semantic Web and DBpedia
PPT
Ontology Web services for Semantic Applications
PDF
Bio ontologies and semantic technologies
RDFa Tutorial
The Semantic Web #5 - RDF (2)
SPARQL in the Semantic Web
4 sw architectures and sparql
Lecture linked data cloud & sparql
OWL: Yet to arrive on the Web of Data?
쉽게 이해하는 LOD
The Semantic Web #4 - RDF (1)
Linked data for librarians
NISO/DCMI Webinar: Cooperative Authority Control: The Virtual International A...
SWT Lecture Session 2 - RDF
Linked (Open) Data
Publishing and Using Linked Open Data - Day 1
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2010 06 ipaw_prv
Linked Data for Libraries: Experiments between Cornell, Harvard and Stanford
The Semantics of SPARQL
Ontology, Semantic Web and DBpedia
Ontology Web services for Semantic Applications
Bio ontologies and semantic technologies
Ad

Viewers also liked (20)

PPTX
Querying Linked Data
PPTX
Usage of Linked Data: Introduction and Application Scenarios
PPTX
Mapping Relational Databases to Linked Data
PPTX
Microtask Crowdsourcing Applications for Linked Data
PPTX
Scaling up Linked Data
PPTX
Building Linked Data Applications
PDF
Datos malos, robots tristes
PDF
Sssc2011 ontologies final
PPTX
Online Learning and Linked Data: An Introduction
PPTX
Best Practices for Linked Data Education
PPTX
Speech Technology and Big Data
PDF
Creation of visualizations based on Linked Data
PDF
Visualizations using Visualbox
PDF
Web Techologies and Privacy policies for the Smart Grid
PPTX
Data Science Curriculum for Professionals
PPTX
Providing Linked Data
PDF
Ontologies in architecture, engineering and construction (AEC)
PPTX
Linked Data Tutorial
PPTX
Relational Database to RDF (RDB2RDF)
PPT
Interlinking Online Communities and Enriching Social Software with the Semant...
Querying Linked Data
Usage of Linked Data: Introduction and Application Scenarios
Mapping Relational Databases to Linked Data
Microtask Crowdsourcing Applications for Linked Data
Scaling up Linked Data
Building Linked Data Applications
Datos malos, robots tristes
Sssc2011 ontologies final
Online Learning and Linked Data: An Introduction
Best Practices for Linked Data Education
Speech Technology and Big Data
Creation of visualizations based on Linked Data
Visualizations using Visualbox
Web Techologies and Privacy policies for the Smart Grid
Data Science Curriculum for Professionals
Providing Linked Data
Ontologies in architecture, engineering and construction (AEC)
Linked Data Tutorial
Relational Database to RDF (RDB2RDF)
Interlinking Online Communities and Enriching Social Software with the Semant...
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
NewMind AI Weekly Chronicles - August'25 Week I
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Understanding_Digital_Forensics_Presentation.pptx
MYSQL Presentation for SQL database connectivity
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding

Querying Linked Data on Android

  • 1. Querying Linked Data on Android Module 2 adaptation for Android enabled devices 07.04.2014 1
  • 2. Outline • This document complements to webinar Module 2: Querying Linked Data • It targets querying linked data on mobile (Android) devices • Original queries modified to correspond to limited resources environments • Triple store implementation by Ontos AG (http:// www.ontos.com) 07.04.2014 2
  • 3. Webinar Structure • OntoQuad installation instructions • Deployment of preloaded dataset in OntoQuad • Running sample queries against the OntoQuad SPARQL endpoint 07.04.2014 3
  • 4. OntoQuad Installation • RDF store for Android • Detailed setup instructions already provided by Ontos AG (attached) • Fresh installations should be started at least once to initialize their data directory structures • OntoQuad should be completely stopped before deploying preloaded datasets (next slides) 07.04.2014 4
  • 5. Prebuild dataset deployment • Musicbrainz dataset extract – 5 million RDF triples subset – No special hardware requirements (<1GB external storage) – Sufficient deployment and query response times – Still representative for demonstration and educational purposes 07.04.2014 5
  • 6. Prebuild dataset setup • Download the binary files archive (musicbrainz-5m-bin.zip) on your PC • Extract the archive on the local file system – Important files and folders: ./vm, ./txlogs, .universe, .commands • Ensure OntoQuad in not active/running before performing the next steps 07.04.2014 6
  • 7. Prebuild dataset setup (2) • Connect the mobile device via appropriate USB cable to PC and overwrite the existing files in folder: /storage/extSdCard/margot/ with the ones from the archive • Disconnect the mobile device and start the OntoQuad server 07.04.2014 7
  • 8. Setup Verification • Start the Admin Console and select the SPARQL section (it will take some time) • Execute the following query: SELECT (COUNT(?s) as ?count) WHERE { ?s ?p ?o } • The result count value should be approximately 5 million 07.04.2014 8
  • 9. Module 2 for Android • Based on original Webinar Module 2 content • SPARQL queries adapted for the extracted data set and the current implementation limitations • Each query description refers to the original location in the Module 2 presentation 07.04.2014 9
  • 10. Module 2 for Android (2) • What albums did Queen make (slide 15) ? PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX mo: <http://purl.org/ontology/mo/> SELECT ?album WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album a mo:Release ; dc:title ?title } ORDER BY ?title 07.04.2014 10
  • 11. Module 2 for Android (3) • What albums and tracks did Queen make (slide 22) ? PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX mo: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album dc:title ?album_name ; mo:record ?record . ?record mo:track ?track . ?track dc:title ?track_title . } 07.04.2014 11
  • 12. Module 2 for Android (4) • Retrieve the albums and tracks recorded by Queen, where the duration of the song is more than 300 secs. and no longer than 400 secs (slide 23) PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX mo: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title ?duration WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album dc:title ?album_name ; mo:record ?record . ?record mo:track ?track . ?track dc:title ?track_title ; mo:duration ?duration; FILTER (?duration > 300000 && ?duration < 400000) } 07.04.2014 12
  • 13. Module 2 for Android (5) • Retrieve the name of the albums recorded by Queen which have at least two different songs (slide 24) PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX mo: <http://purl.org/ontology/mo/> SELECT DISTINCT ?album_name WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album dc:title ?album_name ; mo:record ?record . ?record mo:track ?track1 . ?record mo:track ?track2 . FILTER (?track1 != ?track2) } 07.04.2014 13
  • 14. Module 2 for Android (6) • Retrieve the duration of the albums recorded by Queen (slide 25) PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX mo: <http://purl.org/ontology/mo/> SELECT ?album ?album_name (SUM(?track_duration) AS ?album_duration) WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album mo:record ?record ; dc:title ?album_name. ?record mo:track ?track . ?track mo:duration ?track_duration . } GROUP BY ?album ?album_name HAVING (SUM(?track_duration) > 3600000) 07.04.2014 14
  • 15. Module 2 for Android (7) • Create the dc:creator descriptions for albums and their tracks recorded by Queen (slide 29)* PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX mo: <http://purl.org/ontology/mo/> PREFIX dc: <http://purl.org/dc/elements/1.1/> CONSTRUCT { ?album dc:creator ?band . ?track dc:creator ?band .} WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album mo:record ?record . ?record mo:track ?track . } *Note: CONSTRUCT queries might not work properly with the current implementation 07.04.2014 15
  • 16. Module 2 for Android (8) • Create the dc:creator descriptions of the albums recorded by Queen whose title contains the word 'rock’ (slide 31)* PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> CONSTRUCT { ?album dc:creator ?band } WHERE { ?band foaf:name "Queen" . ?band foaf:made ?album . ?album dc:title ?album_name . FILTER (REGEX(?album_name, ".*rock.*", "i")) } *Note: CONSTRUCT queries might not work properly with the current implementation 07.04.2014 16
  • 17. Module 2 for Android Thank you! 07.04.2014 17