Difference between revisions of "Projects/Nepomuk/OntologyBasics"

Jump to: navigation, search
(Prepare for translation)
(Marked this version for translation)
 
Line 2: Line 2:
 
<translate>
 
<translate>
  
== Introduction ==
+
== Introduction == <!--T:1-->
  
 +
<!--T:2-->
 
'''Nepomuk''', unlike other conventional projects, does not use a relational database to store its data. Instead it uses a ''RDF store''. RDF stands for Resource Description Framework. It's the big framework that was written for describing abstract data on the web, and is the basis of the semantic web. While RDF, has many concepts, '''Nepomuk''' mainly utilizes a couple of them.
 
'''Nepomuk''', unlike other conventional projects, does not use a relational database to store its data. Instead it uses a ''RDF store''. RDF stands for Resource Description Framework. It's the big framework that was written for describing abstract data on the web, and is the basis of the semantic web. While RDF, has many concepts, '''Nepomuk''' mainly utilizes a couple of them.
  
== Statements ==
+
== Statements == <!--T:3-->
  
 +
<!--T:4-->
 
The simplest concept is that of a sentence. All the data in '''Nepomuk''' is stored in the form <code><subject> <predicate> <object> <graph></code>. These 4 values combined are called a ''statement''.
 
The simplest concept is that of a sentence. All the data in '''Nepomuk''' is stored in the form <code><subject> <predicate> <object> <graph></code>. These 4 values combined are called a ''statement''.
  
 +
<!--T:5-->
 
If we look at this in terms of an object oriented programming language, the <code><subject></code> is an OOP Object, and the (predicate, object) pair can be looked as (key, value) pairs which define properties on that OOP Object.  
 
If we look at this in terms of an object oriented programming language, the <code><subject></code> is an OOP Object, and the (predicate, object) pair can be looked as (key, value) pairs which define properties on that OOP Object.  
  
 +
<!--T:6-->
 
Here are some examples of common statements -
 
Here are some examples of common statements -
  
 +
<!--T:7-->
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
<nepomuk:/res/some-uuid> rdf:type nao:Tag
 
<nepomuk:/res/some-uuid> rdf:type nao:Tag
Line 19: Line 24:
 
<nepomuk:/res/some-uuid> nao:prefLabel "Sample"
 
<nepomuk:/res/some-uuid> nao:prefLabel "Sample"
  
 +
<!--T:8-->
 
<nepomuk:/res/some-other-uuid> rdf:type nfo:FileDataObject
 
<nepomuk:/res/some-other-uuid> rdf:type nfo:FileDataObject
 
<nepomuk:/res/some-other-uuid> nao:hasTag <nepomuk:/res/some-uuid>
 
<nepomuk:/res/some-other-uuid> nao:hasTag <nepomuk:/res/some-uuid>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===  Subject ===
+
===  Subject === <!--T:9-->
  
 +
<!--T:10-->
 
The subject, like in conventional English, is the main part of the sentence. It highlights what we are talking about. In the above example there are different subjects <code>nepomuk:/res/some-uuid</code> and <code>nepomuk:/res/some-other-uuid</code>. In each of these statements the subjects have certain properties and objects bound to them.
 
The subject, like in conventional English, is the main part of the sentence. It highlights what we are talking about. In the above example there are different subjects <code>nepomuk:/res/some-uuid</code> and <code>nepomuk:/res/some-other-uuid</code>. In each of these statements the subjects have certain properties and objects bound to them.
  
=== Predicate ===
+
=== Predicate === <!--T:11-->
  
 +
<!--T:12-->
 
''Predicates'' are often also called properties, and they used to connect the <code><subject></code> with the <code><object></code>.  
 
''Predicates'' are often also called properties, and they used to connect the <code><subject></code> with the <code><object></code>.  
  
 +
<!--T:13-->
 
Each predicate is generally assigned a domain and range which governs the kind of <subject>s and <object>s it can be connected to.
 
Each predicate is generally assigned a domain and range which governs the kind of <subject>s and <object>s it can be connected to.
 
Some examples of commonly used predicates are <code>rdf:type</code> [http://oscaf.sourceforge.net/nao.html#nao:lastModified <code>nao:lastModified</code>] and [http://oscaf.sourceforge.net/nao.html#nao:hasTag <code>nao:hasTag</code>]
 
Some examples of commonly used predicates are <code>rdf:type</code> [http://oscaf.sourceforge.net/nao.html#nao:lastModified <code>nao:lastModified</code>] and [http://oscaf.sourceforge.net/nao.html#nao:hasTag <code>nao:hasTag</code>]
  
=== Object ===
+
=== Object === <!--T:14-->
  
 +
<!--T:15-->
 
The ''object'' is the slightly tricky part of statement. Objects can either be uris or literals. Uris refers to other subjects, and literals can be any of the conventional data types - integers, strings, datetime, boolean.
 
The ''object'' is the slightly tricky part of statement. Objects can either be uris or literals. Uris refers to other subjects, and literals can be any of the conventional data types - integers, strings, datetime, boolean.
  
=== Graph ===
+
=== Graph === <!--T:16-->
  
 +
<!--T:17-->
 
The graph contains some information about the triple - (<subject> <predicate> <object>) such as when it was created, and last modified. Unless you're working on the absolute core parts of '''Nepomuk''', you won't ever have to interact with graphs, and they'll just work seamlessly in the background.
 
The graph contains some information about the triple - (<subject> <predicate> <object>) such as when it was created, and last modified. Unless you're working on the absolute core parts of '''Nepomuk''', you won't ever have to interact with graphs, and they'll just work seamlessly in the background.
  
== Resources ==
+
== Resources == <!--T:18-->
  
 +
<!--T:19-->
 
What they are - all about
 
What they are - all about
  
=== Collection of Statements ===
+
=== Collection of Statements === <!--T:20-->
  
=== URIs ===
+
=== URIs === <!--T:21-->
  
== What is an Ontology ==
+
== What is an Ontology == <!--T:22-->
  
 +
<!--T:23-->
 
An ''ontology'' is a formal description of the all the properties and types that resources can posses. It can be viewed as the database schema or like the architectural plans.
 
An ''ontology'' is a formal description of the all the properties and types that resources can posses. It can be viewed as the database schema or like the architectural plans.
  
== RDF and RDFS ==
+
== RDF and RDFS == <!--T:24-->
  
 +
<!--T:25-->
 
The [http://www.w3.org/RDF/ Resource Description Framework] and [http://www.w3.org/2001/sw/wiki/RDFS Resource Description Framework Schema] are the two main schemas that were defined by the ''Semantic web''. They are important because they provide the building blocks for writing all of the other ontologies.
 
The [http://www.w3.org/RDF/ Resource Description Framework] and [http://www.w3.org/2001/sw/wiki/RDFS Resource Description Framework Schema] are the two main schemas that were defined by the ''Semantic web''. They are important because they provide the building blocks for writing all of the other ontologies.
  
=== Type System ===
+
=== Type System === <!--T:26-->
  
 +
<!--T:27-->
 
The RDF and RDFS provide the foundation for an entire type system. It is slightly simpler than that of any programming language. It just provides single and multiple inheritance.
 
The RDF and RDFS provide the foundation for an entire type system. It is slightly simpler than that of any programming language. It just provides single and multiple inheritance.
  
 +
<!--T:28-->
 
Eg -
 
Eg -
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
Line 72: Line 88:
  
  
 +
<!--T:29-->
 
We use the <code>rdfs:subClassOf</code> property to indicate one class is a sub-type of another class.
 
We use the <code>rdfs:subClassOf</code> property to indicate one class is a sub-type of another class.
  
=== Property System ===
+
=== Property System === <!--T:30-->
  
 +
<!--T:31-->
 
Unlike other conventional system, RDFS also defines a property inheritance system. Each property can be defined a domain, range, cardinality and super-properties.
 
Unlike other conventional system, RDFS also defines a property inheritance system. Each property can be defined a domain, range, cardinality and super-properties.
  
 +
<!--T:32-->
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
     nfo:fileName
 
     nfo:fileName
Line 90: Line 109:
  
  
 +
<!--T:33-->
 
In the above example a property called <code>nfo:fileName</code> has been declared. This property is a sub-property of the <code>nao:prefLabel</code> ontology.  It additionally defines a <code>nrl:maxCardinality</code> as 1. This indicates that no resource should have more than 1 filename. And finally it defines a domain of <code>nfo:FileDataObject</code> and range of <code>xsd:string</code>.
 
In the above example a property called <code>nfo:fileName</code> has been declared. This property is a sub-property of the <code>nao:prefLabel</code> ontology.  It additionally defines a <code>nrl:maxCardinality</code> as 1. This indicates that no resource should have more than 1 filename. And finally it defines a domain of <code>nfo:FileDataObject</code> and range of <code>xsd:string</code>.
  
 +
<!--T:34-->
 
'''Nepomuk''' currently enforces these ontologies. So if you should always check the domain and range of properties before using them.
 
'''Nepomuk''' currently enforces these ontologies. So if you should always check the domain and range of properties before using them.
  
== Shared Desktop Ontologies ==
+
== Shared Desktop Ontologies == <!--T:35-->
  
 +
<!--T:36-->
 
The [http://www.oscaf.org/ OSCAF Foundation] was responsible for creating the [http://oscaf.sourceforge.net/ Shared Desktop Ontologies]. Since then the ''Shared Desktop Ontologies'' are maintained by the '''Nepomuk''' project.  
 
The [http://www.oscaf.org/ OSCAF Foundation] was responsible for creating the [http://oscaf.sourceforge.net/ Shared Desktop Ontologies]. Since then the ''Shared Desktop Ontologies'' are maintained by the '''Nepomuk''' project.  
  
 +
<!--T:37-->
 
The Shared Desktop Ontologies comprise of a large list of ontologies which define types and properties for files, music, messages, contacts and other desktop related things. It also defines NRL - [http://www.semanticdesktop.org/ontologies/nrl/ The Nepomuk Representation Language] which serves as an extension to RDF, and defines the key points of the ''Semantic Desktop''.
 
The Shared Desktop Ontologies comprise of a large list of ontologies which define types and properties for files, music, messages, contacts and other desktop related things. It also defines NRL - [http://www.semanticdesktop.org/ontologies/nrl/ The Nepomuk Representation Language] which serves as an extension to RDF, and defines the key points of the ''Semantic Desktop''.
 
   
 
   
Line 108: Line 131:
 
* PIMO - [http://www.semanticdesktop.org/ontologies/2007/11/01/pimo/ Personal Information Management Ontology]
 
* PIMO - [http://www.semanticdesktop.org/ontologies/2007/11/01/pimo/ Personal Information Management Ontology]
  
== Further Reading ==
+
== Further Reading == <!--T:38-->
  
 +
<!--T:39-->
 
As '''Nepomuk''' is highly dependent on its data in the RDF store, one might consider to read up on RDF and the '''Nepomuk''' ontologies:
 
As '''Nepomuk''' is highly dependent on its data in the RDF store, one might consider to read up on RDF and the '''Nepomuk''' ontologies:
  
 +
<!--T:40-->
 
* [http://www.w3.org/TR/REC-rdf-syntax/ RDF Primer]
 
* [http://www.w3.org/TR/REC-rdf-syntax/ RDF Primer]
 
* [http://www.semanticdesktop.org/ontologies Nepomuk Ontologies]
 
* [http://www.semanticdesktop.org/ontologies Nepomuk Ontologies]
 
* [http://dev.nepomuk.semanticdesktop.org/wiki/OntologyMaintenance Experimental Nepomuk Ontologies and Ideas for new ones]
 
* [http://dev.nepomuk.semanticdesktop.org/wiki/OntologyMaintenance Experimental Nepomuk Ontologies and Ideas for new ones]
  
 +
<!--T:41-->
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 
</translate>
 
</translate>

Latest revision as of 18:28, 10 December 2012

Other languages:English 100%

Contents

[edit] Introduction

Nepomuk, unlike other conventional projects, does not use a relational database to store its data. Instead it uses a RDF store. RDF stands for Resource Description Framework. It's the big framework that was written for describing abstract data on the web, and is the basis of the semantic web. While RDF, has many concepts, Nepomuk mainly utilizes a couple of them.

[edit] Statements

The simplest concept is that of a sentence. All the data in Nepomuk is stored in the form <subject> <predicate> <object> <graph>. These 4 values combined are called a statement.

If we look at this in terms of an object oriented programming language, the <subject> is an OOP Object, and the (predicate, object) pair can be looked as (key, value) pairs which define properties on that OOP Object.

Here are some examples of common statements -

<nepomuk:/res/some-uuid> rdf:type nao:Tag
<nepomuk:/res/some-uuid> nao:lastModified 2012-03-16T18:41:09.006Z
<nepomuk:/res/some-uuid> nao:prefLabel "Sample"
 
<nepomuk:/res/some-other-uuid> rdf:type nfo:FileDataObject
<nepomuk:/res/some-other-uuid> nao:hasTag <nepomuk:/res/some-uuid>

[edit] Subject

The subject, like in conventional English, is the main part of the sentence. It highlights what we are talking about. In the above example there are different subjects nepomuk:/res/some-uuid and nepomuk:/res/some-other-uuid. In each of these statements the subjects have certain properties and objects bound to them.

[edit] Predicate

Predicates are often also called properties, and they used to connect the <subject> with the <object>.

Each predicate is generally assigned a domain and range which governs the kind of <subject>s and <object>s it can be connected to. Some examples of commonly used predicates are rdf:type nao:lastModified and nao:hasTag

[edit] Object

The object is the slightly tricky part of statement. Objects can either be uris or literals. Uris refers to other subjects, and literals can be any of the conventional data types - integers, strings, datetime, boolean.

[edit] Graph

The graph contains some information about the triple - (<subject> <predicate> <object>) such as when it was created, and last modified. Unless you're working on the absolute core parts of Nepomuk, you won't ever have to interact with graphs, and they'll just work seamlessly in the background.

[edit] Resources

What they are - all about

[edit] Collection of Statements

[edit] URIs

[edit] What is an Ontology

An ontology is a formal description of the all the properties and types that resources can posses. It can be viewed as the database schema or like the architectural plans.

[edit] RDF and RDFS

The Resource Description Framework and Resource Description Framework Schema are the two main schemas that were defined by the Semantic web. They are important because they provide the building blocks for writing all of the other ontologies.

[edit] Type System

The RDF and RDFS provide the foundation for an entire type system. It is slightly simpler than that of any programming language. It just provides single and multiple inheritance.

Eg -

    nfo:RemoteDataObject
          a       rdfs:Class ;
          rdfs:comment "A file data object stored at a remote location. Don't confuse this class with a RemotePortAddress. This one applies to a particular resource, RemotePortAddress applies to an address, that can have various interpretations." ;
          rdfs:label "RemoteDataObject" ;
          rdfs:subClassOf nfo:FileDataObject .


We use the rdfs:subClassOf property to indicate one class is a sub-type of another class.

[edit] Property System

Unlike other conventional system, RDFS also defines a property inheritance system. Each property can be defined a domain, range, cardinality and super-properties.

    nfo:fileName
          a       rdf:Property ;
          rdfs:subPropertyOf nao:prefLabel ;
          rdfs:comment "Name of the file, together with the extension" ;
          rdfs:domain nfo:FileDataObject ;
          rdfs:label "fileName" ;
          nrl:maxCardinality "1" ;
          rdfs:range xsd:string .


In the above example a property called nfo:fileName has been declared. This property is a sub-property of the nao:prefLabel ontology. It additionally defines a nrl:maxCardinality as 1. This indicates that no resource should have more than 1 filename. And finally it defines a domain of nfo:FileDataObject and range of xsd:string.

Nepomuk currently enforces these ontologies. So if you should always check the domain and range of properties before using them.

[edit] Shared Desktop Ontologies

The OSCAF Foundation was responsible for creating the Shared Desktop Ontologies. Since then the Shared Desktop Ontologies are maintained by the Nepomuk project.

The Shared Desktop Ontologies comprise of a large list of ontologies which define types and properties for files, music, messages, contacts and other desktop related things. It also defines NRL - The Nepomuk Representation Language which serves as an extension to RDF, and defines the key points of the Semantic Desktop.

Here are some of the common ontologies -

[edit] Further Reading

As Nepomuk is highly dependent on its data in the RDF store, one might consider to read up on RDF and the Nepomuk ontologies:


This page was last modified on 10 December 2012, at 18:28. This page has been accessed 2,305 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal