ValueError: Cannot read literal od datatype 'x'!

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

ValueError: Cannot read literal od datatype 'x'!

Dumas Anthony
Hi,

When i'm iterating on a value property, i get this error on datatype DateTimeStamp.

Traceback (most recent call last):
  File "parsing_ontology.py", line 126, in <module>
    for value in p[i]:
  File "/usr/lib/python3.6/site-packages/owlready2/property.py", line 256, in __getitem__
    values = getattr(individual, Prop.python_name)
  File "/usr/lib/python3.6/site-packages/owlready2/individual.py", line 231, in __getattr__
    values = [self.namespace.ontology._to_python(o) for o in self.namespace.world.get_triples_sp(self.storid, Prop.storid)]
  File "/usr/lib/python3.6/site-packages/owlready2/individual.py", line 231, in <listcomp>
    values = [self.namespace.ontology._to_python(o) for o in self.namespace.world.get_triples_sp(self.storid, Prop.storid)]
  File "/usr/lib/python3.6/site-packages/owlready2/namespace.py", line 120, in _to_python
    elif o.startswith('"'): return from_literal(o)
  File "/usr/lib/python3.6/site-packages/owlready2/base.py", line 56, in from_literal
    if datatype is None: raise ValueError("Cannot read literal of datatype '%s'!" % l[1:])
ValueError: Cannot read literal of datatype 'x'!

my code is :

for c in onto.classes():
    for i in c.instances():
        for p in i.get_properties():
            for value in p[i]:                      <== error here
                print("-----------------------" + str(p) + " => " + str(value))

Is DataTimeStamp not supported in OWLREADY2 2.0.5 ?

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Cannot read literal od datatype 'x'!

Jiba
Administrator
Hi,

Owlready2 currently has support for the following time-related datatypes:

http://www.w3.org/2001/XMLSchema#dateTime
http://www.w3.org/2001/XMLSchema#date
http://www.w3.org/2001/XMLSchema#time

(although they have not been widely tested)

However, I fear that DateTimeStamp is a different time-related datatypes, so it is probably not supported yet.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: ValueError: Cannot read literal od datatype 'x'!

Dumas Anthony
Hello,

Thanks for your answer.