Difference between revisions of "Projects/Nepomuk/GraphConcepts"

Jump to: navigation, search
(Graph Creation)
(Marked this version for translation)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Nepomuk is based on the Semantic Web, and even though the Semantic Web is largely advertised as a triple store, Nepomuk is NOT a triple store. We in fact store quadruples -> <code>Subject</code> - <code>Predicate</code> - <code>Object</code> - <code>Graph</code>. The <code>Graph</code> part of these quadruples is always automatically managed by Nepomuk. Clients rarely (if ever) need to care about the graph.
+
<languages />
 +
<translate>
  
 +
== The Semantic Web - with quadruples == <!--T:1-->
 +
 +
<!--T:2-->
 +
'''Nepomuk''' is based on the Semantic Web, and even though the Semantic Web is largely advertised as a triple store, Nepomuk is NOT a triple store. We in fact store quadruples -> <tt>Subject - Predicate - Object - Graph</tt>. The <tt>Graph</tt> part of these quadruples is always automatically managed by Nepomuk. Clients rarely (if ever) need to care about the graph.
 +
 +
<!--T:3-->
 
However, if you still want to know why they are present. Read on.
 
However, if you still want to know why they are present. Read on.
  
= Graph Creation =
+
<!--T:4-->
 +
The <tt>graph</tt> is also called the context of the statement. It is used to store some information about each triple
 +
 
 +
== Graph Naming == <!--T:5-->
 +
 
 +
<!--T:6-->
 +
Every graph in '''Nepomuk''' is given a unique uri which is of the form <tt>nepomuk:/ctx/uuid</tt>. The <tt>ctx</tt> over here is an abbreviation for context.
 +
 
 +
== Graph Creation == <!--T:7-->
 +
 
 +
<!--T:8-->
 
The first obvious question is - When are graphs created? Is everything just added into one big graph?
 
The first obvious question is - When are graphs created? Is everything just added into one big graph?
  
Nepomuk works by creating new graphs for each atomic operation. These operations are the ones defined by the DataManagement functions -
+
<!--T:9-->
* addProperty
+
'''Nepomuk''' works by creating new graphs for each atomic operation. These operations are the ones defined by the [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/datamanagement_8h.html DataManagement functions] -
* setProperty
+
* createResource
+
* storeResources
+
  
 +
<!--T:10-->
 +
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gafb8a64e1fb9e8339ff87be1b7a370a57 addProperty]
 +
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gaa86c603d624d55703b0e41bbec77d2ec setProperty]
 +
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gad731308a74b75a1a2bb20b1676eda2ed createResource]
 +
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gac094511c6157fb1f96f3a3344d48128d storeResources]
  
 +
 +
<!--T:11-->
 
Each time any of these operations is called and new data is being pushed, a new graph with the current date time is created.
 
Each time any of these operations is called and new data is being pushed, a new graph with the current date time is created.
  
= Graph contents =
+
== Graph contents == <!--T:12-->
The <code>graph</code> is always called the context of the statement. It is used to store some metadata about each triple. In our case we currently store the following information
+
 
 +
<!--T:13-->
 +
Graphs in '''Nepomuk''' store the following information -
  
 +
<!--T:14-->
 
* Graph Type
 
* Graph Type
 
* Creation Date
 
* Creation Date
Line 24: Line 48:
  
  
 +
<!--T:15-->
 
Example -
 
Example -
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
Line 34: Line 59:
  
  
The <code>nao:created</code> and <code>nao:lastModified</code> properties are identical to those used in resources. Except for the fact that graphs are generally never modified. They are only created or destroyed.
+
<!--T:16-->
 +
The <tt>nao:created</tt> and <tt>nao:lastModified</tt> properties are identical to those used in resources. Except for the fact that graphs are generally never modified. They are only created or destroyed.
  
== Graph Type ==
+
=== Graph Type === <!--T:17-->
 +
 
 +
<!--T:18-->
 
Each graph has a type which depends on the type of data it holds. The 3 most commonly used types are -
 
Each graph has a type which depends on the type of data it holds. The 3 most commonly used types are -
* <code>nrl:Ontology</code> - Used to hold ontology data.
+
* <tt>nrl:Ontology</tt> - Used to hold ontology data.
* <code>nrl:InstanceBase</code> - Used for normal data
+
* <tt>nrl:InstanceBase</tt> - Used for normal data
* <code>nrl:DiscardableInstanceBase</code> - Used for data which can be reproduced and should not be backed up. This type is generally reserved for data created during indexing of files.
+
* <tt>nrl:DiscardableInstanceBase</tt> - Used for data which can be reproduced and should not be backed up. This type is generally reserved for data created during indexing of files.
  
== Agents ==
+
=== Agents === <!--T:19-->
  
Each graph contains a property called <code>nao:maintainedBy</code> which specifies which application created that data -
+
<!--T:20-->
 +
Each graph contains a property called <tt>nao:maintainedBy</tt> which specifies which application created that data -
  
 +
<!--T:21-->
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
<nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5>
 
<nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5>
Line 53: Line 83:
 
         nao:maintainedBy        nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0
 
         nao:maintainedBy        nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0
  
 +
<!--T:22-->
 
<nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0>
 
<nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0>
 
         rdf:type                nao:Agent
 
         rdf:type                nao:Agent
Line 60: Line 91:
  
  
Each application is represented as a <code>nao:Agent</code> with the application name specified as the nao:identifier. This name is automatically determined via <code>KComponentData</code> and can be spoofed. Security was not one of our concerns.
+
<!--T:23-->
 +
Each application is represented as a <tt>nao:Agent</tt> with the application name specified as the nao:identifier. This name is automatically determined via <tt>KComponentData</tt> and can be spoofed. Security was not one of our concerns.
 +
 
 +
<!--T:24-->
 +
Each triple may be maintained by a number of different applications. This information is valuable for the advanced DataManagement functions such as [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#ga0fbf22be4b581afd0b5bcd1f203e934f <tt>removeDataByApplication</tt>].
  
Each triple may be maintained by a number of different applications. This information is valuable for the advanced DataManagement functions such as <code>removeDataByApplication</code>.
+
<!--T:25-->
 +
[[Category:Documentation]]
 +
[[Category:Development]]
 +
[[Category:Tutorials]]
 +
</translate>

Latest revision as of 17:29, 13 December 2012

Other languages:English 100%

Contents

[edit] The Semantic Web - with quadruples

Nepomuk is based on the Semantic Web, and even though the Semantic Web is largely advertised as a triple store, Nepomuk is NOT a triple store. We in fact store quadruples -> Subject - Predicate - Object - Graph. The Graph part of these quadruples is always automatically managed by Nepomuk. Clients rarely (if ever) need to care about the graph.

However, if you still want to know why they are present. Read on.

The graph is also called the context of the statement. It is used to store some information about each triple

[edit] Graph Naming

Every graph in Nepomuk is given a unique uri which is of the form nepomuk:/ctx/uuid. The ctx over here is an abbreviation for context.

[edit] Graph Creation

The first obvious question is - When are graphs created? Is everything just added into one big graph?

Nepomuk works by creating new graphs for each atomic operation. These operations are the ones defined by the DataManagement functions -


Each time any of these operations is called and new data is being pushed, a new graph with the current date time is created.

[edit] Graph contents

Graphs in Nepomuk store the following information -

  • Graph Type
  • Creation Date
  • Modification Date
  • Graph Maintainer


Example -

<nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5>
        rdf:type                nrl:InstanceBase
        nao:created             2011-07-30T11:34:19.587Z
        nao:modified            2011-07-30T11:34:19.587Z
        nao:maintainedBy        nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0


The nao:created and nao:lastModified properties are identical to those used in resources. Except for the fact that graphs are generally never modified. They are only created or destroyed.

[edit] Graph Type

Each graph has a type which depends on the type of data it holds. The 3 most commonly used types are -

  • nrl:Ontology - Used to hold ontology data.
  • nrl:InstanceBase - Used for normal data
  • nrl:DiscardableInstanceBase - Used for data which can be reproduced and should not be backed up. This type is generally reserved for data created during indexing of files.

[edit] Agents

Each graph contains a property called nao:maintainedBy which specifies which application created that data -

<nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5>
        rdf:type                nrl:DiscardableInstanceBase
        nao:created             2011-07-30T11:34:19.587Z
        nao:modified            2011-07-30T11:34:19.587Z
        nao:maintainedBy        nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0
 
<nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0>
        rdf:type                nao:Agent
        rdf:type                rdfs:Resource
        nao:identifier          nepomukindexer


Each application is represented as a nao:Agent with the application name specified as the nao:identifier. This name is automatically determined via KComponentData and can be spoofed. Security was not one of our concerns.

Each triple may be maintained by a number of different applications. This information is valuable for the advanced DataManagement functions such as removeDataByApplication.


This page was last modified on 13 December 2012, at 17:29. This page has been accessed 2,203 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