1

次の名前のクラスがあるという点で、rdfクローラーを使用しています。

import edu.unika.aifb.rdf.crawler.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.util.FileManager;

これらはエラーと呼ばれるクラスファイルであり、jena パッケージで試してみましたが、添付していましたが、変更はありません。

アップデート:

完全なSampleCrawl.javaクラスのコンテンツ:

import java.util.*;
import edu.unika.aifb.rdf.crawler.*;

/**
 * Call this class with 3 arguments - URL to crawl to,
 * depth and time in seconds
 */

public class SampleCrawl {

    /**
     * @param uRI
     * @param depth
     * @param time
     */
    @SuppressWarnings("rawtypes")
    public SampleCrawl(Vector uRI, Vector hf, int depth, int time){

        // Initialize Crawling parameters
        CrawlConsole c = new CrawlConsole(uRI,hf,depth,time);

        // get an ontology file from its local location
        // (OPTIONAL)
        c.setLocalNamespace("http://www.daml.org/2000/10/daml-ont","c:\\temp\\rdf\\schemas\\daml-ont.rdf");

        // set all the paths to get all the results
        c.setLogPath("c:\\temp\\crawllog.xml");
        c.setCachePath("c:\\temp\\crawlcache.txt");
        c.setModelPath("c:\\temp\\crawlmodel.rdf");

        try{
            // crawl and get RDF model
            c.start();

            // This writes all three result files out
            c.writeResults();
        }catch(Exception e){
        }
    }

    /**
     * @param args
     * @throws Exception
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static void main(String[] args) throws Exception {

        if (args.length != 3) {
            System.err.println("Usage: java  -cp  [JARs]  SampleCrawl  [URL]  [depth:int]  [time:int]");
            System.exit(0);
        }

        Vector uris = new Vector();
        uris.add(args[0]);

        // no host filtering - crawl to all hosts
        Vector hostfilter = null;

        /* You may want to do something else to enable host filtering:
         * Vector hostfilter = new Vector();
         * hostfilter.add("http://www.w3.org");
         */

        int depth = 2;
        int time = 60;
        try {
            depth = Integer.parseInt(args[1]);
            time = Integer.parseInt(args[2]);
        }
        catch (Exception e) {
            System.err.println("Illegal argument types:");
            System.err.println("Argument list: URI:String  depth:int  time(s):int");
            System.exit(0);
        }
        new SampleCrawl(uris,hostfilter,depth,time);
    }
}

質問:ここでエラーが発生する場合
の追加方法import edu.unika.aifb.rdf.crawler.;

4

1 に答える 1

2

インポートしようとしているパッケージをググったところ、Kaon を使用しているようです。そうであると仮定すると、インポート宣言に誤りがあります。あなたが持っている:

import edu.unika.aifb.rdf.crawler.*;

一方、SourceForge で利用可能なダウンロードには次のものが必要です。

import edu.unika.aifb.rdf.rdfcrawler.*;

余談ですが、「Kaonさんのrdfcrawlerを…から使おうと思っています」などの情報を質問に含めていただけると助かります。それ以外の場合は、セットアップの重要な詳細を推測する必要があります。

于 2011-05-08T12:35:33.910 に答える