Giter VIP home page Giter VIP logo

Comments (2)

matthewhorridge avatar matthewhorridge commented on July 22, 2024

Yeah, it's because of the multiple parsing attempts... the stream might need to be read more than once. It might be better if an ontology loader was instantiated for each load and then this could decide whether it needed to do buffering. If only one parser factory is registered (RDF/XML say) then the buffering is unnecessary.

from owlapi.

ignazio1977 avatar ignazio1977 commented on July 22, 2024

An alternative would be to buffer only what is actually read and enable rewinding the stream, so reading from the actual stream would only happen once. The first bytes read might also be discarded after all parsers have examined them - although this is harder to get right.

Should still be faster than the current implementation, as most parsers will fail very early while reading the input - now no parser will be able to even start before the whole stream has been read. Especially bad if someone passes a big file that does not match any parser :-P

There is a possibility to start parsing with all parsers at once and only read the next chunk of input once all parsers have consumed the previous chunk or failed to parse, but this is more complex to implement and for small ontologies might cost a lot - all the parsers going at once might take longer than just loading the whole input and trying them one at a time.

from owlapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.