无法在Groovy中解析类EmptyBundle

时间:2018-11-13 07:45:54

标签: java maven class groovy psl

我正在尝试运行此Knowledge Graph Evaluation project。由于maven存储库的迁移,我不得不对pom.xml依赖项和其他文件进行一些修改。现在遇到以下错误。

  

[错误] / home / manuelanayantarajeyaraj / Documents /知识提取/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy:[62,89] 1. / home /中的错误manuelanayantarajeyaraj /文档/知识提取/KnowledgeGraphIdentification/nell_lazy/src/main/java/org/linqs/psl/kgi/LoadData.groovy(第62行)       DataStore数据=新的RDBMSDataStore(新的H2DatabaseDriver(Type.Disk,'./psl',true),新的EmptyBundle());

     

^^^^^^^^^^^^

     

Groovy:无法解析类EmptyBundle

在以下规格下运行的程序。  -Apache Maven 3.3.9  -Maven主页:/ usr / share / maven  -Groovy 2.5.4  -Java版本:1.8.0_181,供应商:Oracle Corporation  -Java主页:/ usr / lib / jvm / java-8-openjdk-amd64 / jre

我试图弄清楚如何解决此错误,但没有任何运气。

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] \t\tDECLARING 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;

在这方面的任何建议将受到高度赞赏。

0 个答案:

没有答案