pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
210 stars 23 forks source link

Issue casting string to literal with custom datatype using `*` #148

Closed vemonet closed 6 months ago

vemonet commented 7 months ago

As found in the docs I tried to create a xsd:date literal by running:

let lit_date = "2023-11-15" * xsd::date;

But I am getting this error from the compiler:

mismatched types expected struct sophia::sophia_api::term::LanguageTag<&str> found struct sophia::sophia_api::ns::NsTerm<'static>

I also tried to do this from within the sophia_rs project (by cloning it, and doing this datatype casting somewhere in the tests), and it did not throw the error.

I am not sure if there is something missing in the code (maybe a trait that needs to be public?), or if I am missing something in my code (like an import?)

pchampin commented 7 months ago

This is currently only available from the github version; it is not included on the latest released version on crates.io. Sorry for the confusion.

pchampin commented 6 months ago

Sophia 0.8.0 has been released so this should now work.