I ve created an ontology for a tourism application...i ve created in d manner that under the superclass THING activity(is a class) ->Shopping(subclass of activity) ->SpencerPlaza(is a member/individual) Destination (is a class) -> city (subclass of Destination) ->Chennai (is a member/individual) ->Madurai(is a member/individual) now in object property assertion for chennai i ve added that hasPart SpencerPlaza.. i need to know how to write a query to display al the shopping malls in chennai...I'm using TopBraid Composer-ME

# baseURI: http://www.w3.org/2002/07/owl
@prefix :        <http://www.w3.org/2002/07/owl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> 
@prefix tour:    <http://www.tour.com/ontologies/tour.owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
tour:Chennai rdf:type owl:NamedIndividual , tour:City ;

tour:ChennaiCitiCentre , tour:PrincePlaza , tour:Freemasonshall ,
tour:CenturyPlaza , tour:AbiramiMegaMall , tour:SpencerPlaza , tour:SkywalkMall , 
tour:ChennaiCitiCentre rdf:type tour:ShoppingMalls , owl:NamedIndividual .

is this detail is enough sir......

asked 01 Feb '13, 05:16

nivi's gravatar image

accept rate: 0%

edited 02 Feb '13, 13:54

harschware's gravatar image

harschware ♦


Welcome nivi. Please take a look at this note for newcommers: http://answers.semanticweb.com/questions/14494/welcome-to-answerssemanticwebcom. Your question is unreadable. Please try to format it properly, using the edit button. Take a look at the syntax http://answers.semanticweb.com/markdown_help/

(01 Feb '13, 06:53) Antoine Zimm... ♦ Antoine%20Zimmermann's gravatar image

You've asked to show you how to get shopping malls but your data doesn't have any. Can you go to File->Export under TopBraid Composer choose Export/Merge RDF Graphs. Choose Turtle as your output format and post it here.

(01 Feb '13, 23:59) harschware ♦ harschware's gravatar image

Your data is a little fragmented, perhaps you forgot to include your whole model. But, essentially what you need is some predicate to link Shopping Malls to their City. For instance if your data included the statement:

tour:ChennaiCitiCentre tour:ShoppingMallLocatedIn  tour:Chennai .

Then you could write SPARQL query to find all Shopping Malls in a given City. e.g.

SELECT ?mall
    ?mall rdf:type tour:ShoppingMalls ;
          tour:ShoppingMallLocatedIn tour:Chennai .

A few things to notice.

  • The result would be "tour:ChennaiCitiCentre" for ?mall
  • See how the SPARQL query looks a lot like the Turtle representation?
  • I omitted defining tour:ShoppingMallLocatedIn as a predicate with ShoppingMalls in the domain. But for completeness you may want to.
permanent link

answered 02 Feb '13, 14:02

harschware's gravatar image

harschware ♦
accept rate: 20%

i tried to execute the query as u told it didnt show any error at the same time no results are displayed.... SELECT ?mall { ?mall rdf:type tour:ShoppingMalls ; tour:hasPart tour:Chennai . } 'hasPart' is the object property i used in my ontology...what would be the mistake in query execution....

(03 Feb '13, 12:44) nivi nivi's gravatar image

As I said, your data is fragmented. If you want me to continue to guess you should post your whole ontology, or a small self contained correct example ( see http://sscce.org ). The example has to be correct. I suspect you did not assert "something hasPart Chennai". Or the something would come back for ?mall. Remove this "?mall rdf:type tour:ShoppingMalls" from the query and try again with haspart.

(03 Feb '13, 20:02) harschware ♦ harschware'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: 01 Feb '13, 05:16

question was seen: 2,119 times

last updated: 03 Feb '13, 20:02