Swirrl / grafter

Linked Data & RDF Manufacturing Tools in Clojure
Eclipse Public License 1.0
190 stars 17 forks source link

to-statements of RepositoryConnection throws an exception on clojure 1.8 #161

Closed lkitching closed 4 years ago

lkitching commented 4 years ago

Creating a project depending on both grafter 2.1.7 and clojure 1.8.0:

(defproject grafter-test "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.8.0"]
                            [grafter "2.1.7"]])

the following code

(ns grafter-test.core
  (:require [grafter-2.rdf4j.repository :as repo]
                 [grafter-2.rdf4j.io :as gio]))

(defn- get-empty []
  (let [r (repo/sail-repo)]
    (with-open [conn (repo/->connection r)]
      (vec (gio/statements conn)))))

throws the following exception: IllegalArgumentException No matching method found: getStatements for class org.eclipse.rdf4j.repository.sail.SailRepositoryConnection clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)

This appears to be because RepositoryConnection contains two overloads of getStatements of arity 5 which cannot be disambiguated:

public RepositoryResult<Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred,
            Resource... contexts) throws RepositoryException;

@Deprecated
public default RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException {
        return getStatements(subj, (IRI) pred, obj, includeInferred, contexts);
    }