WEB数据挖掘(十六)——Aperture数据抽取(9):数据源
One of the central concepts of Aperture is the notion of a DataSource. A DataSource contains all information necessary to locate the individual information resources in a physical source. For example, a FileSystemDataSource holds a root directory, a set of patterns that describe what files to include or exclude, a maximum depth, etc., thereby effectively describing a set of files.
One of the main purposes of a DataSource is to hold all data needed by a Crawlers
to crawl the physical source and retrieve all the individual resources
in it. There are quite a few DataSource subclasses in Aperture. The
following diagram contains a selection of them.

The specific DataSource implementations available at the moment contain
specific 'get' and 'set' methods for the configuration properties
accepted by the data source. Thus providing a convenient interface and
abstracting from the underlying RDF properties. All configuration data
is stored in a RDFContainer. Each data source type comes with it's own
specific properties. There is also a set of generic properties used by
many data source types (username, password etc.). You can have a look at
the source code of the DataSource implementation class of your choosing
to see which properties are used. Note that the data source classes are
not stored in the SVN. They are generated automatically from an RDF
file with the description of the class. (like this one). The classes are generated by a maven plugin, by adding appropriate entries in the datasource module pom.xml file similar to these.
If you'd like to develop your own data source implementation, try to
mimic the existing implementations or ask at the aperture-devel for
help.
It is worth mentioning, that DataSource classes only DESCRIBE a data
source. They don't contain any resources that would enable direct access
to the source (such as InputStreams, or Readers, whatever...). (At
least it was not the intention of the designers). Any such resource is
obtained by the crawler at the start of crawl and may be encapsulated in
a DataObject returned by an Accessor or crawler. The following code
demonstrates how to create and configure a FileSystemDataSource:
// determine the root folder of the source
File rootFolder = new File("D:\\path\\to\\the\\root\\folder");
// create the model that will store the data source configure
Model model = RDF2Go.getModelFactory().createModel();
// don't forget to open it before use
model.open();
// determine a URI to identify the DataSource
URI id = model.createURI("urn:test:testsource");
// wrap the model in an RDFContainer
RDFContainer configuration = new RDFContainerImpl(model,id);
// create the DataSource instance
FileSystemDataSource source = new FileSystemDataSource();
// set the configuration (it is empty at the moment)
source.setConfiguration(configuration)
// and set the rootFolder (you can do it now)
source.setRootFolder(rootFolder.getAbsolutePath());
WEB数据挖掘(十六)——Aperture数据抽取(9):数据源的更多相关文章
- WCF技术剖析之十六:数据契约的等效性和版本控制
原文:WCF技术剖析之十六:数据契约的等效性和版本控制 数据契约是对用于交换的数据结构的描述,是数据序列化和反序列化的依据.在一个WCF应用中,客户端和服务端必须通过等效的数据契约方能进行有效的数据交 ...
- Spring MVC 使用介绍(十六)数据验证 (三)分组、自定义、跨参数、其他
一.概述 除了依赖注入.方法参数,Bean Validation 1.1定义的功能还包括: 1.分组验证 2.自定义验证规则 3.类级别验证 4.跨参数验证 5.组合多个验证注解 6.其他 二.分组验 ...
- java web 学习十六(JSP指令)
一.JSP指令简介 JSP指令(directive)是为JSP引擎而设计的,它们并不直接产生任何可见输出,而只是告诉引擎如何处理JSP页面中的其余部分. 在JSP 2.0规范中共定义了三个指令: pa ...
- .NET面试题系列(十六)数据库面试题
数据库事务的四大特性 原子性(Atomicity) 原子性是指事务包含的所有操作要么全部成功,要么全部失败回滚.因此事务的操作如果成功就必须要完全应用到数据库,如果操作失败则不能对数据库有任何影响. ...
- MapReduce(十六): 写数据到HDFS的源代码分析
1) LineRecordWriter负责把Key,Value的形式把数据写入到DFSOutputStream watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZ ...
- WCF技术剖析之十五:数据契约代理(DataContractSurrogate)在序列化中的作用
原文:WCF技术剖析之十五:数据契约代理(DataContractSurrogate)在序列化中的作用 [爱心链接:拯救一个25岁身患急性白血病的女孩[内有苏州电视台经济频道<天天山海经> ...
- Kali Linux Web 渗透测试视频教程— 第十六课-拒绝服务攻击
Kali Linux Web 渗透测试视频教程— 第十六课-拒绝服务攻击 文/玄魂 目录 Kali Linux Web 渗透测试视频教程— 第十六课-拒绝服务攻击................... ...
- ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案 try.dot.net 的正确使用姿势 .Net NPOI 根据excel模板导出excel、直接生成excel .Net NPOI 上传excel文件、提交后台获取excel里的数据
ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案 ASP.NET Core 从2.2版本开始,采用了一个新的名为Endpoint的路由方案,与原来的方案在使用上差别不 ...
- 第三百三十六节,web爬虫讲解2—urllib库中使用xpath表达式—BeautifulSoup基础
第三百三十六节,web爬虫讲解2—urllib库中使用xpath表达式—BeautifulSoup基础 在urllib中,我们一样可以使用xpath表达式进行信息提取,此时,你需要首先安装lxml模块 ...
随机推荐
- BZOJ 2151 种树
贪心+priority_queue. #include<iostream> #include<cstdio> #include<cstring> #include& ...
- 使用过的Linux命令
1 在vim中编辑python,由于tab是8个空格,然而python中是4个,需要替换 :%s/\t/ /g 2 tar tar -czvf topic_dt_poi.0801.0818.ta ...
- A. Puzzles CodeForces Round #196 (Div.2)
题目的大意是,给你 m 个数字,让你从中选 n 个,使得选出的数字的极差最小. 好吧,超级大水题.因为要极差最小,所以当然想到要排个序咯,然后去连续的 n 个数字,因为数据不大,所以排完序之后直接暴力 ...
- 【转】shell脚本调试(bash trap support bashdb )
原文网址:http://zhu8337797.blog.163.com/blog/static/170617549201122512712136/ 命 令 选 项 功 能 bash –x 脚本名 回显 ...
- Android RecyclerView使用详解(一)
一.前言 RecyclerView是谷歌V7包下新增的控件,用来替代ListView的使用,在RecyclerView标准化了ViewHolder类似于ListView中convertView用来做视 ...
- JS面向对象组件(四) -- 面向对象的继承
什么是继承 •在原有对象的基础上,略作修改,得到一个新的对象 •不影响原有对象的功能 //父类 createPerson function createPerson(name,sex){ this.n ...
- nodejs简单层级结构配置文件
在NodeJS中使用配置文件,有几种比较不错的方案:第一种:文件格式使用json是毋容置疑的好方案.格式标准,易于理解,文件内容读取到内存之后,使用JSON的标准分析函数即可得到配置项.第二种:将配置 ...
- git 创建一个新分支,并将一个分支内容复制给创建的新分支
git checkout -b newBranchName
- 使用Jquery Mobile设计Android通讯录
本系列教程将指导大家一步步使用Jquery Mobile设计一个Android的通讯录应用.其中在应用的界面部分,将使用jQuery Mobile框架,并且会指导大家如何使Android中提供的web ...
- 数组排序,字符串math,replace练习
1. 关于数组排序 排序一直是程序设计中的热门话题.在js中,数组有个sort()方法.在不传参数默认情况下,数组的sort()方法原理是:对数每项调用toString()方法,比较字符串按升 ...