Upload
api-19981384
View
145
Download
1
Embed Size (px)
Citation preview
DUAONTOLOGYDUAONTOLOGY
By Amna Basharat
Taxonomy
DuaDua
Qurani Duas Masnoon DuasQurani Duas Masnoon Duas
DuasTo Seek K l d DuasToSeekParadise
FAST – NU, Islamabad, Fall 2008
Knowledge DuasToSeekParadise ….
RDF Model of Duas
containsDua isRelatedTo
DuaSurahProphet
isRelatedTo
isContainedInhasRelatedDua
hasTheme
Theme
FAST – NU, Islamabad, Fall 2008
SAMPLE SPARQLQUERIESSAMPLE SPARQLQUERIES
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
SAMPLE SPARQL QUERIESSAMPLE SPARQL QUERIES
é éTested with Protégé 3.3.1
PizzaOntology
Querying for Classes
FAST – NU, Islamabad, Fall 2008
SELECT ?subject ?objectWHERE { ?subject rdfs:subClassOf ?object }
FAST – NU, Islamabad, Fall 2008
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
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
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
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
Dua Ontology
Querying on Instance Data
FAST – NU, Islamabad, Fall 2008
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
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
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
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
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
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
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
}
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
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
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