I tried to define enumerated datatypes within Protege 4 with no success. Trying for example to insert manually this code in the owl file :

<owl:datatypeproperty rdf:id="tennisGameScore"> <rdfs:range> <owl:datarange> <owl:oneof> <rdf:list> <rdf:first rdf:datatype="&amp;xsd;integer">0</rdf:first> <rdf:rest> <rdf:list> <rdf:first rdf:datatype="&amp;xsd;integer">15</rdf:first> <rdf:rest> <rdf:list> <rdf:first rdf:datatype="&amp;xsd;integer">30</rdf:first> <rdf:rest> <rdf:list> <rdf:first rdf:datatype="&amp;xsd;integer">40</rdf:first> <rdf:rest rdf:resource="&amp;rdf;nil"/> </rdf:list> </rdf:rest> </rdf:list> </rdf:rest> </rdf:list> </rdf:rest> </rdf:list> </owl:oneof> </owl:datarange> </rdfs:range> </owl:datatypeproperty>

this part is ignored when the file is reloaded into Protege.

Has somebody found a solution to that problem ?



asked 03 May '11, 09:34

Laurent%20Pierre's gravatar image

Laurent Pierre
accept rate: 0%

OWL is case sensitive... is the capitalisation of your terms correct in the data? I.e., DatatypeProperty, oneOf, `DataRange?

Oh yep, and RDF/XML may be horrible, but it does have shortcuts for lists: http://www.w3.org/TR/REC-rdf-syntax/#section-Syntax-parsetype-Collection :)

(03 May '11, 10:51) Signified ♦ Signified's gravatar image

Hey Laurent, if you're happy with your answer, please remember to accept! ;)

(03 May '11, 11:13) Signified ♦ Signified's gravatar image


<owl:DatatypeProperty rdf:ID="tennisGameScore">
    <owl:oneOf rdf:parseType="Resource">
      <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
      <rdf:rest rdf:parseType="Resource">
        <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
        <rdf:rest rdf:parseType="Resource">
          <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
          <rdf:rest rdf:parseType="Resource">
            <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
            <rdf:rest rdf:parseType="Resource">
              <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">
              <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>

..or the much, much better Turtle syntax:

   a       owl:DatatypeProperty ;
   rdfs:label "tennis game score"^^xsd:string ;
          [ a       rdfs:Datatype ;
            owl:oneOf (0 1 15 30 40)
          ] .
permanent link

answered 03 May '11, 09:52

scotthenninger's gravatar image

scotthenninger ♦
accept rate: 17%

edited 04 May '11, 19:16

I tried both owl and Turtle syntax but Protege does not seem to notice :(

(03 May '11, 10:26) Laurent Pierre Laurent%20Pierre's gravatar image

In facts it works, you have to reload the file manually instead of counting on Protege automatic reload.

Thanks a lot

(03 May '11, 10:56) Laurent Pierre Laurent%20Pierre's gravatar image

I've just realized that I was posting answers instead of commenting. Sorry

(03 May '11, 11:00) Laurent Pierre Laurent%20Pierre's gravatar image

Accepted on behalf of OP ;)

(04 May '11, 23:56) Signified ♦ Signified'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: 03 May '11, 09:34

question was seen: 3,612 times

last updated: 04 May '11, 23:56