rStatement.Relation
is defined as type Relation[R <: RDF] = rURI[R]
, and not type Relation[R <: RDF] = rURI[R] | URI[R]
- is there a particular reason? Because as long as that is fixed, there seems to be no problem removing the implicit defs in Ops.scala
(at least all tests compile and run successfully).
heksesang: sorry I just saw your question
I noticed rStatement.Relation is defined as type Relation[R <: RDF] = rURI[R], and not type Relation[R <: RDF] = rURI[R] | URI[R] - is there a particular reason? Because as long as that is fixed, there seems to be no problem removing the implicit defs in Ops.scala (at least all tests compile and run successfully).
As it is now:
object rStatement:
type Subject[R <: RDF] = rURI[R] | BNode[R] | URI[R]
type Relation[R <: RDF] = rURI[R]
type Object[R <: RDF] = rURI[R] | BNode[R] | Literal[R] | URI[R]
type Graph[R <: RDF] = rURI[R] | BNode[R] | URI[R]
end rStatement
Why is it not defined as:
object rStatement:
type Subject[R <: RDF] = rURI[R] | BNode[R] | URI[R]
type Relation[R <: RDF] = rURI[R] | URI[R]
type Object[R <: RDF] = rURI[R] | BNode[R] | Literal[R] | URI[R]
type Graph[R <: RDF] = rURI[R] | BNode[R] | URI[R]
end rStatement
URI[R]
to the Relation
type has simply been forgot - or was it left out on purpose?
gh
(github command line client) like this:gh browse rdf/shared/src/main/scala/org/w3/banana/RDF.scala
RDF.Node[R]
did not result in the expected type. And there is no way to use RDF.Node[R]
to get for example JenaRdf.Node
.
Node
definition in the RDF
trait used to anything? Considering there is no way to extract it from a given RDF
implementation, then it could either be removed. Or else it should be fixed, so that RDF.Node[R]
returns the Node
type defined in R
.
Rdf4j.Node
and not RDF.Node[Rdf4j.type]
(which is odd that are not the same).
So in short set
type Node[R <: RDF] = URI[R] | BNode[R] | Literal[R]
see if it compiles, add a few tests (perhaps some for PG) and continue from where you were...
Actually if you look at the git blame of that line you will find that it used to be as with banana-rdf 0.8.x based on a type hierarchy:
type Node[R <: RDF] <: Matchable = R match
case GetNode[n] => n
That may still work.
type GetNode[N <: Matchable] = RDF { type Node = N }