Author: buildbot
Date: Fri Jan 13 13:05:54 2012
New Revision: 802533

Log:
Staging update by buildbot for stanbol

Added:
    websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/
    
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/index.html
Modified:
    websites/staging/stanbol/trunk/content/stanbol/docs/trunk/components.html

Modified: 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/components.html
==============================================================================
--- websites/staging/stanbol/trunk/content/stanbol/docs/trunk/components.html 
(original)
+++ websites/staging/stanbol/trunk/content/stanbol/docs/trunk/components.html 
Fri Jan 13 13:05:54 2012
@@ -87,7 +87,7 @@
 <p>The <a href="contenthub.html">Contenthub</a> provides you with a combined 
index of your content items together with enhancements to facilitate semantic 
search on your entire knowledge base.</p>
 </li>
 <li>
-<p>The <a href="factstore.html">FactStore</a> is a component that let's use 
store relations between entities identified by their URIs. This relation 
between two entities is called a <em>fact</em>.</p>
+<p>The <a href="factstore/">FactStore</a> is a component that let's use store 
relations between entities identified by their URIs. This relation between two 
entities is called a <em>fact</em>.</p>
 </li>
 </ul>
   </div>

Added: 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/index.html
==============================================================================
--- 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/index.html 
(added)
+++ 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/index.html 
Fri Jan 13 13:05:54 2012
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<head>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+  <link href="/stanbol/css/stanbol.css" rel="stylesheet" type="text/css">
+  <title>Apache Stanbol - Factstore</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <link rel="icon" type="image/png" 
href="/stanbol/images/stanbol-logo/stanbol-favicon.png"/>
+</head>
+
+<body>
+  <div id="navigation"> 
+  <img alt="Apache Stanbol" width="220" height="101" 
src="/stanbol/images/stanbol-logo/stanbol-2010-12-14.png"/>
+  <h1 id="stanbol_links">Stanbol links</h1>
+<ul>
+<li><a href="/stanbol/index.html">Home</a></li>
+<li><a href="/stanbol/docs/trunk/tutorial.html">Tutorial</a></li>
+<li><a href="/stanbol/docs/trunk/downloads.html">Downloads</a></li>
+<li><a href="/stanbol/docs/trunk/building.html">Building from Source</a></li>
+<li><a href="/stanbol/docs/trunk/">Documentation</a></li>
+<li><a href="/stanbol/docs/trunk/mailinglists.html">Mailing Lists</a></li>
+<li><a href="https://issues.apache.org/jira/browse/STANBOL";>Issue 
Tracker</a></li>
+<li><a href="/stanbol/team.html">Project Team</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org";>Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0";>License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html";>Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html";>Become a 
Sponsor</a></li>
+<li><a href="http://www.apache.org/security/";>Security</a></li>
+</ul>
+  </div>
+  
+  <div id="content">
+    <h1 class="title">Factstore</h1>
+    <p>The FactStore is a component that let's use store relations between 
entities identified by their URIs. A relation between two or more entities is 
called a <em>fact</em>. The FactStore let's you store N-ary facts according to 
a user defined fact schema. In consequence you can store relations between N 
participating entities.</p>
+<h2 id="example">Example</h2>
+<p>Imagine you want to store the fact that the person named John Doe works for 
the company Winzigweich. John Doe is represented by the URI 
http://www.doe.com/john and the company by http://www.winzigweich.de. This fact 
is stored as a relation between the entity http://www.doe.com/john and 
http://www.winzigweich.de.</p>
+<p>For this, we first need to create a so called fact schema that tells the 
FactStore what we would like to store. A fact schema has a unique name (often 
an URI is used) to identify it. To specify what kinds of entities we would like 
to store, we specify the type of the entities. Each type has an URI and should 
be defined by some ontology. For example, we can use the ontology specified by 
http://schema.org/.</p>
+<p>According to http://schema.org/ a person is of type 
http://schema.org/Person and an organization is of type 
http://schema.org/Organization. We will use these type information to specify 
the fact schema http://factschema.org/worksFor. The specification of a fact 
schema is written in JSON-LD, like this:</p>
+<div class="codehilite"><pre><span class="p">{</span>
+  <span class="s">&quot;@context&quot;</span> <span class="p">:</span> <span 
class="p">{</span>
+    <span class="s">&quot;#types&quot;</span>  <span class="p">:</span> <span 
class="p">{</span>
+      <span class="s">&quot;person&quot;</span>       <span class="p">:</span> 
<span class="s">&quot;http://schema.org/Person&quot;</span><span 
class="p">,</span>
+      <span class="s">&quot;organization&quot;</span> <span class="p">:</span> 
<span class="s">&quot;http://schema.org/Organization&quot;</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>To create this fact schema in the FactStore we have to store it in a *.json 
file, e.g. worksFor.json, and PUT it into the FactStore. The path to put the 
fact schema is <code>/factstore/facts/{factSchemaName}</code>. So for our 
example this would be 
<code>/factstore/facts/http://factschema.org/worksFor</code>. Unfortunately, 
this is not a valid URI so that we have to URL-encode the name of the fact 
schema. This leads to
+<code>/factstore/facts/http%3A%2F%2Ffactschema.org%2FworksFor</code>.</p>
+<p><em>Note</em>: If you want to avoid this URL-encoding step, you should 
chose another name for your fact schema that is not an URI by itself. You are 
free to do so!</p>
+<p>Now to PUT the <code>worksFor</code> fact schema we can use this cURL 
command.</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span 
class="n">http:</span><span class="sr">//</span><span 
class="n">localhost:8080</span><span class="sr">/factstore/</span><span 
class="n">facts</span><span class="o">/</span><span class="n">http</span><span 
class="nv">%3A%2F%2Ffactschema</span><span class="o">.</span><span 
class="n">org</span><span class="nv">%2FworksFor</span> <span 
class="o">-</span><span class="n">T</span> <span class="n">worksFor</span><span 
class="o">.</span><span class="n">json</span>
+</pre></div>
+
+
+<p>After creating the fact schema we can store the fact that John Doe works 
for Winzigweich by POSTing it to the FactStore. The fact is specified in 
JSON-LD syntax. The <code>@profile</code> defines the fact schema where this 
fact belongs to.</p>
+<div class="codehilite"><pre><span class="p">{</span>
+  <span class="s">&quot;@profile&quot;</span>     <span class="p">:</span> 
<span class="s">&quot;http://factschema.org/worksFor&quot;</span><span 
class="p">,</span>
+  <span class="s">&quot;person&quot;</span>       <span class="p">:</span> 
<span class="p">{</span> <span class="s">&quot;@iri&quot;</span> <span 
class="p">:</span> <span class="s">&quot;http://www.doe.com/john&quot;</span> 
<span class="p">},</span>
+  <span class="s">&quot;organization&quot;</span> <span class="p">:</span> 
<span class="p">{</span> <span class="s">&quot;@iri&quot;</span> <span 
class="p">:</span> <span 
class="s">&quot;http://www.winzigweich.de&quot;</span><span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Now we can POST this fact, e.g. stored in fact.json, to the FactStore at 
<code>/factstore/facts</code>. By using cURL it would be this command:</p>
+<div class="codehilite"><pre><span class="n">curl</span> <span 
class="o">-</span><span class="n">d</span> <span class="nv">@fact</span><span 
class="o">.</span><span class="n">json</span> <span class="o">-</span><span 
class="n">H</span> <span class="s">&quot;Content-Type: 
application/json&quot;</span> <span class="n">http:</span><span 
class="sr">//</span><span class="n">localhost:8080</span><span 
class="sr">/factstore/</span><span class="n">facts</span>
+</pre></div>
+
+
+<p>On success this will return a 201 (Created) and the URI of the newly 
created fact in the location header of the response. To retrieve a fact you can 
GET it from the returned URI.</p>
+<h2 id="rest_api_documentation">REST API Documentation</h2>
+<p>To get the latest documentation you should start your copy of Apache 
Stanbol and navigate your browser to  http://localhost:8080/factstore. There 
you will find more information and the documentation of the FactStore's REST 
API.</p>
+  </div>
+  
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2010 The Apache Software Foundation, Licensed under 
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0";>Apache 
License, Version 2.0</a>.
+        <br />
+        Apache, Stanbol and the Apache feather and Stanbol logos are 
trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+  
+</body>
+</html>


Reply via email to