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

Commit 9365beb

Browse files
committed
Merge branch 'release/0.4.0'
2 parents 1bb85d3 + 61ce1c6 commit 9365beb

83 files changed

Lines changed: 41941 additions & 25669 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ project/plugins/project/
1616
.scala_dependencies
1717
.worksheet
1818
/.project
19+
20+
# IntelliJ IDEA specific
21+
/.idea
22+
sansa-ml-parent_2.11.iml

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: java
2+
sudo: false
3+
cache:
4+
directories:
5+
- $HOME/.m2

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ The ML layer currently supports the following algorithms:
1515
* DistMult (beta status)
1616
* Terminological Decision Trees for the classification of concepts(beta status)
1717
* Anomaly detection (beta status)
18+
* RDF graph kernel based on [A Fast and Simple Graph Kernel for RDF](http://ceur-ws.org/Vol-1082/paper2.pdf)
1819

1920
Please see https://github.com/SANSA-Stack/SANSA-Examples/tree/master/sansa-examples-spark/src/main/scala/net/sansa_stack/examples/spark/ml for examples on how to use the above machine learning approaches.
2021

2122
Several further algorithms are in development. Please create a pull request and/or contact [Jens Lehmann](http://jens-lehmann.org) if you are interested in contributing algorithms to SANSA-ML.
23+
24+
## How to Contribute
25+
We always welcome new contributors to the project! Please see [our contribution guide](http://sansa-stack.net/contributing-to-sansa/) for more details on how to get started contributing to SANSA.

pom.xml

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>net.sansa-stack</groupId>
66
<artifactId>sansa-ml-parent_2.11</artifactId>
7-
<version>0.3.0</version>
7+
<version>0.4.0</version>
88
<packaging>pom</packaging>
99
<name>ML API - Parent</name>
1010
<description>RDF/OWL Machine Learning Library for Big Data</description>
@@ -65,11 +65,11 @@
6565
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6666
<scala.version>2.11.11</scala.version>
6767
<scala.binary.version>2.11</scala.binary.version>
68-
<spark.version>2.2.1</spark.version>
69-
<spark.binary.version>2.2</spark.binary.version>
70-
<flink.version>1.4.0</flink.version>
71-
<jena.version>3.5.0</jena.version>
72-
<sansa.version>0.3.0-SNAPSHOT</sansa.version>
68+
<spark.version>2.3.1</spark.version>
69+
<flink.version>1.5.0</flink.version>
70+
<jena.version>3.7.0</jena.version>
71+
<sansa.version>0.4.0</sansa.version>
72+
<scalastyle.config.path>${project.basedir}/scalastyle-config.xml</scalastyle.config.path>
7373
</properties>
7474

7575
<dependencyManagement>
@@ -84,7 +84,7 @@
8484
<!-- SANSA RDF -->
8585
<dependency>
8686
<groupId>net.sansa-stack</groupId>
87-
<artifactId>sansa-rdf-spark-core_${scala.binary.version}</artifactId>
87+
<artifactId>sansa-rdf-spark_${scala.binary.version}</artifactId>
8888
<version>${sansa.version}</version>
8989
</dependency>
9090

@@ -141,6 +141,12 @@
141141
<version>${jena.version}</version>
142142
</dependency>
143143

144+
<dependency>
145+
<groupId>org.json</groupId>
146+
<artifactId>json</artifactId>
147+
<version>20180130</version>
148+
</dependency>
149+
144150
<!-- Test -->
145151
<dependency>
146152
<groupId>junit</groupId>
@@ -151,7 +157,13 @@
151157
<dependency>
152158
<groupId>org.scalatest</groupId>
153159
<artifactId>scalatest_${scala.binary.version}</artifactId>
154-
<version>2.2.6</version>
160+
<version>3.0.3</version>
161+
<scope>test</scope>
162+
</dependency>
163+
<dependency>
164+
<groupId>com.holdenkarau</groupId>
165+
<artifactId>spark-testing-base_${scala.binary.version}</artifactId>
166+
<version>2.3.0_0.9.0</version>
155167
<scope>test</scope>
156168
</dependency>
157169

@@ -244,6 +256,32 @@
244256
</configuration>
245257
</plugin>
246258

259+
<!-- Scalastyle -->
260+
<plugin>
261+
<groupId>org.scalastyle</groupId>
262+
<artifactId>scalastyle-maven-plugin</artifactId>
263+
<version>1.0.0</version>
264+
<configuration>
265+
<verbose>false</verbose>
266+
<failOnViolation>false</failOnViolation>
267+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
268+
<failOnWarning>false</failOnWarning>
269+
<sourceDirectory>${project.basedir}/src/main/scala</sourceDirectory>
270+
<testSourceDirectory>${project.basedir}/src/test/scala</testSourceDirectory>
271+
<!-- we use a central config located in the root directory -->
272+
<configLocation>${scalastyle.config.path}</configLocation>
273+
<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
274+
<outputEncoding>UTF-8</outputEncoding>
275+
</configuration>
276+
<executions>
277+
<execution>
278+
<goals>
279+
<goal>check</goal>
280+
</goals>
281+
</execution>
282+
</executions>
283+
</plugin>
284+
247285
</plugins>
248286
</pluginManagement>
249287
</build>
@@ -369,6 +407,20 @@
369407
</snapshotRepository>
370408
</distributionManagement>
371409

410+
<!-- profile necessary for Scalastyle plugin to find the conf file -->
411+
<profile>
412+
<id>root-dir</id>
413+
<activation>
414+
<file>
415+
<exists>${project.basedir}/../../scalastyle-config.xml</exists>
416+
</file>
417+
</activation>
418+
<properties>
419+
<scalastyle.config.path>${project.basedir}/../scalastyle-config.xml</scalastyle.config.path>
420+
</properties>
421+
</profile>
422+
</profiles>
423+
372424
<repositories>
373425
<repository>
374426
<id>oss-sonatype</id>

sansa-ml-common/pom.xml

Lines changed: 81 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,86 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<parent>
5-
<artifactId>sansa-ml-parent_2.11</artifactId>
6-
<groupId>net.sansa-stack</groupId>
7-
<version>0.3.0</version>
8-
</parent>
9-
<artifactId>sansa-ml-common_2.11</artifactId>
10-
<name>ML API - Common</name>
11-
<description>Common objects for the SANSA Machine Learning Layer</description>
12-
<inceptionYear>2016</inceptionYear>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<artifactId>sansa-ml-parent_2.11</artifactId>
7+
<groupId>net.sansa-stack</groupId>
8+
<version>0.4.0</version>
9+
</parent>
10+
<artifactId>sansa-ml-common_2.11</artifactId>
11+
<name>ML API - Common</name>
12+
<description>Common objects for the SANSA Machine Learning Layer</description>
13+
<inceptionYear>2016</inceptionYear>
1314

14-
<dependencies>
15-
<dependency>
16-
<groupId>org.scala-lang</groupId>
17-
<artifactId>scala-library</artifactId>
18-
</dependency>
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.scala-lang</groupId>
18+
<artifactId>scala-library</artifactId>
19+
</dependency>
1920

20-
<!-- Test -->
21-
<dependency>
22-
<groupId>junit</groupId>
23-
<artifactId>junit</artifactId>
24-
<scope>test</scope>
25-
</dependency>
26-
<dependency>
27-
<groupId>org.specs2</groupId>
28-
<artifactId>specs2-core_${scala.binary.version}</artifactId>
29-
<version>2.4.16</version>
30-
<scope>test</scope>
31-
</dependency>
32-
<dependency>
33-
<groupId>org.scalatest</groupId>
34-
<artifactId>scalatest_${scala.binary.version}</artifactId>
35-
<version>2.2.4</version>
36-
<scope>test</scope>
37-
</dependency>
38-
</dependencies>
21+
<!-- Test -->
22+
<dependency>
23+
<groupId>junit</groupId>
24+
<artifactId>junit</artifactId>
25+
<scope>test</scope>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.specs2</groupId>
29+
<artifactId>specs2-core_${scala.binary.version}</artifactId>
30+
<version>2.4.16</version>
31+
<scope>test</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.scalatest</groupId>
35+
<artifactId>scalatest_${scala.binary.version}</artifactId>
36+
<version>2.2.4</version>
37+
<scope>test</scope>
38+
</dependency>
39+
</dependencies>
3940

40-
<build>
41-
<sourceDirectory>src/main/scala</sourceDirectory>
42-
<testSourceDirectory>src/test/scala</testSourceDirectory>
43-
<plugins>
44-
<plugin>
45-
<!-- see http://davidb.github.com/scala-maven-plugin -->
46-
<groupId>net.alchim31.maven</groupId>
47-
<artifactId>scala-maven-plugin</artifactId>
48-
<executions>
49-
<execution>
50-
<goals>
51-
<goal>compile</goal>
52-
<goal>testCompile</goal>
53-
</goals>
54-
<configuration>
55-
<args>
56-
<arg>-dependencyfile</arg>
57-
<arg>${project.build.directory}/.scala_dependencies</arg>
58-
</args>
59-
</configuration>
60-
</execution>
61-
</executions>
62-
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-surefire-plugin</artifactId>
66-
<configuration>
67-
<useFile>false</useFile>
68-
<disableXmlReport>true</disableXmlReport>
69-
<!-- If you have classpath issue like NoDefClassError,... -->
70-
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
71-
<includes>
72-
<include>**/*Test.*</include>
73-
<include>**/*Suite.*</include>
74-
</includes>
75-
</configuration>
76-
</plugin>
77-
</plugins>
78-
</build>
41+
<build>
42+
<sourceDirectory>src/main/scala</sourceDirectory>
43+
<testSourceDirectory>src/test/scala</testSourceDirectory>
44+
<plugins>
45+
46+
<plugin>
47+
<groupId>org.scalastyle</groupId>
48+
<artifactId>scalastyle-maven-plugin</artifactId>
49+
</plugin>
50+
51+
<plugin>
52+
<!-- see http://davidb.github.com/scala-maven-plugin -->
53+
<groupId>net.alchim31.maven</groupId>
54+
<artifactId>scala-maven-plugin</artifactId>
55+
<executions>
56+
<execution>
57+
<goals>
58+
<goal>compile</goal>
59+
<goal>testCompile</goal>
60+
</goals>
61+
<configuration>
62+
<args>
63+
<arg>-dependencyfile</arg>
64+
<arg>${project.build.directory}/.scala_dependencies</arg>
65+
</args>
66+
</configuration>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-surefire-plugin</artifactId>
73+
<configuration>
74+
<useFile>false</useFile>
75+
<disableXmlReport>true</disableXmlReport>
76+
<!-- If you have classpath issue like NoDefClassError,... -->
77+
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
78+
<includes>
79+
<include>**/*Test.*</include>
80+
<include>**/*Suite.*</include>
81+
</includes>
82+
</configuration>
83+
</plugin>
84+
</plugins>
85+
</build>
7986
</project>

sansa-ml-common/src/main/scala/net/sansa_stack/ml/App.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

sansa-ml-flink/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>sansa-ml-parent_2.11</artifactId>
77
<groupId>net.sansa-stack</groupId>
8-
<version>0.3.0</version>
8+
<version>0.4.0</version>
99
</parent>
1010
<artifactId>sansa-ml-flink_2.11</artifactId>
1111
<name>ML API - Apache Flink</name>
@@ -80,6 +80,12 @@
8080
<groupId>org.apache.maven.plugins</groupId>
8181
<artifactId>maven-compiler-plugin</artifactId>
8282
</plugin>
83+
84+
<plugin>
85+
<groupId>org.scalastyle</groupId>
86+
<artifactId>scalastyle-maven-plugin</artifactId>
87+
</plugin>
88+
8389
<plugin>
8490
<groupId>net.alchim31.maven</groupId>
8591
<artifactId>scala-maven-plugin</artifactId>
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
package net.sansa_stack.ml.flink
22

33
import scala.collection.mutable
4+
45
import org.apache.flink.api.scala.ExecutionEnvironment
6+
57
import net.sansa_stack.ml.flink.clustering.RDFByModularityClustering
68

79
/**
8-
* @author ${user.name}
10+
* @author Gezim Sejdiu
911
*/
1012
object App {
1113
def main(args: Array[String]) {
12-
/* if (args.length < 3) {
13-
System.err.println(
14-
"Usage: RDFByModularityClustering <input> <output> <numIterations>")
15-
System.exit(1)
16-
}*/
14+
/**
15+
* if (args.length < 3) {
16+
* System.err.println(
17+
* "Usage: RDFByModularityClustering <input> <output> <numIterations>")
18+
* System.exit(1)
19+
* }
20+
*/
1721
val graphFile = "Clustering_sampledata.nt" // args(0)
18-
val outputFile = "output" //args(1)
19-
val numIterations = 5 //args(2).toInt
22+
val outputFile = "output" // args(1)
23+
val numIterations = 5 // args(2).toInt
2024
val optionsList = args.drop(3).map { arg =>
2125
arg.dropWhile(_ == '-').split('=') match {
2226
case Array(opt, v) => (opt -> v)
23-
case _ => throw new IllegalArgumentException("Invalid argument: " + arg)
27+
case _ => throw new IllegalArgumentException("Invalid argument: " + arg)
2428
}
2529
}
2630
val options = mutable.Map(optionsList: _*)
@@ -37,4 +41,4 @@ object App {
3741
RDFByModularityClustering(env, numIterations, graphFile, outputFile)
3842

3943
}
40-
}
44+
}

0 commit comments

Comments
 (0)