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模块 ...
随机推荐
- Windows 8获取开发者账户
使用PowerShell获取开发者账户,可以在本地调试Metro APP C:\PS> Show-WindowsDeveloperLicenseRegistration //安装licence ...
- php 换行 PHP_EOL变量
一个小小的换行,其实在不同的平台有着不同的实现,为什么要这样,可以是世界是多样的. 本来在unix世界换行就用/n来代替,但是windows为了体现他的不同,就用/r/n,更有意思的是在mac中用/r ...
- (转)CWnd与HWND的区别与转换
一.区别HWND是句柄,CWnd是MFC窗体类,CWnd中包含HWND句柄成员对象是m_hWnd.HWND是Windows系统中对所有窗口的一种标识,即窗口句柄.这是一个SDK概念. CWnd是M ...
- XE7 - 升级及初步使用
春节没抢到回家的票,正好有时间把Delphi2010升级到了XE7. 用了快一个月了,今天算是补记. 安装包用了lsuper大侠整理的lsuper.XE7.Update1.v10.1.拜谢!比较顺利的 ...
- Activity传递对象的方法
//Serializeable传递对象的方法 public void SerializeMethod(){ Person mPerson = new Person(); mPerson.setName ...
- 2015-10-09 Fri 晴 加快进度看书
最近老感觉每天不够用,每天7点起来,吃饭完了8点开始看书,不知道是我看书太慢了还是时间过得真的很快,不知不觉中午就到了.而这个时候我才看2章的内容,下午能多看3章内容.一本书也就一天的时候,而我现在还 ...
- 《C和指针》读书笔记 第2章-基本概念
原创文章,转载请注明出处:http://www.cnblogs.com/DayByDay/p/3936485.html
- windows下mysql 数据库的导入导出
1.以.sql方式方式导入导出 http://www.360doc.com/content/11/0114/11/2905268_86441355.shtml 2.以.txt方式导入导出 http:/ ...
- ViewPager 滑动页(四)
需求:在ViewPager 滑动页(三) 基础上,减少界面层级. 效果图: 图层数变更前: 图层数变更后: 主要代码实现: <?xml version="1.0" encod ...
- mysql的text类型长度问题
在我的概念中,mysql中的text字段应该是没有长度限制的,但是今天事实告诉我,text类型的长度是有限制的.其中mysql的text类型有64K长度限制的,MEDIUMTEXT中型是2G,LONG ...