Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cats-uri should abstract all URI frameworks #8

Open
bblfish opened this issue Jul 15, 2023 · 1 comment
Open

cats-uri should abstract all URI frameworks #8

bblfish opened this issue Jul 15, 2023 · 1 comment

Comments

@bblfish
Copy link

bblfish commented Jul 15, 2023

It would help to have a URI spec that can abstract between any implementation of URIs, the way that banana-rdf can abstract between any RDF Framework, without needing to create any new objects (using opaque types essentially and Match Types.
Having such a library would allow one to write code that can work in Java, JS, and pure Scala land and native using the libs most appropriate for that platform, and making a switch from one library to the next a simple 1 line code change.

That would allow one to write code that could use any of the following libs:

  • java.net.URI
  • akka URI
  • Http4s URI
  • Jena URI
  • lemonlabs uri
  • JS URI libs
  • native URI libs
  • sttp.mode.Uri
  • ...

The pattern for such an abstraction is demonstrated with the banana-rdl scala3 library:

To see how it is used, please take a look at the tests which are framework independent, such as this one:
https://github.com/bblfish/banana-rdf/blob/scala3/rdf-test-suite/shared/src/main/scala/org/w3/banana/GraphTest.scala

Banana-rdf actually has an initial abstraction for URI too:
rg/w3/banana/operations/URI.scala, to help us write code that can work with URIs across frameworks.

@bblfish bblfish changed the title cats uri should abstract all URIs cats-uri should abstract all URI frameworks Jul 15, 2023
@bblfish
Copy link
Author

bblfish commented Jul 17, 2023

What would be nice for an RDF framework would be if such an abstraction could allow me to save the URLs in trees of url components that could map two way to Longs so that we can use the longs as substitutes for the URLs and reduce the amount of memory used by strings...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant