dua ontology - sample queries

23
DUA ONTOLOGY DUA ONTOLOGY By Amna Basharat

Upload: api-19981384

Post on 18-Nov-2014

143 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DUA Ontology - Sample Queries

DUAONTOLOGYDUAONTOLOGY

By Amna Basharat

Page 2: DUA Ontology - Sample Queries

Taxonomy

DuaDua

Qurani Duas Masnoon DuasQurani Duas Masnoon Duas

DuasTo Seek K l d DuasToSeekParadise

FAST – NU, Islamabad, Fall 2008

Knowledge DuasToSeekParadise ….

Page 3: DUA Ontology - Sample Queries

RDF Model of Duas

containsDua isRelatedTo

DuaSurahProphet

isRelatedTo

isContainedInhasRelatedDua

hasTheme

Theme

FAST – NU, Islamabad, Fall 2008

Page 4: DUA Ontology - Sample Queries

SAMPLE SPARQLQUERIESSAMPLE SPARQLQUERIES

Page 5: DUA Ontology - Sample Queries

Search Duawith a Particular Theme

PREFIX dua: htt // ti b / t l i /<http://www.semanticweb.org/ontologies/2

008/9/DuaOntology.owl#>

SELECT ?D ?themeWHERE { ?D dua:hasTheme ?theme.}

FAST – NU, Islamabad, Fall 2008

Page 6: DUA Ontology - Sample Queries

SAMPLE SPARQL QUERIESSAMPLE SPARQL QUERIES

é éTested with Protégé 3.3.1

Page 7: DUA Ontology - Sample Queries

PizzaOntology

Querying for Classes

FAST – NU, Islamabad, Fall 2008

Page 8: DUA Ontology - Sample Queries

SELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf ?object }

FAST – NU, Islamabad, Fall 2008

Page 9: DUA Ontology - Sample Queries

PREFIX p: <http://www.co‐d / t l i / i / / / 8/ iode.org/ontologies/pizza/2005/10/18/pizza.o

wl#>SELECT ? bj t ? bj tSELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf ?object }

FAST – NU, Islamabad, Fall 2008

Page 10: DUA Ontology - Sample Queries

PREFIX p: <http://www.co‐d / t l i / i / / / 8/ iode.org/ontologies/pizza/2005/10/18/pizza.o

wl#>SELECT ? bj t ? bj tSELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf p:Pizza}

FAST – NU, Islamabad, Fall 2008

Page 11: DUA Ontology - Sample Queries

PREFIX p: <http://www.co‐d / t l i / i / / / 8/ iode.org/ontologies/pizza/2005/10/18/pizza.o

wl#>SELECT ? bj t ? bj tSELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf Pi T ip:PizzaTopping.

}

FAST – NU, Islamabad, Fall 2008

Page 12: DUA Ontology - Sample Queries

PREFIX p: <http://www.co‐ode org/ontologies/pizza/2005/10/18/pizza oode.org/ontologies/pizza/2005/10/18/pizza.owl#>SELECT ?subject ?objectSELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf p:DomainConcept.p p?subject owl:disjointWith ?object.

}

FAST – NU, Islamabad, Fall 2008

Page 13: DUA Ontology - Sample Queries

Dua Ontology

Querying on Instance Data

FAST – NU, Islamabad, Fall 2008

Page 14: DUA Ontology - Sample Queries

List all Duas with Corresponding themes

PREFIX dua: htt // ti b / t l i /<http://www.semanticweb.org/ontologies/2

008/9/DuaOntology.owl#>

SELECT ?D ?themeWHERE { ?D dua:hasTheme ?theme.}

FAST – NU, Islamabad, Fall 2008

Page 15: DUA Ontology - Sample Queries

Example: List of Duas, their Themes which are contained in Surah Taha

PREFIX dua: htt // ti b / t l i /<http://www.semanticweb.org/ontologies/20

08/9/DuaOntology.owl#>

SELECT ?D ?themeWHERE { ?D dua:hasTheme ?theme.?D dua:hasSourceSurah dua:Taha. }

FAST – NU, Islamabad, Fall 2008

Page 16: DUA Ontology - Sample Queries

List of All Dua’s which have some Theme and have some source Surah

PREFIX dua: htt // ti b / t l i /<http://www.semanticweb.org/ontologies/20

08/9/DuaOntology.owl#>

SELECT ?D ?theme ?surahWHERE { ?D dua:hasTheme ?theme.

?D dua:hasSourceSurah ?surah.}

FAST – NU, Islamabad, Fall 2008

Page 17: DUA Ontology - Sample Queries

PREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.owl#>

SELECT ?D ?theme ?surah ?no

WHERE { ?D dua:hasTheme ?themeWHERE { ?D dua:hasTheme ?theme.?D dua:hasSourceSurah ?surah .

?surah dua:hasSurahNo ?no?surah dua:hasSurahNo ?no.

}}ORDER BY ?no

FAST – NU, Islamabad, Fall 2008

Page 18: DUA Ontology - Sample Queries

PREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.owl#>

SELECT ?D ?theme ?surah ?no ?ayah

WHERE { ?D dua:hasTheme ?themeWHERE { ?D dua:hasTheme ?theme.?D dua:hasSourceSurah ?surah ;

dua:hasSourceAyah ?ayah.?surah dua:hasSurahNo ?no?surah dua:hasSurahNo ?no.

}}ORDER BY ?no

FAST – NU, Islamabad, Fall 2008

Page 19: DUA Ontology - Sample Queries

Notice the change in results with the use of OPTIONALof OPTIONAL

PREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.owl#>

SELECT ?D ?theme ?surah ?no ?ayah

WHERE{ ?D dua:hasTheme ?theme.?D dua:hasSourceSurah ?surah.

?surah dua:hasSurahNo ?no.

OPTIONAL{     ?D dua:hasSourceAyah ?ayah.

}}ORDER BY ?no

FAST – NU, Islamabad, Fall 2008

Page 20: DUA Ontology - Sample Queries

Use of Regular Expression to retrieve duas that contain the word Rabbithat contain the word RabbiPREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.

lowl#>

SELECT ?D ?surah ?no ?text

WHERE{ ?D dua:hasSourceSurah ?surah?D dua:hasSourceSurah ?surah.?D dua:hasTextAyah ?text.

FILTER regex(?text,  "Rabbi") .

?surah dua:hasSurahNo ?no.

FAST – NU, Islamabad, Fall 2008

}

Page 21: DUA Ontology - Sample Queries

Use of Regular Expression to retrieve duas that contain the word Rabbanathat contain the word Rabbana

PREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.owl#>

SELECT ?D ?surah ?no ?text

WHERE{ WHERE{ ?D dua:hasSourceSurah ?surah.

?D dua:hasTextAyah ?text.FILTER regex(?text   "Rabbana") FILTER regex(?text,   Rabbana ) .

?surah dua:hasSurahNo ?no.

}

FAST – NU, Islamabad, Fall 2008

Page 22: DUA Ontology - Sample Queries

AN interesting Query!. …Think about what it does!what it does!

PREFIX dua: <http://www.semanticweb.org/ontologies/2008/9/DuaOntology.owl#>

SELECT ?Dua  ?DuaOther ?surah2

WHERE{ WHERE{ ?Dua dua:hasSourceSurah dua:Taha.?Dua dua:isRelatedTo ?p.?DuaOther dua:isRelatedTo ?p?DuaOther dua:isRelatedTo ?p.?DuaOther dua:hasSourceSurah ?surah2.

}}

FAST – NU, Islamabad, Fall 2008

Page 23: DUA Ontology - Sample Queries

Find other Duas related to the same  prophet in a given Surahprophet in a given Surah

� “Find other duas related with the prophet of a given surah ”given surah.

FAST – NU, Islamabad, Fall 2008