GitHub user arne-bdt created a discussion: Why is Quad not a composition of the 
graph Node + Triple?

Working with Datasets, we constantly create quads and triples converting one 
into the other.
This costs a lot of performance and memory.

I have several ideas to address this:
1. Make `Quad` a composition of `Node` + `Triple`
   --> a lot of code could be optimized this way
2. Make `Quad` an interface with two Implementations `QuadOfNodes` and 
`QuadOfTriple`
   --> this way, we could decide in each implementation, which one fits best. 
         Where Nodes are stored, use `QuadOfNodes`. Where Triples are stored, 
use `QuadOfTriples`.
3. If the upper options are not okay, Extend the 
`org.apache.jena.sparql.core.DatasetGraph` with `(Node g, Triple t)` overloads.
    This way, one can use the default implementation or implement it directly 
where this is beneficial.  
4. If `Triple`  was an interface too, a `Quad` could also extend that 
interface. This way, we could even store quads in graphs directly and would in 
many cases not have to convert them again, when used in a `DatasetGraph`
 
 What do you think?

GitHub link: https://github.com/apache/jena/discussions/3967

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to