OWL Guide as Notation3
From GetSemantic
Contents |
[edit] Status of this Document
This is an unofficial rewrite of the OWL Guide but using Notation3 instead of RDF/XML for examples. This is because Notation3 is a simpler way of hand-writing RDF in most cases, and there are a number of authors who do so. The use of RDF/XML in the original OWL Guide can be confusing since the XML syntax can get in the way of seeing the underlying model.
[edit] Namespace declarations
Any common namespace used in this document should be defined below using N3/SPARQL ("@prefix") notation:
@prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
For a full list of common RDF namespaces, see 100 Most Common RDF Namespaces.
[edit] Introduction
OWL is a component of the W3C's Semantic Web activity, and is a way of specifying extra ontological limitations, restrictions and requirements, as well as inferable information based on existing triples. For instance, you could use OWL to specify:
- A person may only list two biological parents.
- A person cannot be both a husband and a bachelor.
These examples show what are called in OWL cardinality and disjointness. A cardinality requirement is a specification of how many instances of a particular property there is, while a disjointness requirement is a specification that a resource cannot be another thing. So, if something has the the type 'bachelor', they cannot also have the type 'husband', since they are incompatible.
The level of specificity of OWL requirements should be based on the use case. It is not a good idea, for instance, to put many limits on data provided by a user. Limiting the number of friends a person may have, or even partners, may not scale to other cultures or societies. But in specific cases, it may be advisable to put strong limits on data - for instance, in ontologies for use in health or bio-science, far more specific ontologies may be appropriate than in more general ontologies for use on the wider Web.
[edit] Definitions
A class is a set which contains individuals and can have subclasses. For instance, we may define a class called Food and another class called Vegetable - a vegetable is a class of things, and all vegetables are food. As well as classes, we also have properties, of which there are two types: object properties and datatype properties.
Object properties relate one individual item to another. For instance, we could have a property called commonlyServedWith. So, we may have one individual of type "Vegetable" - say, Carrot, and another individual of type "Vegetable", say, Pea. And the commonlyServedWith object property links one property to another.
<#carrot> a <#Vegetable>;
<#carrot> <#commonlyServedWith> <#pea>.
<#pea> a <#Vegetable>.
A datatype property adds a property to an item, but that property is not another item, but a data type like a string, integer or date and time. You could, for instance, have another item of type "Vegetable", but instead of describing it's relationship to another item, add a string value. We may wish to give it a 'label' for instance. The RDF Schema vocabulary gives us a 'label' property which is used to "provide a human-readable version of a resource's name"[1]. We can also define it's language - RDF allows you to define the language of strings by using a language code like "en" or "fr" or "tlh-US" (American variation on Klingon). This follows RFC 3066
<#carrot> a <#Vegetable>;
<#carrot> rdfs:label "Carrot"@en.
[edit] Notes & Minutiae
- Languages are an area of experimentation - see Languages as RDF Resources on the ESW Wiki.

