存档

2010年1月 的存档

ESWC 2010 Workshop on Ontology Repositories and Editors for the Semantic Web

2010年1月21日

ORES 2010 – Call for papers and system descriptions -
http://www.ontologydynamics.org/od/index.php/ores2010/
Heraklion, Greece – Deadline: March 1, 2010

The growing number of online ontologies makes the availability of ontology repositories, in which ontology practitioners can easily find, select and retrieve reusable components, a crucial issue. The recent emergence of several ontology repository systems is a further sign of this. However, in order for these systems to be successful, it is necessary to provide a forum for researchers and developers to discuss features and exchange ideas on the realization of ontology repositories in general and to consider explicitly their role in the ontology lifecycle. In addition, it is now critical to achieve interoperability between ontology repositories, through common interfaces, standard metadata formats, etc. ORES10 intends to provide such a forum.

Illustrating the importance of the problem, significant initiatives are now emerging. One example is the Open Ontology Repositories (OOR) working group set up by the Ontolog community. Within this effort regular virtual meetings are organized and actively attended by ontology experts from around the world; The Ontolog OOR 2008 meeting was held at the National Institute for Standards in Technology (NIST), generating a joint communiqué outlining requirements and paving the way for collaborations. Another example is the Ontology Metadata Vocabulary (OMV) Consortium, addressing metadata for describing ontologies. Despite these initial efforts, ontology repositories are hardly interoperable amongst themselves. Although sharing similar aims (providing easy access to Semantic Web resources), they diverge in the methods and techniques employed for gathering these documents and making them available; each interprets and uses metadata in a different manner. Furthermore, many features are still poorly supported, such as modularization and versioning, as well as the relationship between ontology repositories and ontology engineering environments (editors) to support the entire ontology ifecycle.

Submitting papers and system descriptions

We want to bring together researchers and practitioners active in the design, development and application of ontology repositories, repository-aware editors, modularization techniques, versioning systems and issues around federated ontology systems. We therefore encourage the submission of research papers, position papers and system descriptions discussing some of the following questions:

* How can ontology repositories “talk” to each other?
* How can the abundant and complex knowledge contained in an ontology repository be made comprehensible for users?
* What is the role of ontology repositories in the ontology lifecycle?
* How can branching and versioning be managed in and across ontology repositories?
* How can ontology repositories interoperate with ontology editors, and other applications and legacy systems?
* How can connections across ontologies be managed within and across ontology repositories?
* How can modularity be better supported in ontology repositories and editors?
* How can ontology repositories and editors use distributed reasoning?
* How can ontology repositories support corporate, national and domain specific semantic infrastructures?
* How do ontology repositories support novel semantic applications?
* What measurements for describing and comparing ontologies can we use? How could ontology repositories use these?

大杂烩

用jena api来理解RDFS——subClassOf subPropertyOf range domain

2010年1月9日

这四个词汇与推理密切相关,查看JENA的RDFSRuleReasonerFactory可以看到里面有这么一段代码:

  1. Resource base = capabilities.createResource(getURI());
  2. base.addProperty(ReasonerVocabulary.nameP, "RDFS FB-TGC Rule Reasoner")
  3. .addProperty(ReasonerVocabulary.descriptionP, "Complete RDFS implementation supporting metalevel statements.\nCan separate tbox and abox data if desired to reuse tbox caching or mix them.")
  4. .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf)
  5. .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf)
  6. .addProperty(ReasonerVocabulary.supportsP, RDFS.member)
  7. .addProperty(ReasonerVocabulary.supportsP, RDFS.range)
  8. .addProperty(ReasonerVocabulary.supportsP, RDFS.domain)
  9. .addProperty(ReasonerVocabulary.versionP, "0.1");

说明jena对其提供了支持。

subPropertyOf
如果张三养了一只狗,那么一定可以推理出张三养了一只宠物,因此养狗和有宠物是subPropertyOf关系。

  1. String ns = "htpp://www.crabone.com#";
  2.  
  3. Model model = ModelFactory.createDefaultModel();
  4.  
  5. // 养狗subPropertyOf有宠物
  6. Property hasPet = model.createProperty(ns, "有宠物");
  7. Property hasDog = model.createProperty(ns, "养狗");
  8. model.add(hasDog, RDFS.subPropertyOf, hasPet);
  9.  
  10. // 张三养了一只狗叫汪汪
  11. model.createResource(ns+"张三").addProperty(hasDog, "汪汪");
  12.  
  13. // 得到JENA内置的RDFS推理机
  14. Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
  15.  
  16. // 用原来的图和推理机构造出新的推理图
  17. InfModel infModel = ModelFactory.createInfModel(reasoner, model);
  18.  
  19. System.out.println(infModel.getResource(ns+"张三").getProperty(hasPet));

输出:[htpp://www.crabone.com#张三, htpp://www.crabone.com#有宠物, "汪汪"]
从代码来看,jena的推理是基于图的相关算法来实现的。subClassOf和其道理一样,这里就不啰嗦了。

domain、range

个人感觉这是推理性非常强的一种机制!在protege入门里面就有相关的解释。domain和range是用来描述一个property的,比如:拿养狗这个property来说,一般,只有人才会养狗,水瓶是不会养狗的,电插座也是不会养狗的,所以养狗这个property的domain是(一种class),同样养狗这个property的range是(一种class)。当推理机知道这些道理后,告诉它,张三养了一只汪汪,那么,这个推理机能推理出,张三是人,汪汪是狗。

  1. String ns = "htpp://www.crabone.com#";
  2.  
  3. Model model = ModelFactory.createDefaultModel();
  4.  
  5. // 构造人这个类
  6. Resource personClass = model.createResource(ns+"");
  7. model.add(personClass, RDF.type, RDFS.Class);
  8.  
  9. // 构造狗这个类
  10. Resource dogClass = model.createResource(ns+"");
  11. model.add(dogClass, RDF.type, RDFS.Class);
  12.  
  13. // 构造养狗这个属性,并设置domain是人,range是狗
  14. Property hasDog = model.createProperty(ns, "养狗");
  15. model.add(hasDog, RDFS.domain, personClass);
  16. model.add(hasDog, RDFS.range, dogClass);
  17.  
  18. // 添加张三养了一条狗汪汪这个事实
  19. Resource zhangsan = model.createResource(ns+"张三");
  20. Resource wangwang = model.createResource(ns+"汪汪");
  21. zhangsan.addProperty(hasDog, wangwang);
  22.  
  23. // 构造RDFS推理机
  24. Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
  25.  
  26. // 生成推理图
  27. InfModel infModel = ModelFactory.createInfModel(reasoner, model);
  28.  
  29. System.out.println(infModel.getResource(ns+"张三").getProperty(RDF.type));
  30. System.out.println(infModel.getResource(ns+"汪汪").getProperty(RDF.type));

输出:
[htpp://www.crabone.com#张三, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, htpp://www.crabone.com#人]
[htpp://www.crabone.com#汪汪, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, htpp://www.crabone.com#狗]
总结:domain和rang其实也是一种property;domain这个property用来连接property和class,range这个property用来连接property和class,这是w3的标准,其实在JENA里面比较宽松,domain这个property用来连接property和节点即可,range也是如此。

JENA

记录一些杂事

2010年1月8日

惠普实验室停止支持JENA开发
HPLabs management have decided not to continue with an active programme of Semantic Web research at HPL. Members of the Semantic Web research group are moving to other roles, both inside and outside HP: please consult personal blogs and similar sources for revised contact details.

The Jena platform and associated development projects remain open source under the liberal BSD-style license. With HP’s support, we are in the process of transferring ownership of the copyright of the code from HP to a commercially neutral body. There is no change for individuals or companies using Jena, and the move will make it easier to continue and expand the core developer community. Indeed it will enable us to accept contributions more easily. Many current members of the Jena team will remain involved in further enhancements to the Jena codebase, and supporting the user community via the jena-dev email list. The Jena source code remains at SourceForge, and the new web address for Jena is www.openjena.org.

We would like to thank all of the various research groups, customers, Jena users and individual contributors we have worked with over the years as we have built the Jena platform to its current state. We look forwards to future enhancements to Jena’s capability, and to helping to create other exciting developments in Semantic Web technologies and products.

The HP Semantic Web Team – October 2009

同样,2009年8月,http://www.co-ode.org/blog/ 上面宣布CO-ODE工程宣告结束:

After several extensions and ripping through many different project members the CO-ODE project has finally reached the end (sob).

We think it has been very successful:

1、Protege 4 is now in very good shape and is fully released
2、Loads of plugins are available and we’ve got some brilliant contributions from the community
3、Tutorials shall continue to come out of Manchester on a regular basis
4、Protege 4.1 is in its early stages, but already available as a preview to be taken on by Stanford
5、Lots of people can now say they are ontology engineers

Thankyou to all the people involved. And thankyou to JISC for funding the project.

Now, I’m off for a break from ontologies for a few months(!)

Nick (and the rest of the former CO-ODE team)

斯坦福的WEB版本体编辑器WebProtege越做越强,未来将会向面向服务架构靠拢

NTK 2.3 Pre-Release全面支持OWL 2,基于OWL-API开发

JENA

OWL 2 词汇全貌

2010年1月6日

首先介绍4个OWL 2词汇需要用到的预定义命名空间

  • rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
  • rdfs: http://www.w3.org/2000/01/rdf-schema#
  • owl: http://www.w3.org/2002/07/owl#
  • xsd: http://www.w3.org/2001/XMLSchema#

定义类,有以下几种方式:
1.直接取名字,这是用的最多的方法
用RDF/XML-ABBREV语法表达如下:
<owl:Class rdf:about=”#crab”/>

2.集合类,通过几种类组合创造出一个新的类
比如:有一个类,它是“女人”和“有孩子的”这2个类取交集,所得到的类(这个类可以等价于“母亲”)
用RDF/XML-ABBREV语法表达如下:
<owl:Class rdf:about=”#母亲”>
 <owl:equivalentClass>
  <owl:Class>
  <owl:intersectionOf rdf:parseType=”Collection”>
   <rdf:Description rdf:about=”#女人” />
   <owl:Restriction>
   <owl:onProperty rdf:resource=”#有孩子” />
   <owl:someValuesFrom rdf:resource=”#人” />
   </owl:Restriction>
  </owl:intersectionOf>
  </owl:Class>
 </owl:equivalentClass>
</owl:Class>

上面介绍的是owl:intersectionOf,它代表交集,所有的集合表达方式如下:
_:x owl:intersectionOf ( C1 … Cn ). 交集 protege中使用“and”
_:x owl:unionOf ( C1 … Cn ). 并集 protege中使用“or”
_:x owl:complementOf C. 补集 并集 protege中使用“not”

3.枚举类,通过一系列的个体(individual)所描绘的一种类
比如:“文一美食店”这个类,是由很多在文一路的美食店所组成的一个类
  <owl:Class rdf:about=”#饭店”/>
  <owl:Class rdf:about=”#文一美食店”>
    <owl:oneOf rdf:parseType=”Collection”>
      <j.0:饭店 rdf:about=”#半亩地”/>
      <j.0:饭店 rdf:about=”#一席地”/>
      <j.0:饭店 rdf:about=”#老山东牛杂”/>
    </owl:oneOf>
  </owl:Class>
需要注意的是,该类并非由其他类所构成,而是由一系列的个体(individual)构成,语法如下:
_:x owl:oneOf ( a1 … an ). protege中使用 {}

4.限制类,这个翻译来源于Object(Datatype) Property Restrictions,这种定义类的方式听起来很别扭,但在现实生活中确实需要如此去表达,比如:很富有的人、有2个孩子的父亲,这些都是可以表达成类的。看一个用RDF/XML-ABBREV语法表达的例子:
  <owl:Class rdf:about=”#奶茶店”>
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:someValuesFrom>
          <owl:Class rdf:about=”#奶茶”/>
        </owl:someValuesFrom>
        <owl:onProperty rdf:resource=”#出售”/>
      </owl:Restriction>
    </owl:equivalentClass>
  </owl:Class>

上面需要表达的意思:奶茶店等价于这样的一个类,这个类叫“出售一些奶茶的”。对于现实中的例子就是,奶茶店是卖奶茶的。在这里,我们发现,“出售一些奶茶的”这本身就是一种类,这种类就是所谓的限制类。限制类的定义方法有很多,在JENA中,我们会发现OntClass有一个子接口Restriction,而Restriction接口下面又衍生出

  1. SomeValuesFromRestriction
  2. AllValuesFromRestriction
  3. HasValueRestriction
  4. MaxCardinalityQRestriction
  5. MinCardinalityQRestriction
  6. CardinalityQRestriction
  7. MaxCardinalityRestriction
  8. MinCardinalityRestriction
  9. CardinalityRestriction

我们逐一解释:
1、已经介绍了
2、这家奶茶店只卖奶茶,出售这个属性所跟的所有个体全部属于奶茶(AllValuesFrom)
关于SomeValuesFrom和AllValuesFrom有很多话题可以聊,具体看其他文章
3、这个和前面2者不同,前面2者属性后面需要跟,而这个属性后面必须跟个体,出售拿破仑戒指的古董店,拿破仑戒指是戒指一个个体,不是一个类,这里把有出售拿破仑戒指的这些古董店合起来称为一个类
4、最多出售一种品牌的店叫专卖店
5、最少有两家分店的店可以叫做连锁店
6、精确的定义到数字
7、8、9和4、5、6非常类似,区别在于,属性后面可以不跟,4、5、6是OWL 2新增的内容

另外,OWL 2又多了一种限制类,叫做ObjectHasSelf,具有自反性质,比如:爱自己的人可以称为自恋的人,这个在protege和jena里面都还没有实现。上面9个方式可以基于Object Property来描述的,同样也可以基于Data Property来描述。不过OWL-API分的跟细致,将Object Property Restrictions和Data Property Restrictions分开实现了,有新兴趣的朋友可以去比较比较。

语义网

年初杂谈

2010年1月5日

人,活着,为了什么?
每天都在摆摊卖水果的女人可能为了养活孩子
单位打工的白领可能为了买房、结婚、生子
富裕的人可能为了更多的消遣
立志的人可能为了理想
如果我们用5WHY法则画出鱼骨头,估计归根到底就是人的欲望,说破烂点,就是贪欲,说本质点,就是动物本能。
如果欲望达到了预期的目标,人会开心,会惬意,会去共享,会去文化传承,物质始终会枯竭,只有文化生生不息,文化激发更多的欲望,欲望灿烂出更多的文化。

人,活着,为什么要害怕?
可能因为自身的脆弱,所以会在别人还没有攻击之前,已有了防人意识
可能因为害怕失去,所以会在还没有失去之前拼命捍卫
可能因为达不到目标,所以会无意识将目标砍掉或者虚设

人,活着,为什么要攀比?
可能因为自身触手可及却偏偏没有得到的那份心有不甘
可能因为自身的口德行德激发了他人的欲望
可能因为要发泄压抑已久的欲望

如果将上面那些垃圾言论全部净化,独善其身,大彻大悟,玩转人生,可谓心胸海纳百川之人

=================无语的分割线=====================

什么是本体?

这是哲学的概念……GHJT@#T^#@&*!@!UIGJHJ
某某老外发言……&*@……#IUGH#HG!GIU#Y#*7

话说当年上帝害怕通天塔,于是让人们有了不同的语言,不同的思维,不同的个性,于是,通天塔倒了

人们只有使用统一的语言,才能相互交流,只有使用同一种概念,才能对一个事物达成共识

本体,就是这样的一种工具,让领域与领域之间的人们对一个事物达成共识

如果大家都运用本体对万事万物进行建模,通过相互沟通,达成一致,最终将这些数据朝贡给造物主,那么造物主将会通晓万事万物,如果他愿意为人们提供服务,那么他的脑子就是语义网

终有一天,通天塔再次完工,但这次,人们的本能可能会毁了这一切……

大杂烩

用jena api来理解RDF——三元组

2010年1月1日

JENA中有一个最底层的接口:RDFNode,它代表RDF这张巨大图中的节点,这个节点可以是一个资源,可以是一个字符窜或者数字。因此它对应与2个子接口:
interface Literal extends RDFNode
interface Resource extends RDFNode
Literal接口代表了一些原始类型节点,比如:32位整型、布尔型等等。
Resource接口还可以继续衍生出2个重要的接口:
interface Container extends Resource
interface Property extends Resource
Container接口就对应了RDF的容器表达能力,里面有bag,seq,alt
Property接口就是所谓的资源属性了

在RDF的世界中,其实描述资源只有一种方式,那就是三元组,包括:主体(subject),谓词(predicate),客体(object)。主体和客体就是图中的2个节点,谓词就是一条边。这三元组在JENA中用Statement接口来描述,该接口中有下面3个方法:
public Resource getSubject();
public Property getPredicate();
public RDFNode getObject();

我们可以发现,主体一定是一种资源,不可能是一个Literal原始类型,因此主体必定属于Resource接口实现,但是客体可以是原始类型,比如:人有2条腿。为主体;为谓词;2为客体。

用一个例子来巩固下:

  1. <?xml version="1.0"?>
  2.  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  3.           xmlns:s="http://example.org/students/vocab#">
  4.  
  5.     <rdf:Description rdf:about="http://example.org/courses/6.001">
  6.        <s:students>
  7.           <rdf:Bag>
  8.              <rdf:li rdf:resource="http://example.org/students/Amy"/>
  9.              <rdf:li rdf:resource="http://example.org/students/Mohamed"/>
  10.              <rdf:li rdf:resource="http://example.org/students/Johann"/>
  11.              <rdf:li rdf:resource="http://example.org/students/Maria"/>
  12.              <rdf:li rdf:resource="http://example.org/students/Phuong"/>
  13.           </rdf:Bag>
  14.        </s:students>
  15.     </rdf:Description>
  16.  </rdf:RDF>

如果要一下子看出这个RDF中有几个三元组,一定不是很方便吧?如果用图来表示:
201001011021
是不是非常清晰呢?图中有一个主体http://example.org/courses/6.001,它有一条边http://example.org/students/vocab#students,对应的客体就是那个空节点。同理还有这个空节点所对应的那些三元组。用JENA来解析这个例子:

  1. Model model = ModelFactory.createDefaultModel();
  2.  
  3. model.read(new FileInputStream("student.rdf"), null);
  4.  
  5. StmtIterator  it = model.listStatements();
  6.  
  7. while(it.hasNext())
  8. {
  9.     System.out.println(it.next());
  10. }

打印的结果如下:
[http://example.org/courses/6.001, http://example.org/students/vocab#students, -23ba78ea:125e9da42c8:-8000]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#_5, http://example.org/students/Phuong]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#_4, http://example.org/students/Maria]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#_3, http://example.org/students/Johann]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#_2, http://example.org/students/Mohamed]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#_1, http://example.org/students/Amy]
[-23ba78ea:125e9da42c8:-8000, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag]

JENA ,