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

new types for relative uris and relative graphs #41

Open
bblfish opened this issue Dec 28, 2012 · 4 comments
Open

new types for relative uris and relative graphs #41

bblfish opened this issue Dec 28, 2012 · 4 comments

Comments

@bblfish
Copy link
Member

bblfish commented Dec 28, 2012

Perhaps it would be useful to create types for relative URIs and relative graphs.

type URI <: rURI

Then one could have two types of graphs Graph[URI] and Graph[rURI] == rGraph where the type specifies the upper limit for the URI. All else would remain the same.

This would just help make it clearer what could be done with the different graphs. For serialisation an rGraph would be fine. For reasoning only Graphs would be useable. Then there are interesting cases where one may

case class LDPR(uri: URI, graph: rGraph)

or perhaps

case class LDPR(uri: rURI, graph rGraph, container: LDPC)

where the container fills in the rest of the URI?

@bblfish
Copy link
Member Author

bblfish commented Jan 8, 2013

Here would be another example where this would help understanding. In LDPS, ( which should perhaps be
renamed RWW, as I think it wishes to be more general than just giving one access to one LDP Server
but a way to get collections for any server on the web ) the code could make it explicit that both
relative and full URIs are allowed like this:

trait LDPS[Rdf <: RDF] {
  def baseUri: Rdf#URI
  def shutdown(): Unit
  def createLDPC(uri: Rdf#rURI): Future[LDPC[Rdf]]
  def getLDPC(uri: Rdf#rURI): Future[LDPC[Rdf]]
  def deleteLDPC(uri: Rdf#rURI): Future[Unit]
}

This makes the baseUri understandable, as it can be used to complete relative URIs.

@betehess
Copy link
Member

@bblfish I was thinking about using scalaz Tags for that. Would it be ok for you?
But this may have a major impact on the existing code, I don't know yet.

@bblfish
Copy link
Member Author

bblfish commented Sep 25, 2013

If your solution makes it easy to distinguish relative and absolute urls that's what's needed. Short term it will take a lot of reworking of code, but long term it will remove ugly errors. ( I am not sure about scalaz Tags, I'll have to look. ) I'll be back on writing Scala RWW-Play from tomorrow, as I have to provide an LDP platform for a number of French universities in the next month or two.

@bblfish
Copy link
Member Author

bblfish commented Mar 22, 2015

A use case for relative URL support and relative graph support: The server may not know its own name read-write-web/rww-play#152

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

No branches or pull requests

2 participants