I'm trying to build a very simlpe ontology to represent an RPG game with protege and owl.
I'm fairly new to ontologies so probably I'm not really getting many things (for example, the open world assumption I suppose).

Here you can download it -> LINK

There are two type of unit classes, enchanters and melee fighters.
Enchanters are split in arcane magic and divine magic.
Spells are divided in 4 schools (evocation, healing, elemental, protection).
Arcane magic enchanters can use only elemental and evocation spells, divine magic enchanters only the other two.
Units can have a single class.
Units, spells and unit classes are individuals.

There are a number of queries that I'd like to execute but do not return anything, for example:

  1. canCast some ArcaneMagicSpell
    Expected: List of unit classes that can cast arcane spells.
    Returns: The unit classes, but I also want the units (individuals).

  2. canCast value SpellFireball
    Expected: List of unit classes that can cast fireballs.
    Returns: Nothing.

  3. canBeCastedBy some ArcaneMagicClass
    Expected: All spells castable by an arcane mage.
    Returns:: Nothing.

  4. canBeCastedBy value UnitClassBlackMage
    Expected: All spells that a black mage can cast.
    Returns: Nothing.

  5. hasClass some (canCast some Spell) Expected: All the unit that can cast a particular spell.
    Returns: Nothing.

I'm obviously doing something wrong here but I really don't get it. How can improve my ontology to support those queries (or better formed queries to get the same expected results)?

asked 30 Nov '12, 10:23

%E3%82%AD%E3%82%AD%E3%82%B8%E3%82%AD's gravatar image

accept rate: 0%

edited 30 Nov '12, 12:21

Hi - Welcome!

Interesting project!

I presume that you're using the DL query editor in protege 4. If you look to the right side of the results box, there are a number of boxes that you can check to include equivalent classes / subclasses / individuals etc. in the result - checking some of these will help with your query.

I presume that you are also aware of the SPARQL query language? It tends to be more useful for querying - with the DL query tab better for experimenting with generating OWL classes.

The modelling could probably be improved in places eg. Modelling the individuals as direct types (using rdf:type) rather than stating that they ex:haveClass (then we can make Black Mages a Class). Makes queries a bit easier. Similarly theres no need to have a class of "specific spells" - you can model them as individuals of whatever type (this will happen anyways when the inferencer is run). eg. http://pastebin.com/QBAh7hcB

(Open world assumption - try to read as many explanations of it as you can and it will click - the concept of OWL being a licence for inference rather than constraints on data made it (reasonably) clear for me. There's some quite good assumptions on the site - also - http://semanticweb.com/introduction-to-open-world-assumption-vs-closed-world-assumption_b33688 has a nice example)

permanent link

answered 01 Dec '12, 05:40

Sweet%20Burlap's gravatar image

Sweet Burlap
accept rate: 19%

edited 01 Dec '12, 11:53

Thank you, actually I already had those options checked. I made some modifications and results are getting better. I was planning to use SPARQL but, I had some doubts about if you can query also the inferred ontology. Also, I need to make a query from inside c++ code is there a good library for this? I could find rasqal and fact++ but they seem to do different things.

(01 Dec '12, 11:12) キキジキ %E3%82%AD%E3%82%AD%E3%82%B8%E3%82%AD's gravatar image

the sparql support in protege is new, and still doesn't seem to be working properly (especially with querying inferred axioms). If you want to query it properly in SPARQL you would be well off loading the ontology into a triplestore that supports inferencing eg. stardog, virtuoso etc. c++ I have no idea about, but C++ is for infering rather than querying, rasqal seems to support querying

(01 Dec '12, 13:12) Sweet Burlap Sweet%20Burlap's gravatar image

I see. So it could be something like 【base ontology】→fact++ reasoner→【infered ontology】→query with rasqal. Looks interesting.. but may be also a hell, I don't know.

(01 Dec '12, 15:48) キキジキ %E3%82%AD%E3%82%AD%E3%82%B8%E3%82%AD's gravatar image

yep. although many triplestores will take care of (some of) the inference for you (Stardog is from Clark and Parsia - the same guys who made Pellet reasoner in Protege). Also SPARQL are relatively easy to write as HTTP requests, that returns XML/JSON etc if you prefer that method to rasqal

(02 Dec '12, 00:36) Sweet Burlap Sweet%20Burlap'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: 30 Nov '12, 10:23

question was seen: 2,445 times

last updated: 02 Dec '12, 00:36