OWL API, Jena API, Protege API, which one to use

https://stackoverflow.com/questions/17567771/owl-api-jena-api-protege-api-which-one-to-use

Though this question is probably off-topic for StackOverflow, it's still an important question in general, so here are some general thoughts about the difference between the Jena API and the OWL API that, even if they don't make you prefer one over the other, might give you a better idea of what you're getting into in either case. I'm marking it community wiki so that others can update this, too.

The relationship between OWL and RDF

RDF is a graph-based representation format. An RDF graph is a directed graph whose nodes are Resources (which can be anonymous, or identified by IRIs) and Literals, and whose edges are directed links identified by IRIs. This is amazingly simple, but because the identifiers are IRIs and can often be deferenced, also amazingly useful. There's really not much more to say about RDF, because this is all there is to it. It's very flexible, and you can represent just about anything.

OWL, although designed to be used in the Semantic Web, and thus with RDF data, is really a logical language that only incidentally happens to be related to RDF. An OWL ontology consists of a set of OWL axioms, some of which declare that certain identifiers refer to individuals, some of which assert relationships between individuals (and non-individual data, such as literals), some of which express the structure of classes, and so on. The utility of OWL arises from the fact that, like RDF, it uses IRIs as identifiers, but the logical structure could exists entirely separately from RDF. In fact, though OWL ontologies can be serialized using RDF and, indeed, this is probably the most common serialization used, OWL can also be serialized in OWL/XML, the OWL Functional Syntax, the Manchester OWL Syntax, and any other serialization format that someone invents. These formats tend to focus on the OWL-level constructs, and it is clearer that an ontology is a set of axioms.

The Jena API is RDF-centric

The Jena API is very firmly rooted in RDF. The basic concept is the Model (which is more primitive than the OntModel, which is used for doing more complicated OWL-related work) which provides a convenient API for constructing RDF graphs. Using Models, you'll create resources, add properties, and so on. Jena also includes a rules-based reasoner that is quite handy for working with RDF graphs.

Now, OWL can be serialized using RDF, so it's feasible to create a wrapper layer over an RDF graph so that you could say “create for me the class that is the intersection of A and B” and get back the resource identifying that class and transparently adding to the class whatever RDF triples are needed in the OWL serialization to assert that the new class is (equivalent to) the intersection of A and B. This is what the Jena OntModel API does. It does it in a generic way, which means that Jena can handle other ontology languages that can be serialized in RDF, too. Jena OntModels, at the time of writing, only support OWL1; new constructs introduced in OWL2 are not supported yet.

The fact that OWL-level constructs in Jena are simply wrappers over the RDF serialization means that rule-based reasoning is limited in what it can achieve. In particular, the Jena rule-based reasoners for OWL are logically incomplete (i.e., they can't infer everything that the OWL specs say should be inferred). They still do fairly well for day to day work, though. Jena does provide a Reasoner interface, which allows other (possibly non rule-based) reasoners, such as Pellet to be used.

The OWL API is OWL-centric

The OWL-API is OWL-centric, and you pretty much won't have to worry about RDF at all (aside from identifying things by IRIs and creating Literals as appropriate). Using the OWL API, you'll actually treat an ontology as a set of axioms rather than as a set of triples that happen to encode some axiom. If you're already familiar with the OWL specs, and are comfortable talking about things like ObjectPropertyAssertions, then you may find the OWL API a bit more natural.

The Protégé-OWL API is also OWL- and RDF(S)- centric

From The Protégé-OWL API Programmer's Guide:

The Protege-OWL API is an open-source Java library for the Web Ontology Language (OWL) and RDF(S). The API provides classes and methods to load and save OWL files, to query and manipulate OWL data models, and to perform reasoning based on Description Logic engines. Furthermore, the API is optimized for the implementation of graphical user interfaces.

The main page for the Protégé-OWL API also has some nice diagrams of the classes that it provides. The fullest one of these shows that there are classes for both RDF(S) and OWL entities.

Protégé-OWL (the tool, not the API) is a graphical ontology editor built on the top of the Protégé-OWL API. You can develop plugins for it, which might be the best alternative in your case.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值