Skip to content

Commit

Permalink
Remove diagram-recognition-mock module, refactor results
Browse files Browse the repository at this point in the history
  • Loading branch information
menof36go committed Aug 15, 2023
1 parent 7e6a491 commit 1e7a120
Show file tree
Hide file tree
Showing 26 changed files with 304 additions and 335 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static double calculateHighestSimilarity(@NotNull Word word, @NotNull Set
* {@return the similarity of the noun mapping to the box}
*
* @param nounMapping the noun mapping
* @param box the box {@return the similarity of the noun mapping to the box}
* @param box the box
*/
public static double calculateSimilarity(@NotNull NounMapping nounMapping, @NotNull Box box) {
var targets = box.getReferences();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public interface Word extends Comparable<Word>, Serializable {
Word getNextWord();

/**
* FIXME Isnt it just the position in the text though? This is confusing imo
* Gets the position in the sentence / text.
*
* @return the position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ private DBPediaHelper() {

private List<String> loadProgrammingLanguages() {
ParameterizedSparqlString qs = new ParameterizedSparqlString("""
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX yago: <http://dbpedia.org/class/yago/>
\n
SELECT ?label \n
WHERE { \n
SELECT ?label
WHERE {
{
?pl dbo:abstract ?abstract .\n
?pl rdfs:label ?label .\n
?pl rdf:type yago:ProgrammingLanguage106898352 .\n
FILTER (LANG(?abstract) = 'en') .\n
?pl dbo:abstract ?abstract .
?pl rdfs:label ?label .
?pl rdf:type yago:ProgrammingLanguage106898352 .
FILTER (LANG(?abstract) = 'en') .
FILTER (LANG(?label)='en')
}
UNION
{
?pl dbo:abstract ?abstract .\n
?pl rdfs:label ?label .\n
?pl dbo:influenced ?influenced .\n
?pl dbo:influencedBy ?influencedBy .\n
?pl rdf:type dbo:ProgrammingLanguage .\n
FILTER (LANG(?abstract) = 'en') .\n
?pl dbo:abstract ?abstract .
?pl rdfs:label ?label .
?pl dbo:influenced ?influenced .
?pl dbo:influencedBy ?influencedBy .
?pl rdf:type dbo:ProgrammingLanguage .
FILTER (LANG(?abstract) = 'en') .
FILTER (LANG(?label)='en')
}
}
Expand All @@ -67,17 +67,17 @@ private List<String> loadProgrammingLanguages() {

private List<String> loadMarkupLanguages() {
ParameterizedSparqlString qs = new ParameterizedSparqlString("""
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX yago: <http://dbpedia.org/class/yago/>
\n
SELECT ?label \n
WHERE { \n
?pl dbo:abstract ?abstract .\n
?pl rdfs:label ?label .\n
?pl rdf:type yago:MarkupLanguage106787835 .\n
FILTER (LANG(?abstract) = 'en') .\n
SELECT ?label
WHERE {
?pl dbo:abstract ?abstract .
?pl rdfs:label ?label .
?pl rdf:type yago:MarkupLanguage106787835 .
FILTER (LANG(?abstract) = 'en') .
FILTER (LANG(?label)='en')
}
GROUP BY ?label""");
Expand All @@ -89,18 +89,18 @@ private List<String> loadMarkupLanguages() {

private List<String> loadSoftware() {
ParameterizedSparqlString qs = new ParameterizedSparqlString("""
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX yago: <http://dbpedia.org/class/yago/>
\n
SELECT ?label \n
WHERE { \n
?p rdf:type dbo:Software .\n
?p dbo:programmingLanguage ?pl .\n
?pl dbo:abstract ?abstract .\n
?pl rdfs:label ?label .\n
FILTER (LANG(?abstract) = 'en') .\n
SELECT ?label
WHERE {
?p rdf:type dbo:Software .
?p dbo:programmingLanguage ?pl .
?pl dbo:abstract ?abstract .
?pl rdfs:label ?label .
FILTER (LANG(?abstract) = 'en') .
FILTER (LANG(?label)='en')
}
GROUP BY ?label""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ var record = DBPediaHelper.getInstance().load();
@Test
void containsAtLeastSomePopularLanguages() {
var record = DBPediaHelper.getInstance().load();
assertTrue(record.programmingLanguages()
.stream()
.map(String::toLowerCase)
.toList()
.containsAll(List.of("python", "javascript", "java", "c", "c++", "html", "css", "scss")));
List<String> all = record.programmingLanguages();
all.addAll(record.markupLanguages());
all.addAll(record.software());
all = all.stream().map(String::toLowerCase).toList();
assertTrue(all.contains("python"));
assertTrue(all.contains("javascript"));
assertTrue(all.contains("java"));
assertTrue(all.contains("c"));
assertTrue(all.contains("c++"));
assertTrue(all.contains("html"));
assertTrue(all.contains("css"));
}
}
12 changes: 0 additions & 12 deletions pipeline/pipeline-erid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@
<artifactId>text-preprocessing</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.github.ardoco.core</groupId>
<artifactId>diagram-recognition-mock</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.ardoco.core</groupId>
<artifactId>diagram-connection-generator</artifactId>
Expand All @@ -78,12 +72,6 @@
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.ardoco.core</groupId>
<artifactId>diagram-recognition-mock</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.ardoco.core</groupId>
<artifactId>tests-inconsistency</artifactId>
Expand Down
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<properties>
<revision>0.18.0-SNAPSHOT</revision>
<ardoco.version>${revision}</ardoco.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.source.encoding>UTF-8</project.source.encoding>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down Expand Up @@ -107,6 +108,7 @@
<aggregate.report.dir>report/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
<argLine>-Xmx4g -Xss256m</argLine>
<stanford.corenlp.version>4.5.4</stanford.corenlp.version>
<doclint.options>all,-missing</doclint.options>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -485,6 +487,12 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<!-- Neither of these locale options works for me, but a solution should be figured out, because locale is important for javadoc generation -->
<additionalJOption>-locale en_US</additionalJOption>
<locale>en_US</locale>
<doclint>${doclint.options}</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
6 changes: 0 additions & 6 deletions stages/diagram-connection-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.ardoco.core</groupId>
<artifactId>diagram-recognition-mock</artifactId>
<version>${revision}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
Loading

0 comments on commit 1e7a120

Please sign in to comment.