RDFLib / OWL-RL

A simple implementation of the OWL2 RL Profile on top of RDFLib: it expands the graph with all possible triples that OWL RL defines. It can be used together with RDFLib to expand an RDFLib Graph object, or as a stand alone service with its own serialization.
http://www.ivan-herman.net/Misc/2008/owlrl/
Other
144 stars 30 forks source link

UserWarning: Code: <SomeCode> is not defined in namespace XSD with rdflib 6.0.0 #44

Closed tcmitchell closed 2 years ago

tcmitchell commented 3 years ago

After installing owlrl, either alone or via installing pyshacl, a user is presented with a series of warnings on import:

Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import owlrl
RDFLib Version: 6.0.0
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/__init__.py:177: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from . import DatatypeHandling, Closure
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: length is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: maxExclusive is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: maxInclusive is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: maxLength is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: minExclusive is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: minInclusive is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: minLength is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/RDFSClosure.py:40: UserWarning: Code: pattern is not defined in namespace XSD
  from owlrl.AxiomaticTriples import RDFS_Axiomatic_Triples, RDFS_D_Axiomatic_Triples
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/OWLRL.py:53: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from .XsdDatatypes import OWL_RL_Datatypes, OWL_Datatype_Subsumptions
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/OWLRLExtras.py:64: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from .RestrictedDatatype import extract_faceted_datatypes
>>> owlrl.__version__
'5.2.1'

These warnings are the result of the 6.0.0 release of rdflib.

The warnings are particularly bothersome when attempting to run pyshacl (https://github.com/RDFLib/pySHACL) at the command line (shortened below):

$ pyshacl
/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/__init__.py:177: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from . import DatatypeHandling, Closure

[Many warnings removed]

/Users/tmitchel/Projects/sd2/pySBOL3/venv3/lib/python3.8/site-packages/owlrl/OWLRLExtras.py:64: UserWarning: Code: dateTimeStamp is not defined in namespace XSD
  from .RestrictedDatatype import extract_faceted_datatypes
usage: pyshacl [-h] [-s [SHACL]] [-e [ONT]] [-i {none,rdfs,owlrl,both}] [-m] [-im] [-a] [-j] [-it] [--abort] [-w] [-d]
               [-f {human,turtle,xml,json-ld,nt,n3}] [-df {auto,turtle,xml,json-ld,nt,n3}] [-sf {auto,turtle,xml,json-ld,nt,n3}]
               [-ef {auto,turtle,xml,json-ld,nt,n3}] [-V] [-o [OUTPUT]]
               DataGraph
pyshacl: error: the following arguments are required: DataGraph

Can something be done about these warnings?

ajnelson-nist commented 3 years ago

I also noticed this spring up a couple weeks ago.

tcmitchell commented 2 years ago

These warnings no longer appear when using owlrl version 5.2.3 and rdflib 6.0.2. I think this issue can be closed. I don't know what change fixed this issue or in what version(s) it was fixed.

ashleysommer commented 2 years ago

@tcmitchell Thats right. Rdflib v6.0.2 added the required XSD properties.