用于从RDF/XML网页中提取URI的解析器,用于Java中的web爬虫

用于从RDF/XML网页中提取URI的解析器,用于Java中的web爬虫,xml,parsing,web-crawler,rdf,linked-data,Xml,Parsing,Web Crawler,Rdf,Linked Data,我正在为链接数据构建一个网络爬虫。我通过以下代码区分了HTML和RDF/XML页面: public static int checktype(URL url) throws IOException { String contentType = ((HttpURLConnection) url.openConnection()).getContentType(); System.out.println("Website is read"); int t=0; if("text/html".equ

我正在为链接数据构建一个网络爬虫。我通过以下代码区分了HTML和RDF/XML页面:

public static int checktype(URL url) throws IOException
{
String contentType = ((HttpURLConnection) url.openConnection()).getContentType();
System.out.println("Website is read"); 
int t=0;
if("text/html".equals(contentType)) {t=0;}
else if("application/rdf+xml".equals(contentType)) {t=1;}
System.out.println(contentType);
return t;
}


现在我想用RDF/XML数据解析一个web页面,以从该页面提取所有URI。我能够找到HTML解析器,但不能找到链接数据。请进一步帮助我查看。它包含一个。

例如,您最好使用现有的库,该库已经提供了自动区分不同格式的代码和所有格式的解析器