Menu

Unable to parse .owl file due to whitespace handling.

Help
alex
2014-10-20
2014-11-07
  • alex

    alex - 2014-10-20

    Hi,

    I have an Ontology file created by a non public available third party lib and the "print_classes" example app crashes with the error:

    .../include/owlcpp/rdf/node_literal.hpp(53): Throw in function static >owlcpp::detail::Node_literal_impl< <template-parameter-1-1> >::value_type >owlcpp::detail::Node_literal_impl< <template-parameter-1-1> >::convert(const In&, >owlcpp::Node_id) [with In = std::basic_string<char>; Dt = owlcpp::detail::Datatype_int; >owlcpp::detail::Node_literal_impl< <template-parameter-1-1> >::value_type = long int]
    Dynamic exception type: N5boost16exception_detail10clone_implIN6owlcpp7Rdf_errEEE
    std::exception::what: std::exception
    [PN6owlcpp13errinfo_str1_E] = "0
    "
    [PN6owlcpp16errinfo_message_E] = error converting to xsd:int

    As the output shows the error is due to the additional whitespaces and the line break after the 0.
    The xml for that case looks like this:

            <ds:TranslationX rdf:datatype="&xsd;int" >0
            </ds:TranslationX>
    

    I couldn't find a reference if this spacing is illegal in owl or if it is a bug in the library.
    The sourceforge markdown seems to delete the leading whitespaces so before the single " in the error are two tabs and before the two <ds/ds definitions are two tabs too.

    Thanks in advance for clarification.

    Alexander

     
  • M Levin

    M Levin - 2014-10-20

    Hi Alexander,

    XML Schema sets facet whiteSpace=collapse for booleans and decimals. #x9 (tab), #xA (line feed), #xD (carriage return), and #x20 (space) should be stripped from both ends.
    http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#decimal
    Therefore your example is legal.

    I have pushed a fix for this issue. It is in the master branch. Please check it out.

    Thanks for catching!

    Mikhail

     
  • alex

    alex - 2014-11-07

    Thanks, with the new version from the master branch the ontology loads correctly.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.