https://techbase.kde.org/index.php?title=Projects/Nepomuk/GraphConcepts/en&feed=atom&action=historyProjects/Nepomuk/GraphConcepts/en - Revision history2015-03-31T20:56:15ZRevision history for this page on the wikiMediaWiki 1.20.2https://techbase.kde.org/index.php?title=Projects/Nepomuk/GraphConcepts/en&diff=77245&oldid=prevFuzzyBot: Updating to match new version of source page2012-12-13T16:30:02Z<p>Updating to match new version of source page</p>
<p><b>New page</b></p><div>&lt;languages /&gt;<br />
<br />
== The Semantic Web - with quadruples ==<br />
<br />
'''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 -&gt; &lt;tt&gt;Subject - Predicate - Object - Graph&lt;/tt&gt;. The &lt;tt&gt;Graph&lt;/tt&gt; part of these quadruples is always automatically managed by Nepomuk. Clients rarely (if ever) need to care about the graph.<br />
<br />
However, if you still want to know why they are present. Read on.<br />
<br />
The &lt;tt&gt;graph&lt;/tt&gt; is also called the context of the statement. It is used to store some information about each triple<br />
<br />
== Graph Naming ==<br />
<br />
Every graph in '''Nepomuk''' is given a unique uri which is of the form &lt;tt&gt;nepomuk:/ctx/uuid&lt;/tt&gt;. The &lt;tt&gt;ctx&lt;/tt&gt; over here is an abbreviation for context.<br />
<br />
== Graph Creation ==<br />
<br />
The first obvious question is - When are graphs created? Is everything just added into one big graph?<br />
<br />
'''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] -<br />
<br />
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gafb8a64e1fb9e8339ff87be1b7a370a57 addProperty]<br />
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gaa86c603d624d55703b0e41bbec77d2ec setProperty]<br />
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gad731308a74b75a1a2bb20b1676eda2ed createResource]<br />
* [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/group__nepomuk__datamanagement.html#gac094511c6157fb1f96f3a3344d48128d storeResources]<br />
<br />
<br />
Each time any of these operations is called and new data is being pushed, a new graph with the current date time is created.<br />
<br />
== Graph contents ==<br />
<br />
Graphs in '''Nepomuk''' store the following information -<br />
<br />
* Graph Type<br />
* Creation Date<br />
* Modification Date<br />
* Graph Maintainer<br />
<br />
<br />
Example -<br />
&lt;syntaxhighlight lang=&quot;text&quot;&gt;<br />
&lt;nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5&gt;<br />
rdf:type nrl:InstanceBase<br />
nao:created 2011-07-30T11:34:19.587Z<br />
nao:modified 2011-07-30T11:34:19.587Z<br />
nao:maintainedBy nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0<br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
The &lt;tt&gt;nao:created&lt;/tt&gt; and &lt;tt&gt;nao:lastModified&lt;/tt&gt; properties are identical to those used in resources. Except for the fact that graphs are generally never modified. They are only created or destroyed.<br />
<br />
=== Graph Type ===<br />
<br />
Each graph has a type which depends on the type of data it holds. The 3 most commonly used types are -<br />
* &lt;tt&gt;nrl:Ontology&lt;/tt&gt; - Used to hold ontology data.<br />
* &lt;tt&gt;nrl:InstanceBase&lt;/tt&gt; - Used for normal data<br />
* &lt;tt&gt;nrl:DiscardableInstanceBase&lt;/tt&gt; - 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.<br />
<br />
=== Agents ===<br />
<br />
Each graph contains a property called &lt;tt&gt;nao:maintainedBy&lt;/tt&gt; which specifies which application created that data -<br />
<br />
&lt;syntaxhighlight lang=&quot;text&quot;&gt;<br />
&lt;nepomuk:/ctx/c4d93812-7d8c-4c8f-b8a7-e1d4dbc5fed5&gt;<br />
rdf:type nrl:DiscardableInstanceBase<br />
nao:created 2011-07-30T11:34:19.587Z<br />
nao:modified 2011-07-30T11:34:19.587Z<br />
nao:maintainedBy nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0<br />
<br />
&lt;nepomuk:/res/e2eb2efb-14ee-4038-ac24-698f916289b0&gt;<br />
rdf:type nao:Agent<br />
rdf:type rdfs:Resource<br />
nao:identifier nepomukindexer<br />
&lt;/syntaxhighlight&gt;<br />
<br />
<br />
Each application is represented as a &lt;tt&gt;nao:Agent&lt;/tt&gt; with the application name specified as the nao:identifier. This name is automatically determined via &lt;tt&gt;KComponentData&lt;/tt&gt; and can be spoofed. Security was not one of our concerns.<br />
<br />
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 &lt;tt&gt;removeDataByApplication&lt;/tt&gt;].<br />
<br />
[[Category:Documentation]]<br />
[[Category:Development]]<br />
[[Category:Tutorials]]</div>FuzzyBot