I have an anthology made with protege about Questions, question have a DatatypeProperty Option and Key where option are the options of a Multiple choice question and key is the correct answer.

My question is how can i create a link between the Key and the Option means Option A is the key of the question

thanks

asked 20 Nov '12, 20:30

Ibrahim%20Koubeissy's gravatar image

Ibrahim Koub...
313
accept rate: 0%


Firstly consider the types of things you are dealing with: "Question"s, "AnswerChoices"s and "CorrectAnswerChoice"s*. These things could each be modeled as classes.

Next consider the relationships between them. "Question"s can have several "AnswerChoice"s, so well need an Object Property "hasChoice" to represent this. "Question"s will also have one or several "CorrectAnswerChoice"s, so well need an Object Property "hasCorrectChoice" to represent this - this can be modelled as a subPropertyOf "hasChoice".

Also - we might want to specify data about the question eg. the text of the question or answer - we can potentially use rdfs:label for this.

*(It might be worthwhile not having a "CorrectAnswerChoice" because if you reuse the Answers in different Questions what is correct for one Question might not be correct for another it was reused for - the correctness of an answer would probably be better modeled as a property. Although it wouldnt matter so much if each Answer was used in only one question)

If the question was more of a technical protege one - create the ontology above. create an individual question "What is the capital city of USA", and some individual Answers "New York", "Los Angeles", "California" and "Washington D.C.". Select the question individual and Add object property assertions and add "hasChoice" to each of the choices, then add a "hasCorrectChoice" to "Washington D.C.".

link

answered 21 Nov '12, 07:05

Sweet%20Burlap's gravatar image

Sweet Burlap
2.7k38
accept rate: 18%

You need something else than a datatype property. For instance (in Turtle):

<Question>  a  owl:Class .
<Option>  a  owl:Class .
<Key>  a  owl:Class;
    rdfs:subClassOf  <Option> .
<hasOption>  a  owl:ObjectProperty;
    rdfs:domain  <Question>;
    rdfs:range  <Option> .
<hasKey>  a  owl:ObjectProperty;
    rdfs:subPropertyOf  <hasOption>;
    rdfs:range  <Key> .

Then you can use this in the following way:

<question1>  a  <Question>;
    rdfs:label  "Protege DatatypePropertyLink"@en;
    rdfs:comment  """I have an anthology made with protege about Questions, question have a DatatypeProperty Option and Key where option are the options of a Multiple choice question and key is the correct answer.

My question is how can i create a link between the Key and the Option means Option A is the key of the question

thanks"""@en;
    <hasOption>  [ rdfs:label "You cannot do that."@en ];
    <hasOption>  [ rdfs:label "You must use a relational database."@en ];
    <hasKey>     [ rdfs:label "You need something else than a datatype property."@en ] .

But it's not the only option!

link

answered 21 Nov '12, 07:09

Antoine%20Zimmermann's gravatar image

Antoine Zimm... ♦
9.5k514
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×535
×170

Asked: 20 Nov '12, 20:30

Seen: 3,055 times

Last updated: 21 Nov '12, 07:09