Skip to content

Commit

Permalink
Merge pull request #79 from dig-team/code-clean
Browse files Browse the repository at this point in the history
Code clean provided by Weichen
  • Loading branch information
lgalarra authored Apr 16, 2024
2 parents 3e42cb3 + 8ed1828 commit f710f08
Show file tree
Hide file tree
Showing 141 changed files with 7,018 additions and 11,955 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
.project
.settings/
.vscode/
.idea/
bin/
kb/nb-configuration.xml
737 changes: 334 additions & 403 deletions LICENSE.txt

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions Parameters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
Command line parameters documentation

Basic command:
java -jar amie3.jar [TSV file]

Parameters:

# -mins <number> “min-support"
Minimum absolute support. The number of positive examples.
Default value: 100

# -minis <number> "min-initial-support"
Minimum size of the relations to be considered as head relations. The number of facts or entities depending on the bias.
Default value: 100

# -minhc <number> "min-head-coverage"
Minimum head coverage.
Default value: 0.01

# -pm <support|headcoverage> "pruning-metric"
Metric used for pruning of intermediate queries.
Default value: headcoverage

# -oute "output-at-end"
Print the rules at the end and not while they are discovered.
Default: False

# -datalog "datalog-output"
Print rules using the datalog notation.
Default: False

# -bexr <relations> "body-excluded-relations"
Do not use these relations as atoms in the body of rules.
Example: java -jar amie3.jar -bexr bornIn

# -hexr <relations> "head-excluded-relations"
Do not use these relations as atoms in the head of rules. (Incompatible with head-target-relations)
Example: java -jar amie3.jar -hexr bornIn

# -iexr <relations> "instantiation-excluded-relations"
Do not instantiate these relations. Should be used with -fconst or -const. (incompatible with instantiation-target-relations).
Example: java -jar amie3.jar -iexr bornIn

# -htr <relations> "head-target-relations"
Mine only rules with these relations in the head. Provide a list of relation names separated by commas. (incompatible with head-excluded-relations)
Example: java -jar amie3.jar -htr bornIn

# -btr <relations> "body-target-relations"
Allow only these relations in the body. Provide a list of relation names separated by commas (incompatible with body-excluded-relations)
Example: java -jar amie3.jar -btr bornIn

# -itr <relations> "instantiation-target-relations"
Allow only these relations to be instantiated. Should be used with -fconst or -const. Provide a list of relation names separated by commas(incompatible with instantiation-excluded-relations).
Example: java -jar amie3.jar -itr bornIn

# -maxad <number> "max-depth"
Maximum number of atoms in the antecedent and succedent of rules.
Default value: 3

# -minpca <number> "min-pca-confidence"
Minimum PCA confidence threshold.This value is not used for pruning, only for filtering of the results.
Defalut value: 0.0

# -const "allow-constants"
Enable rules with constants.
Default value: false

# -fconst "only-constants"
Enforce constants in all atoms.
Default: false

# -bias <oneVar|default|lazy|lazit|[Path to a subclass of amie.mining.assistant.MiningAssistant]> "e-name"
Syntatic/semantic bias
Default: default (defines support and confidence in terms of 2 head variables given an order, cf -vo)

# -caos "count-always-on-subject"
If a single variable bias is used (oneVar),force to count support always on the subject position.

# -nc <number> "n-threads"
Preferred number of cores. Round down to the actual number of cores in the system if a higher value is provided.

# -minc <number> "min-std-confidence"
Minimum standard confidence threshold. This value is not used for pruning, only for filtering of the results.
Default: 0.0.

# -optimcb "optim-confidence-bounds"
Enable the calculation of confidence upper bounds to prune rules.

# -optimfh "optim-func-heuristic"
Enable functionality heuristic to identify potential low confident rules for pruning.

# -verbose "verbose"
Maximal verbosity.

# -rl "recursivity-limit"
Recursivity limit

# -auta "avoid-unbound-type-atoms"
Avoid unbound type atoms, e.g., type(x, y), i.e., bind always 'y' to a type.

# -deml "do-not-exploit-max-length"
Do not exploit max length for speedup(requested by the reviewers of AMIE+).
Defalut value: False

# -dqrw "disable-query-rewriting"
Disable query rewriting and caching.

# -dpr "disable-perfect-rules"
Disable perfect rules.

# -oout "only-output"
If enabled, it activates only the output enhacements, that is, the confidence approximation and upper bounds. It overrides any other configuration that is incompatible.

# -full "full"
It enables all enhancements: lossless heuristics and confidence approximation and upper bounds. It overrides any other configuration that is incompatible.

# -noHeuristics "noHeuristics"
Disable functionality heuristic, should be used with the -full option.

# -noKbRewrite "noKbRewrite"
Prevent the KB to rewrite query when counting pairs.

# -noKbExistsDetection "noKbExistsDetection"
Prevent the KB to detect existential variable on-the-fly and to optimize the query.

# -noSkyline "noSkyline"
Disable Skyline pruning of results.

# -vo "variableOrder"
Define the order of the variable in counting query among: app, fun (default), ifun.

# -ef "extraFile"
An additional text file whose interpretation depends on the selected mining assistant (bias).

# -ostd "ommit-std-conf"
Do not calculate standard confidence.

# -optimai "adaptive-instantiations"
Prune instantiated rules that decrease too much the support of their parent rule (ratio 0.2).

# -mlg "multilingual"
Parse labels language as new facts

# -d <A SEPARATOR> "delimiter"
Separator in input files.
Default separator: TAB

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you want to modify the code of AMIE, you need
* Apache Maven >= 3.6.0
* Java >= 8
* Apache Commons >= 1.3.1
* [Javatools](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/javatools/). This package can be found as Maven projects here: https://github.com/lajus/amie-utils. As this artifact is not yet uploaded into a central repository, please follow the installation procedure described in the previous link before trying to compile this project.
* [Javatools](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/amie.data.javatools/). This package can be found as Maven projects here: https://github.com/lajus/amie-utils. As this artifact is not yet uploaded into a central repository, please follow the installation procedure described in the previous link before trying to compile this project.

AMIE is managed with [Maven](https://maven.apache.org/), therefore to deploy you need:

Expand Down Expand Up @@ -88,4 +88,4 @@ The code resides in: typing/

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a>. AMIE is distributed under the terms of the <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a> by the [YAGO-NAGA team](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/amie/) and the [DIG team](https://dig.telecom-paris.fr/blog/).

AMIE uses Javatools, a library released under the [Creative Commons Attribution license v3.0](https://creativecommons.org/licenses/by/3.0/) by the [YAGO-NAGA team](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/javatools/).
AMIE uses Javatools, a library released under the [Creative Commons Attribution license v3.0](https://creativecommons.org/licenses/by/3.0/) by the [YAGO-NAGA team](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/amie.data.javatools/).
124 changes: 71 additions & 53 deletions kb/pom.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,74 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.enst.dbweb</groupId>
<artifactId>amie</artifactId>
<version>2.0</version>
</parent>
<artifactId>kb</artifactId>
<version>1.0</version>
<name>kb</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.enst.dbweb</groupId>
<artifactId>amie</artifactId>
<version>2.0</version>
</parent>
<artifactId>kb</artifactId>
<version>1.0</version>
<name>kb</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<excludes>
<exclude>**/WikidataCleaner.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.semanticweb.yars</groupId>
<artifactId>nxparser-parsers</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>de.mpg.mpi-inf</groupId>
<artifactId>javatools</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>8.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<excludes>
<exclude>**/WikidataCleaner.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.semanticweb.yars</groupId>
<artifactId>nxparser-parsers</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-storage</artifactId>
<version>4.3.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>

<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>8.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-tdb</artifactId>
<version>0.9.0-incubating</version>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit f710f08

Please sign in to comment.