How to hide logging
cthoyt opened this issue · 3 comments
cthoyt commented
sers/rdfxml.py:286: SyntaxWarning: <Element '{http://www.w3.org/2000/01/rdf-schema#}label' at 0x13c7a3e50> contains text but no `xsd:datatype`
meta.annotations.add(self._extract_literal_pv(child))
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:286: SyntaxWarning: <Element '{http://protege.stanford.edu/plugins/owl/protege#}defaultLanguage' at 0x13c7a3040> contains text but no `xsd:datatype`
meta.annotations.add(self._extract_literal_pv(child))
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13c8196d0>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13deded60>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13dede810>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13dedeef0>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13dede630>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:113: SyntaxWarning: unknown element in `owl:ObjectProperty`: <Element '{http://www.w3.org/2004/02/skos/core#}definition' at 0x13d16f6d0>
self._extract_object_property(prop, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:117: SyntaxWarning: unknown element in `owl:Class`: {http://www.w3.org/2004/02/skos/core#}definition
self._extract_term(class_, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:117: SyntaxWarning: unknown element in `owl:Class`: {http://www.w3.org/2004/02/skos/core#}altLabel
self._extract_term(class_, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/parsers/rdfxml.py:117: SyntaxWarning: unknown element in `owl:Class`: {http://www.w3.org/2002/07/owl#}disjointUnionOf
self._extract_term(class_, curies)
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/ontology.py:283: SyntaxWarning: unknown axiom property: 'http://www.w3.org/2000/01/rdf-schema#seeAlso'
cls(self).parse_from(_handle) # type: ignore
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/ontology.py:283: SyntaxWarning: unknown axiom property: 'http://www.w3.org/2004/02/skos/core#altLabel'
cls(self).parse_from(_handle) # type: ignore
/Users/cthoyt/.virtualenvs/indra/lib/python3.9/site-packages/pronto/ontology.py:283: SyntaxWarning: unknown axiom property: 'http://www.w3.org/2000/01/rdf-schema#label'
cls(self).parse_from(_handle) # type: ignore
I'm getting all of this output, and I think it's just warnings since the program continues. How can I suppress it? Unfortunately this looks like it's using the warn
module instead of logging
so it's much more tricky to configure
althonos commented
Everything being a warning, you can just disable them with the warnings.filterwarnings
function:
import warnings
import pronto
warnings.filterwarnings("ignore", category=pronto.warnings.SyntaxWarning, module="pronto")
cthoyt commented
Great, thanks! I'd suggest putting that straight in the readme :)
althonos commented
Done 👍