i ve created an ontology which provides information about all the tourist spots in TamilNadu using protege 4.2 beta and in that i ve created a class named 'destination' and the subclasses to that class are 'city','hill stations' and 'temple towns'...The RDF/XML data is

<?xml version="1.0"?>
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY tour "http://www.tour.com/ontologies/tour.owl#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >

<rdf:RDF xmlns="http://www.w3.org/2002/07/owl#"
    <Ontology rdf:about="http://www.tour.com/ontologies/tour.owl">
        <rdfs:comment>An ontology for Tamilnadu tourism that provides necessary information regarding various tourist spots,accomodation and transportation.

  <!-- http://www.tour.com/ontologies/tour.owl#City -->

    <Class rdf:about="&tour;City">
        <rdfs:subClassOf rdf:resource="&tour;Destination"/>
        <disjointWith rdf:resource="&tour;HillStation"/>
        <disjointWith rdf:resource="&tour;TempleTown"/>

 <!-- http://www.tour.com/ontologies/tour.owl#HillStation -->

    <Class rdf:about="&tour;HillStation">
        <rdfs:subClassOf rdf:resource="&tour;Destination"/>
        <disjointWith rdf:resource="&tour;TempleTown"/>

    <!-- http://www.tour.com/ontologies/tour.owl#TempleTown -->

    <Class rdf:about="&tour;TempleTown">
        <rdfs:subClassOf rdf:resource="&tour;Destination"/>

under the subclass 'city' i ve added members namely 'Chennai','Madurai','Coimbatore'...i need to know how to write queries to retrieve the members from the subclass 'city'

asked 27 Jan '13, 07:09

nivi's gravatar image

accept rate: 0%

edited 28 Jan '13, 14:07

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦

"can any explain" -- no -- insufficient information to provide a useful answer.

Please give a complete, minimal example of what you have tried.

"its not working" and "not providing results" don't tell us anything.

(27 Jan '13, 08:12) AndyS ♦ AndyS's gravatar image

sir, i ve created an ontology for tourism application which provides information regarding all the sight seeing places in tamilnadu.... i ve created a class named "hillstations" in that ooty,kodaikanal are added as "members"..now my question is if i want to retrieve those hillstations name alone.. how the query ve to be written sir..

(27 Jan '13, 08:53) nivi nivi's gravatar image

nivi, if you'd like to receive help, please add to your question an example of the data that you've created (if you can show it in Turtle or in RDF/XML that would be great), an example of the query you've tried to write, and the results you're hoping to get back from the query.

(27 Jan '13, 10:03) lee lee's gravatar image

"complete, minimal example" means (1) data+query (2) reduced to something that asks the question without a lot of other stuff. What have you tried? What happened? What did you want to happen?

(27 Jan '13, 10:05) AndyS ♦ AndyS's gravatar image

A query to retrieve instances from a class ex:X is simply this:

    ?i a ex:X .

I suggest you try and adapt this to fit your needs, and also that you look up a SPARQL tutorial to get a feeling for how it works, so that you can start experimenting on your own with more complex queries, if needed.

Edit I think you need to start at the beginning and work your way through a good SPARQL tutorial first. There's some excellent suggestions for tutorials here and here . Or get a copy of the excellent book 'Learning SPARQL'.

permanent link

answered 28 Jan '13, 14:14

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
accept rate: 37%

edited 30 Jan '13, 14:30

still am confused that what does ex:X mean whether the combination of class:subclass or prefix of OWL:class or prefix of OWL:subclass

(29 Jan '13, 05:02) nivi nivi's gravatar image

@nivi, I think you need to start at the beginning and work your way through a good SPARQL tutorial first. I've added some suggestions to the answer for you to check out.

(30 Jan '13, 14:22) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

i tried for those tutorials and i solved d query and got results....thanks a lot...

(01 Feb '13, 01:08) nivi nivi's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 Jan '13, 07:09

question was seen: 1,002 times

last updated: 01 Feb '13, 01:08