Getting values from rdf list

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting values from rdf list

kleegrewec
The ontology I am currently working with contains some enumeration datatypes defined the following way:

  <rdfs:Datatype rdf:about="http://my.ontology.com/plm/production/isa95#scheduleStateEnum">
    <owl:equivalentClass>
      <rdfs:Datatype>
        <owl:oneOf>
          <rdf:List>
            <rdf:rest>
              <rdf:List>
                <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
                <rdf:first>Released</rdf:first>
              </rdf:List>
            </rdf:rest>
            <rdf:first>Forcast</rdf:first>
          </rdf:List>
        </owl:oneOf>
      </rdfs:Datatype>
    </owl:equivalentClass>
  </rdfs:Datatype>


Now I want to derieve the list values (Released / Forcast) from the DataType using the owlready2 python module but cannot find a way to access them. Could you please send some advice how to access the values from the list.

thanks a lot, Christian
Reply | Threaded
Open this post in threaded view
|

Re: Getting values from rdf list

Jiba
Administrator
Hi,

Enumerated datatypes were not yet supported in Owlready, but I've just added some basic support in the development version on BitBucket.

With that version, you can access the enumerated datatype as follows:

>>> print(onto.scheduleStateEnum.equivalent_to[0].instances)
["Forcast", "Released"]

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Getting values from rdf list

kleegrewec
Hi Jiba,

thanks for your support. I will check this out.

best regards, Christian