|
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 |
|
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.". |
|
You need something else than a datatype property. For instance (in Turtle):
Then you can use this in the following way:
But it's not the only option! |

