Unable to resolve class EmptyBundle in Groovy
I am trying to run this Knowledge Graph Evaluation project. Due to the migration of the maven repository, I had to do some modifications to the pom.xml
dependencies and the other files. Now am running into the following error.
[ERROR] /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy:[62,89] 1. ERROR in /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy (at line 62)
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
^^^^^^^^^^^
Groovy:unable to resolve class EmptyBundle
The programs running under the following specs.
- Apache Maven 3.3.9
- Maven home: /usr/share/maven
- Groovy 2.5.4
- Java version: 1.8.0_181, vendor: Oracle Corporation
- Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
I tried to figure out how to resolve this error but had no luck whatsoever.
pom.xml
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.linqs.psl.kgi</groupId>
<artifactId>kgi</artifactId>
<version>1.0.-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-groovy</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-dataloading</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-textsim</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-datasplitter</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-experiment</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-mosek</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-optimize</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-sampler</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-weightlearning</artifactId>
<version>CANARY</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-releases</id>
<name>PSL Releases</name>
<url>http://maven.linqs.org/maven/repositories/psl-releases/</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-thirdparty</id>
<name>PSL Third Party</name>
<url>http://maven.linqs.org/maven/repositories/psl-thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-compiler -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.2-01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.3-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
</additionalProjectnatures>
<sourceIncludes>
<sourceInclude>**/*.groovy</sourceInclude>
</sourceIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
</plugins>
</build>
</project>
LoadData.groovy
package org.linqs.psl.kgi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.linqs.psl.groovy.*;
import org.linqs.psl.config.*;
import org.linqs.psl.core.*;
import org.linqs.psl.core.inference.*;
import org.linqs.psl.ui.loading.*
import org.linqs.psl.evaluation.result.*;
import org.linqs.psl.database.DataStore;
//import org.linqs.psl.database.Database;
//import org.linqs.psl.database.DatabasePopulator;
//import org.linqs.psl.database.DatabaseQuery;
import org.linqs.psl.database.Partition;
import org.linqs.psl.database.rdbms.RDBMSDataStore;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver.Type;
//import edu.emory.mathcs.utils.ConcurrencyUtils;
import org.linqs.psl.model.term.ConstantType
import org.linqs.psl.model.predicate.Predicate
//import org.linqs.psl.model.predicate.StandardPredicate
//import org.linqs.psl.model.term.GroundTerm
//import org.linqs.psl.model.term.Variable
import org.linqs.psl.model.atom.*
import java.io.*;
import java.util.*;
import java.util.HashSet;
import groovy.time.*;
Date start = new Date();
Logger log = LoggerFactory.getLogger(this.class);
//Where the data resides (first argument to this script)
def dataroot = args[0];
-->
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
PSLModel m = new PSLModel(this, data);
////////////////////////// predicate declaration ////////////////////////
System.out.println "[info] ttDECLARING PREDICATES...";
/*** Target Predicates ***/
m.add predicate: "Cat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Rel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Ontology Predicates ***/
m.add predicate: "Sub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RSub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Mut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RMut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Inv", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Domain", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Range2", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Entity Resolution Predicates ***/
m.add predicate: "SameEntity", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Scoping Predicates ***/
m.add predicate: "ValCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "ValRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Training Data Predicates ***/
m.add predicate: "PSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Input Data Predicates ***/
m.add predicate: "CandCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PromCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
/*** Load ontology atoms ***/
Partition ontology = DataStore.getPartition("10");
def ontoMap = [
((Predicate)Mut):dataroot+"165.onto-wbpg.db.Mut.txt",
((Predicate)Sub):dataroot+"165.onto-wbpg.db.Sub.txt",
((Predicate)RSub):dataroot+"165.onto-wbpg.db.RSub.txt",
((Predicate)Domain):dataroot+"165.onto-wbpg.db.Domain.txt",
((Predicate)Inv):dataroot+"165.onto-wbpg.db.Inv.txt",
((Predicate)Range2):dataroot+"165.onto-wbpg.db.Range2.txt",
((Predicate)RMut):dataroot+"165.onto-wbpg.db.RMut.txt"];
KGIUtils.loadPredicateAtoms(data, ontoMap, ontology)
/*** Load seed atoms ***/
Partition seeds = DataStore.getPartition("20");
def seedMap = [((Predicate)Cat):dataroot+"seed.165.cat.uniq.out",
((Predicate)Rel):dataroot+"seed.165.rel.uniq.out"];
KGIUtils.loadPredicateAtomsWithValue(data, seedMap, seeds)
/*** Load entity resolution atoms ***/
Partition entity_resolution = DataStore.getPartition("30");
def erMap = [((Predicate)SameEntity):dataroot+"NELL.08m.165.cesv.csv.SameEntity.out"]
KGIUtils.loadPredicateAtomsWithValue(data, erMap, entity_resolution)
/*** Load training atoms ***/
Partition training = DataStore.getPartition("40");
def trainMap = [((Predicate)Cat):dataroot+"label-train-uniq-raw-cat.db.TRAIN",
((Predicate)Rel):dataroot+"label-train-uniq-raw-rel.db.TRAIN"];
KGIUtils.loadPredicateAtomsWithValue(data, trainMap, training)
/*** Load candidate atoms ***/
Partition candidates = DataStore.getPartition("50");
Partition candidates_nosource = DataStore.getPartition("55");
def predCatMap = [((Predicate)CandCat_CBL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CBL.out",
((Predicate)CandCat_CMC):dataroot+"NELL.08m.165.cesv.csv.CandCat_CMC.out",
((Predicate)CandCat_CPL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CPL.out",
((Predicate)CandCat_General):dataroot+"NELL.08m.165.cesv.csv.CandCat_General.out",
((Predicate)CandCat_Morph):dataroot+"NELL.08m.165.cesv.csv.CandCat_Morph.out",
((Predicate)CandCat_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandCat_SEAL.out",
((Predicate)PattCat):dataroot+"NELL.08m.165.cesv.csv.PattCat.out",
((Predicate)PromCat_General):dataroot+"NELL.08m.165.esv.csv.PromCat_General.out"]
def predRelMap = [((Predicate)CandRel_CBL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CBL.out",
((Predicate)CandRel_CPL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CPL.out",
((Predicate)CandRel_General):dataroot+"NELL.08m.165.cesv.csv.CandRel_General.out",
((Predicate)CandRel_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandRel_SEAL.out",
((Predicate)PattRel):dataroot+"NELL.08m.165.cesv.csv.PattRel.out",
((Predicate)PromRel_General):dataroot+"NELL.08m.165.esv.csv.PromRel_General.out"];
def predNoSourceMap = [((Predicate)CandCat):dataroot+"NELL.08m.165.cesv.csv.CandCat.out",
((Predicate)CandRel):dataroot+"NELL.08m.165.cesv.csv.CandRel.out"];
KGIUtils.loadPredicateAtomsWithValue(data, predCatMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predRelMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predNoSourceMap, candidates_nosource)
System.out.println("[info] data loading finished")
Date stop = new Date();
TimeDuration td = TimeCategory.minus( stop, start );
System.out.println td;
Any suggestions in this regard will be highly appreciated.
java maven class groovy psl
add a comment |
I am trying to run this Knowledge Graph Evaluation project. Due to the migration of the maven repository, I had to do some modifications to the pom.xml
dependencies and the other files. Now am running into the following error.
[ERROR] /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy:[62,89] 1. ERROR in /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy (at line 62)
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
^^^^^^^^^^^
Groovy:unable to resolve class EmptyBundle
The programs running under the following specs.
- Apache Maven 3.3.9
- Maven home: /usr/share/maven
- Groovy 2.5.4
- Java version: 1.8.0_181, vendor: Oracle Corporation
- Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
I tried to figure out how to resolve this error but had no luck whatsoever.
pom.xml
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.linqs.psl.kgi</groupId>
<artifactId>kgi</artifactId>
<version>1.0.-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-groovy</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-dataloading</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-textsim</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-datasplitter</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-experiment</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-mosek</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-optimize</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-sampler</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-weightlearning</artifactId>
<version>CANARY</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-releases</id>
<name>PSL Releases</name>
<url>http://maven.linqs.org/maven/repositories/psl-releases/</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-thirdparty</id>
<name>PSL Third Party</name>
<url>http://maven.linqs.org/maven/repositories/psl-thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-compiler -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.2-01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.3-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
</additionalProjectnatures>
<sourceIncludes>
<sourceInclude>**/*.groovy</sourceInclude>
</sourceIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
</plugins>
</build>
</project>
LoadData.groovy
package org.linqs.psl.kgi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.linqs.psl.groovy.*;
import org.linqs.psl.config.*;
import org.linqs.psl.core.*;
import org.linqs.psl.core.inference.*;
import org.linqs.psl.ui.loading.*
import org.linqs.psl.evaluation.result.*;
import org.linqs.psl.database.DataStore;
//import org.linqs.psl.database.Database;
//import org.linqs.psl.database.DatabasePopulator;
//import org.linqs.psl.database.DatabaseQuery;
import org.linqs.psl.database.Partition;
import org.linqs.psl.database.rdbms.RDBMSDataStore;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver.Type;
//import edu.emory.mathcs.utils.ConcurrencyUtils;
import org.linqs.psl.model.term.ConstantType
import org.linqs.psl.model.predicate.Predicate
//import org.linqs.psl.model.predicate.StandardPredicate
//import org.linqs.psl.model.term.GroundTerm
//import org.linqs.psl.model.term.Variable
import org.linqs.psl.model.atom.*
import java.io.*;
import java.util.*;
import java.util.HashSet;
import groovy.time.*;
Date start = new Date();
Logger log = LoggerFactory.getLogger(this.class);
//Where the data resides (first argument to this script)
def dataroot = args[0];
-->
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
PSLModel m = new PSLModel(this, data);
////////////////////////// predicate declaration ////////////////////////
System.out.println "[info] ttDECLARING PREDICATES...";
/*** Target Predicates ***/
m.add predicate: "Cat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Rel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Ontology Predicates ***/
m.add predicate: "Sub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RSub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Mut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RMut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Inv", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Domain", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Range2", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Entity Resolution Predicates ***/
m.add predicate: "SameEntity", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Scoping Predicates ***/
m.add predicate: "ValCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "ValRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Training Data Predicates ***/
m.add predicate: "PSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Input Data Predicates ***/
m.add predicate: "CandCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PromCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
/*** Load ontology atoms ***/
Partition ontology = DataStore.getPartition("10");
def ontoMap = [
((Predicate)Mut):dataroot+"165.onto-wbpg.db.Mut.txt",
((Predicate)Sub):dataroot+"165.onto-wbpg.db.Sub.txt",
((Predicate)RSub):dataroot+"165.onto-wbpg.db.RSub.txt",
((Predicate)Domain):dataroot+"165.onto-wbpg.db.Domain.txt",
((Predicate)Inv):dataroot+"165.onto-wbpg.db.Inv.txt",
((Predicate)Range2):dataroot+"165.onto-wbpg.db.Range2.txt",
((Predicate)RMut):dataroot+"165.onto-wbpg.db.RMut.txt"];
KGIUtils.loadPredicateAtoms(data, ontoMap, ontology)
/*** Load seed atoms ***/
Partition seeds = DataStore.getPartition("20");
def seedMap = [((Predicate)Cat):dataroot+"seed.165.cat.uniq.out",
((Predicate)Rel):dataroot+"seed.165.rel.uniq.out"];
KGIUtils.loadPredicateAtomsWithValue(data, seedMap, seeds)
/*** Load entity resolution atoms ***/
Partition entity_resolution = DataStore.getPartition("30");
def erMap = [((Predicate)SameEntity):dataroot+"NELL.08m.165.cesv.csv.SameEntity.out"]
KGIUtils.loadPredicateAtomsWithValue(data, erMap, entity_resolution)
/*** Load training atoms ***/
Partition training = DataStore.getPartition("40");
def trainMap = [((Predicate)Cat):dataroot+"label-train-uniq-raw-cat.db.TRAIN",
((Predicate)Rel):dataroot+"label-train-uniq-raw-rel.db.TRAIN"];
KGIUtils.loadPredicateAtomsWithValue(data, trainMap, training)
/*** Load candidate atoms ***/
Partition candidates = DataStore.getPartition("50");
Partition candidates_nosource = DataStore.getPartition("55");
def predCatMap = [((Predicate)CandCat_CBL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CBL.out",
((Predicate)CandCat_CMC):dataroot+"NELL.08m.165.cesv.csv.CandCat_CMC.out",
((Predicate)CandCat_CPL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CPL.out",
((Predicate)CandCat_General):dataroot+"NELL.08m.165.cesv.csv.CandCat_General.out",
((Predicate)CandCat_Morph):dataroot+"NELL.08m.165.cesv.csv.CandCat_Morph.out",
((Predicate)CandCat_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandCat_SEAL.out",
((Predicate)PattCat):dataroot+"NELL.08m.165.cesv.csv.PattCat.out",
((Predicate)PromCat_General):dataroot+"NELL.08m.165.esv.csv.PromCat_General.out"]
def predRelMap = [((Predicate)CandRel_CBL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CBL.out",
((Predicate)CandRel_CPL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CPL.out",
((Predicate)CandRel_General):dataroot+"NELL.08m.165.cesv.csv.CandRel_General.out",
((Predicate)CandRel_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandRel_SEAL.out",
((Predicate)PattRel):dataroot+"NELL.08m.165.cesv.csv.PattRel.out",
((Predicate)PromRel_General):dataroot+"NELL.08m.165.esv.csv.PromRel_General.out"];
def predNoSourceMap = [((Predicate)CandCat):dataroot+"NELL.08m.165.cesv.csv.CandCat.out",
((Predicate)CandRel):dataroot+"NELL.08m.165.cesv.csv.CandRel.out"];
KGIUtils.loadPredicateAtomsWithValue(data, predCatMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predRelMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predNoSourceMap, candidates_nosource)
System.out.println("[info] data loading finished")
Date stop = new Date();
TimeDuration td = TimeCategory.minus( stop, start );
System.out.println td;
Any suggestions in this regard will be highly appreciated.
java maven class groovy psl
add a comment |
I am trying to run this Knowledge Graph Evaluation project. Due to the migration of the maven repository, I had to do some modifications to the pom.xml
dependencies and the other files. Now am running into the following error.
[ERROR] /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy:[62,89] 1. ERROR in /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy (at line 62)
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
^^^^^^^^^^^
Groovy:unable to resolve class EmptyBundle
The programs running under the following specs.
- Apache Maven 3.3.9
- Maven home: /usr/share/maven
- Groovy 2.5.4
- Java version: 1.8.0_181, vendor: Oracle Corporation
- Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
I tried to figure out how to resolve this error but had no luck whatsoever.
pom.xml
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.linqs.psl.kgi</groupId>
<artifactId>kgi</artifactId>
<version>1.0.-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-groovy</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-dataloading</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-textsim</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-datasplitter</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-experiment</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-mosek</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-optimize</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-sampler</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-weightlearning</artifactId>
<version>CANARY</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-releases</id>
<name>PSL Releases</name>
<url>http://maven.linqs.org/maven/repositories/psl-releases/</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-thirdparty</id>
<name>PSL Third Party</name>
<url>http://maven.linqs.org/maven/repositories/psl-thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-compiler -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.2-01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.3-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
</additionalProjectnatures>
<sourceIncludes>
<sourceInclude>**/*.groovy</sourceInclude>
</sourceIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
</plugins>
</build>
</project>
LoadData.groovy
package org.linqs.psl.kgi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.linqs.psl.groovy.*;
import org.linqs.psl.config.*;
import org.linqs.psl.core.*;
import org.linqs.psl.core.inference.*;
import org.linqs.psl.ui.loading.*
import org.linqs.psl.evaluation.result.*;
import org.linqs.psl.database.DataStore;
//import org.linqs.psl.database.Database;
//import org.linqs.psl.database.DatabasePopulator;
//import org.linqs.psl.database.DatabaseQuery;
import org.linqs.psl.database.Partition;
import org.linqs.psl.database.rdbms.RDBMSDataStore;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver.Type;
//import edu.emory.mathcs.utils.ConcurrencyUtils;
import org.linqs.psl.model.term.ConstantType
import org.linqs.psl.model.predicate.Predicate
//import org.linqs.psl.model.predicate.StandardPredicate
//import org.linqs.psl.model.term.GroundTerm
//import org.linqs.psl.model.term.Variable
import org.linqs.psl.model.atom.*
import java.io.*;
import java.util.*;
import java.util.HashSet;
import groovy.time.*;
Date start = new Date();
Logger log = LoggerFactory.getLogger(this.class);
//Where the data resides (first argument to this script)
def dataroot = args[0];
-->
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
PSLModel m = new PSLModel(this, data);
////////////////////////// predicate declaration ////////////////////////
System.out.println "[info] ttDECLARING PREDICATES...";
/*** Target Predicates ***/
m.add predicate: "Cat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Rel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Ontology Predicates ***/
m.add predicate: "Sub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RSub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Mut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RMut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Inv", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Domain", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Range2", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Entity Resolution Predicates ***/
m.add predicate: "SameEntity", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Scoping Predicates ***/
m.add predicate: "ValCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "ValRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Training Data Predicates ***/
m.add predicate: "PSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Input Data Predicates ***/
m.add predicate: "CandCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PromCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
/*** Load ontology atoms ***/
Partition ontology = DataStore.getPartition("10");
def ontoMap = [
((Predicate)Mut):dataroot+"165.onto-wbpg.db.Mut.txt",
((Predicate)Sub):dataroot+"165.onto-wbpg.db.Sub.txt",
((Predicate)RSub):dataroot+"165.onto-wbpg.db.RSub.txt",
((Predicate)Domain):dataroot+"165.onto-wbpg.db.Domain.txt",
((Predicate)Inv):dataroot+"165.onto-wbpg.db.Inv.txt",
((Predicate)Range2):dataroot+"165.onto-wbpg.db.Range2.txt",
((Predicate)RMut):dataroot+"165.onto-wbpg.db.RMut.txt"];
KGIUtils.loadPredicateAtoms(data, ontoMap, ontology)
/*** Load seed atoms ***/
Partition seeds = DataStore.getPartition("20");
def seedMap = [((Predicate)Cat):dataroot+"seed.165.cat.uniq.out",
((Predicate)Rel):dataroot+"seed.165.rel.uniq.out"];
KGIUtils.loadPredicateAtomsWithValue(data, seedMap, seeds)
/*** Load entity resolution atoms ***/
Partition entity_resolution = DataStore.getPartition("30");
def erMap = [((Predicate)SameEntity):dataroot+"NELL.08m.165.cesv.csv.SameEntity.out"]
KGIUtils.loadPredicateAtomsWithValue(data, erMap, entity_resolution)
/*** Load training atoms ***/
Partition training = DataStore.getPartition("40");
def trainMap = [((Predicate)Cat):dataroot+"label-train-uniq-raw-cat.db.TRAIN",
((Predicate)Rel):dataroot+"label-train-uniq-raw-rel.db.TRAIN"];
KGIUtils.loadPredicateAtomsWithValue(data, trainMap, training)
/*** Load candidate atoms ***/
Partition candidates = DataStore.getPartition("50");
Partition candidates_nosource = DataStore.getPartition("55");
def predCatMap = [((Predicate)CandCat_CBL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CBL.out",
((Predicate)CandCat_CMC):dataroot+"NELL.08m.165.cesv.csv.CandCat_CMC.out",
((Predicate)CandCat_CPL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CPL.out",
((Predicate)CandCat_General):dataroot+"NELL.08m.165.cesv.csv.CandCat_General.out",
((Predicate)CandCat_Morph):dataroot+"NELL.08m.165.cesv.csv.CandCat_Morph.out",
((Predicate)CandCat_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandCat_SEAL.out",
((Predicate)PattCat):dataroot+"NELL.08m.165.cesv.csv.PattCat.out",
((Predicate)PromCat_General):dataroot+"NELL.08m.165.esv.csv.PromCat_General.out"]
def predRelMap = [((Predicate)CandRel_CBL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CBL.out",
((Predicate)CandRel_CPL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CPL.out",
((Predicate)CandRel_General):dataroot+"NELL.08m.165.cesv.csv.CandRel_General.out",
((Predicate)CandRel_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandRel_SEAL.out",
((Predicate)PattRel):dataroot+"NELL.08m.165.cesv.csv.PattRel.out",
((Predicate)PromRel_General):dataroot+"NELL.08m.165.esv.csv.PromRel_General.out"];
def predNoSourceMap = [((Predicate)CandCat):dataroot+"NELL.08m.165.cesv.csv.CandCat.out",
((Predicate)CandRel):dataroot+"NELL.08m.165.cesv.csv.CandRel.out"];
KGIUtils.loadPredicateAtomsWithValue(data, predCatMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predRelMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predNoSourceMap, candidates_nosource)
System.out.println("[info] data loading finished")
Date stop = new Date();
TimeDuration td = TimeCategory.minus( stop, start );
System.out.println td;
Any suggestions in this regard will be highly appreciated.
java maven class groovy psl
I am trying to run this Knowledge Graph Evaluation project. Due to the migration of the maven repository, I had to do some modifications to the pom.xml
dependencies and the other files. Now am running into the following error.
[ERROR] /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy:[62,89] 1. ERROR in /home/manuelanayantarajeyaraj/Documents/Knowledge Extraction/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy (at line 62)
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
^^^^^^^^^^^
Groovy:unable to resolve class EmptyBundle
The programs running under the following specs.
- Apache Maven 3.3.9
- Maven home: /usr/share/maven
- Groovy 2.5.4
- Java version: 1.8.0_181, vendor: Oracle Corporation
- Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
I tried to figure out how to resolve this error but had no luck whatsoever.
pom.xml
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.linqs.psl.kgi</groupId>
<artifactId>kgi</artifactId>
<version>1.0.-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-groovy</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-dataloading</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-textsim</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-datasplitter</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-experiment</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-mosek</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-optimize</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-sampler</artifactId>
<version>CANARY</version>
</dependency>
<dependency>
<groupId>org.linqs</groupId>
<artifactId>psl-weightlearning</artifactId>
<version>CANARY</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-releases</id>
<name>PSL Releases</name>
<url>http://maven.linqs.org/maven/repositories/psl-releases/</url>
<layout>default</layout>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<id>psl-thirdparty</id>
<name>PSL Third Party</name>
<url>http://maven.linqs.org/maven/repositories/psl-thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-compiler -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.2-01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.3-01</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
</additionalProjectnatures>
<sourceIncludes>
<sourceInclude>**/*.groovy</sourceInclude>
</sourceIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
</plugins>
</build>
</project>
LoadData.groovy
package org.linqs.psl.kgi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.linqs.psl.groovy.*;
import org.linqs.psl.config.*;
import org.linqs.psl.core.*;
import org.linqs.psl.core.inference.*;
import org.linqs.psl.ui.loading.*
import org.linqs.psl.evaluation.result.*;
import org.linqs.psl.database.DataStore;
//import org.linqs.psl.database.Database;
//import org.linqs.psl.database.DatabasePopulator;
//import org.linqs.psl.database.DatabaseQuery;
import org.linqs.psl.database.Partition;
import org.linqs.psl.database.rdbms.RDBMSDataStore;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver;
import org.linqs.psl.database.rdbms.driver.H2DatabaseDriver.Type;
//import edu.emory.mathcs.utils.ConcurrencyUtils;
import org.linqs.psl.model.term.ConstantType
import org.linqs.psl.model.predicate.Predicate
//import org.linqs.psl.model.predicate.StandardPredicate
//import org.linqs.psl.model.term.GroundTerm
//import org.linqs.psl.model.term.Variable
import org.linqs.psl.model.atom.*
import java.io.*;
import java.util.*;
import java.util.HashSet;
import groovy.time.*;
Date start = new Date();
Logger log = LoggerFactory.getLogger(this.class);
//Where the data resides (first argument to this script)
def dataroot = args[0];
-->
DataStore data = new RDBMSDataStore(new H2DatabaseDriver(Type.Disk, './psl', true), new EmptyBundle());
PSLModel m = new PSLModel(this, data);
////////////////////////// predicate declaration ////////////////////////
System.out.println "[info] ttDECLARING PREDICATES...";
/*** Target Predicates ***/
m.add predicate: "Cat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Rel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Ontology Predicates ***/
m.add predicate: "Sub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RSub", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Mut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "RMut", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Inv", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Domain", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "Range2", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Entity Resolution Predicates ***/
m.add predicate: "SameEntity", types: [ConstantType.UniqueID, ConstantType.UniqueID]
/*** Scoping Predicates ***/
m.add predicate: "ValCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "ValRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Training Data Predicates ***/
m.add predicate: "PSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "NSeedRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "TrRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
/*** Input Data Predicates ***/
m.add predicate: "CandCat", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CBL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CMC", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_CPL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_Morph", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandCat_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "CandRel_SEAL", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID]
m.add predicate: "PromCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromCat_General", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PromRel_General", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattCat", types: [ConstantType.UniqueID, ConstantType.UniqueID];
m.add predicate: "PattRel", types: [ConstantType.UniqueID, ConstantType.UniqueID, ConstantType.UniqueID];
/*** Load ontology atoms ***/
Partition ontology = DataStore.getPartition("10");
def ontoMap = [
((Predicate)Mut):dataroot+"165.onto-wbpg.db.Mut.txt",
((Predicate)Sub):dataroot+"165.onto-wbpg.db.Sub.txt",
((Predicate)RSub):dataroot+"165.onto-wbpg.db.RSub.txt",
((Predicate)Domain):dataroot+"165.onto-wbpg.db.Domain.txt",
((Predicate)Inv):dataroot+"165.onto-wbpg.db.Inv.txt",
((Predicate)Range2):dataroot+"165.onto-wbpg.db.Range2.txt",
((Predicate)RMut):dataroot+"165.onto-wbpg.db.RMut.txt"];
KGIUtils.loadPredicateAtoms(data, ontoMap, ontology)
/*** Load seed atoms ***/
Partition seeds = DataStore.getPartition("20");
def seedMap = [((Predicate)Cat):dataroot+"seed.165.cat.uniq.out",
((Predicate)Rel):dataroot+"seed.165.rel.uniq.out"];
KGIUtils.loadPredicateAtomsWithValue(data, seedMap, seeds)
/*** Load entity resolution atoms ***/
Partition entity_resolution = DataStore.getPartition("30");
def erMap = [((Predicate)SameEntity):dataroot+"NELL.08m.165.cesv.csv.SameEntity.out"]
KGIUtils.loadPredicateAtomsWithValue(data, erMap, entity_resolution)
/*** Load training atoms ***/
Partition training = DataStore.getPartition("40");
def trainMap = [((Predicate)Cat):dataroot+"label-train-uniq-raw-cat.db.TRAIN",
((Predicate)Rel):dataroot+"label-train-uniq-raw-rel.db.TRAIN"];
KGIUtils.loadPredicateAtomsWithValue(data, trainMap, training)
/*** Load candidate atoms ***/
Partition candidates = DataStore.getPartition("50");
Partition candidates_nosource = DataStore.getPartition("55");
def predCatMap = [((Predicate)CandCat_CBL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CBL.out",
((Predicate)CandCat_CMC):dataroot+"NELL.08m.165.cesv.csv.CandCat_CMC.out",
((Predicate)CandCat_CPL):dataroot+"NELL.08m.165.cesv.csv.CandCat_CPL.out",
((Predicate)CandCat_General):dataroot+"NELL.08m.165.cesv.csv.CandCat_General.out",
((Predicate)CandCat_Morph):dataroot+"NELL.08m.165.cesv.csv.CandCat_Morph.out",
((Predicate)CandCat_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandCat_SEAL.out",
((Predicate)PattCat):dataroot+"NELL.08m.165.cesv.csv.PattCat.out",
((Predicate)PromCat_General):dataroot+"NELL.08m.165.esv.csv.PromCat_General.out"]
def predRelMap = [((Predicate)CandRel_CBL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CBL.out",
((Predicate)CandRel_CPL):dataroot+"NELL.08m.165.cesv.csv.CandRel_CPL.out",
((Predicate)CandRel_General):dataroot+"NELL.08m.165.cesv.csv.CandRel_General.out",
((Predicate)CandRel_SEAL):dataroot+"NELL.08m.165.cesv.csv.CandRel_SEAL.out",
((Predicate)PattRel):dataroot+"NELL.08m.165.cesv.csv.PattRel.out",
((Predicate)PromRel_General):dataroot+"NELL.08m.165.esv.csv.PromRel_General.out"];
def predNoSourceMap = [((Predicate)CandCat):dataroot+"NELL.08m.165.cesv.csv.CandCat.out",
((Predicate)CandRel):dataroot+"NELL.08m.165.cesv.csv.CandRel.out"];
KGIUtils.loadPredicateAtomsWithValue(data, predCatMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predRelMap, candidates)
KGIUtils.loadPredicateAtomsWithValue(data, predNoSourceMap, candidates_nosource)
System.out.println("[info] data loading finished")
Date stop = new Date();
TimeDuration td = TimeCategory.minus( stop, start );
System.out.println td;
Any suggestions in this regard will be highly appreciated.
java maven class groovy psl
java maven class groovy psl
asked Nov 13 '18 at 7:45
Nayantara JeyarajNayantara Jeyaraj
1,75231539
1,75231539
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276135%2funable-to-resolve-class-emptybundle-in-groovy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276135%2funable-to-resolve-class-emptybundle-in-groovy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown