Harold-Solbrig / funowl

Pythonic representation of OWL through the OWL functional syntax
Creative Commons Zero v1.0 Universal
50 stars 5 forks source link

parser throws TypeError if literals contain carriage returns #45

Open cmungall opened 2 years ago

cmungall commented 2 years ago

See attached file

cr.ofn.txt

parser fails with:

  File "/Users/cjm/Library/Caches/pypoetry/virtualenvs/schema-automator-AOPna4Zq-py3.9/lib/python3.9/site-packages/funowl/base/cast_function.py", line 148, in cast
    raise TypeError(f"Type mismatch between {v} (type: {type(v)} and {type_list}")
TypeError: Type mismatch between 
  This ontology partially describes the built-in classes and
  properties that together form the basis of the RDF/XML syntax of OWL 2.
  The content of this ontology is based on Tables 6.1 and 6.2
  in Section 6.4 of the OWL 2 RDF-Based Semantics specification,
  available at http://www.w3.org/TR/owl2-rdf-based-semantics/.
  Please note that those tables do not include the different annotations
  (labels, comments and rdfs:isDefinedBy links) used in this file.
  Also note that the descriptions provided in this ontology do not
  provide a complete and correct formal description of either the syntax
  or the semantics of the introduced terms (please see the OWL 2
  recommendations for the complete and normative specifications).
  Furthermore, the information provided by this ontology may be
  misleading if not used with care. This ontology SHOULD NOT be imported
  into OWL ontologies. Importing this file into an OWL 2 DL ontology
  will cause it to become an OWL 2 Full ontology and may have other,
  unexpected, consequences.
    (type: <class 'rdflib.term.Literal'> and [<class 'funowl.annotations.AnnotationValue'>]

as a workaround, CRs can be replaced by newlines https://unix.stackexchange.com/questions/32001/what-is-m-and-how-do-i-get-rid-of-it

dalito commented 2 years ago

I hit a related(?) CR problem in funowl in https://github.com/linkml/schema-automator/pull/104#issuecomment-1307388416