Re: [RDF] adding Quads - Bulk

2024-03-10 Thread Fred Hauschel
Ah, sorry. i forgot to post this PR here: 
https://github.com/apache/commons-rdf/pull/205

I did it right after the mail.

Thanks Fredy

On 10.03.24 13:42, Peter Hull wrote:

On Sat, 9 Mar 2024 at 22:37, Fred Hauschel  wrote:


Is there a reason, why there is no Method like GraphLike#add(List
statements); ?

It would be possible to add a method with a default implementation to
GraphLike - then look to see if this can be more efficient for
RDF4J (e.g. avoiding the multiple connections)
I don't think this would break compatibility unless someone had
already implemented addAll on a subclass, with a different signature.
Peter

diff --git 
a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
index f50423f8..0b7b936a 100644
--- a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
+++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
@@ -55,6 +55,17 @@ public interface GraphLike {
   */
  void add(T statement);

+/**
+ * Add a collection of statements.
+ *
+ * @param statements the TripleLike statements to add
+ */
+default void addAll(Iterable statements) {
+for (T statement : statements) {
+add(statement);
+}
+}
+
  /**
   * Remove all statements.
   */

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[RDF] adding Quads - Bulk

2024-03-09 Thread Fred Hauschel

Hi there,

it looks like I am bound to the interface 
org.apache.commons.rdf.api.GraphLike#add. And in the RDF4J 
implementation, a new connection to the repository is established for 
each quad/triple. This is not very useful.
Am I missing another possibility or am I the first to have a problem 
with this ?


Is there a reason, why there is no Method like GraphLike#add(List 
statements); ?


Thanks Fredy


[RDF] Querying a graph using SPARQL

2024-03-02 Thread Fred Hauschel

Hi there,

currently i try to understand, how i can use SPARQL with commons-rdf.

I suspect that was not intended ?

Thanks Fredy


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[RDF] New Jena Version

2024-02-18 Thread Fred Hauschel

Hi there,
i think I would like to use commons-rdf, but not with the old Jena 
version. So here is a PR for a new version. I have no idea about osgi 
and jena doesn't seem to support it anymore. so I just used the non osgi 
dependency.


https://github.com/apache/commons-rdf/pull/196

Fredy


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org