ozekik / lightrdf

A fast and lightweight Python RDF parser which wraps bindings to Rust's Rio using PyO3
Apache License 2.0
28 stars 2 forks source link

Add support for parsing objects into literals vs URIs vs blank nodes #12

Open cmungall opened 2 years ago

cmungall commented 2 years ago

Currently the user has to parse the object to be able to do a lot of operations on it

This is relatively straightforward, I think:

  1. ^riog\d+$ is a blank node
  2. Literals:
    • ^"(.*)"^^<(\S+)>$ type
    • ^"(.*)"@\w+$ language
    • ^"(.*)"$ untyped
  3. Otherwise a URI

But it might be nice to centralize this, or do it in rust for speed. To avoid the overhead of an OO interface how about a parallel search_statements with arguments s, p, o_uri, o_literal_value, o_datatype, o_lang?

This is my use case:

https://github.com/INCATools/rdf-sql-bulkloader

For now I am doing this in python

ozekik commented 2 years ago

Thank you for the suggestion! We will implement that to lightrdf in some way. At the moment, if you just iterate over triples, not search them, you may want to try pyoxigraph by the author of Rio. (See pyoxigraph.parse.)

cmungall commented 2 years ago

Thanks for the suggestion! I wasn’t aware of pyoxigraph, I will check it out

On Fri, Sep 2, 2022 at 11:07 PM Kentaro Ozeki @.***> wrote:

Thank you for the suggestion! We will implement that to lightrdf in some way. At the moment, if you just iterate over triples, not search them, you may want to try pyoxigraph by the author of Rio. (See pyoxigraph.parse https://oxigraph.org/pyoxigraph/stable/io.html#parsing.)

— Reply to this email directly, view it on GitHub https://github.com/ozekik/lightrdf/issues/12#issuecomment-1236056927, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMMOLQEDFYSMTDXMVJEBLV4LTILANCNFSM577QFDSA . You are receiving this because you authored the thread.Message ID: @.***>