Skip to content
This repository was archived by the owner on Oct 8, 2020. It is now read-only.

Commit 4ab3561

Browse files
Generalized toMultiMap method. Minor code style.
1 parent 47ffc18 commit 4ab3561

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sansa-inference-common/src/main/scala/net/sansa_stack/inference/utils/CollectionUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object CollectionUtils {
1313
* @param tuples the tuples
1414
* @return the multimap
1515
*/
16-
def toMultiMap(tuples: Iterable[(String, String)]): Map[String, Set[String]] = {
16+
def toMultiMap[A, B](tuples: Iterable[(A, B)]): Map[A, Set[B]] = {
1717
tuples.groupBy(e => e._1).mapValues(e => e.map(x => x._2).toSet).map(identity)
1818
}
1919

sansa-inference-common/src/main/scala/net/sansa_stack/inference/utils/NTriplesStringToRDFTriple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object NTriplesStringToRDFTriple {
7474
def main(args: Array[String]): Unit = {
7575
val s1 = "<> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> ."
7676
val s2 = "_:genid32 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> ."
77-
val s3 = "<http://example.org/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> ."
77+
val s3 = "<http://example.org/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> ."
7878
val s4 = "<http://example.org/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> \"3\"^^<http://ex.org/int> ."
7979

8080
println(new NTriplesStringToRDFTriple().apply(s1))

sansa-inference-spark/src/main/scala/net/sansa_stack/inference/spark/data/loader/RDFGraphLoader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ object RDFGraphLoader {
4646
// .repartition(minPartitions)
4747

4848
// logger.info("finished loading " + triples.count() + " triples in " + (System.currentTimeMillis()-startTime) + "ms.")
49-
new RDFGraph(triples)
49+
RDFGraph(triples)
5050
}
5151

5252
/**

0 commit comments

Comments
 (0)