Author: buildbot
Date: Fri Jan 13 14:10:35 2012
New Revision: 802553

Log:
Staging update by buildbot for stanbol

Modified:
    
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/specification.html

Modified: 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/specification.html
==============================================================================
--- 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/specification.html
 (original)
+++ 
websites/staging/stanbol/trunk/content/stanbol/docs/trunk/factstore/specification.html
 Fri Jan 13 14:10:35 2012
@@ -188,149 +188,146 @@
 
 <p>creates two new facts. The first one of type 
http://iks-project.eu/ont/employeeof specifying that the person 
http://upb.de/persons/bnagel is employee of the organization defined by the IRI 
http://uni-paderborn.de. The second of type http://iks-project.eu/ont/friendOf 
specifying that http://upb.de/persons/fchrist is a friend of 
http://upb.de/persons/bnagel.</p>
 <p>Status: <strong>Implemented</strong></p>
-<p>=== Query Interface ===</p>
+<h2 id="query_interface">Query Interface</h2>
 <p>The query interface allows clients to query for facts and combination of 
facts (reasoning). The JSON-LD query structure is inspired by SQL using SELECT 
FROM [JOIN] WHERE constructs. Depending on the implementation the JSON-LD 
queries may be transformed directly into valid SQL queries.</p>
-<p>==== Query for Facts of a Certain Type ====</p>
-<p>{|
- |valign="top"|Description:||Allows clients to query stored facts of a 
specific type defined by the fact's schema. The clients specify the desired 
fact plus an arbitrary number of entities that play some role in the fact.
- |-
- |Path:||/factstore/query
- |-
- |Method:||POST with data type application/json returns application/json
- |-
- |valign="top"|Data:||The query is specified by a JSON-LD object in the 
payload of the request. The query defines a "select" to specify the desired 
type of result to be returned in the result set. The "from" part specifies the 
fact type to query and the "where" clause specifies constraints to be 
fulfilled.<br>
-Note:For the moment constraints only support the equals "=" relation. There 
may be more relations like "&gt;" in future versions of this specification. If 
there is more than one constraint all constraints are concatenated by "AND".
- |-
- |valign="top"|Example 1:||POST /factstore/query<br>
-with the following data"</p>
+<h3 id="query_for_facts_of_a_certain_type">Query for Facts of a Certain 
Type</h3>
+<p>Allows clients to query stored facts of a specific type defined by the 
fact's schema. The clients specify the desired fact plus an arbitrary number of 
entities that play some role in the fact.</p>
+<p>Path: /factstore/query</p>
+<p>Method: POST with data type application/json returns application/json</p>
+<p>Data: The query is specified by a JSON-LD object in the payload of the 
request. The query defines a "select" to specify the desired type of result to 
be returned in the result set. The "from" part specifies the fact type to query 
and the "where" clause specifies constraints to be fulfilled.</p>
+<p><em>Note</em>: For the moment constraints only support the equals "=" 
relation. There may be more relations like "&gt;" in future versions of this 
specification. If there is more than one constraint all constraints are 
concatenated by "AND".</p>
+<p>Example 1: POST /factstore/query with the following data</p>
 <p>{
-  "@context" : {
-    "iks" : "http://iks-project.eu/ont/";
-  },
-  "select" : [ "person" ],
-  "from"   : "iks:employeeOf",
-  "where"  : [
-    {
-      "="  : {
-        "organization" : { "@iri" : "http://uni-paderborn.de"; }
-      }
-    }
-  ]
- }</p>
-<p><nowiki>returns the list of all persons participating in the fact of type 
http://iks-project.eu/ont/employeeOf where the organization is 
http://uni-paderborn.de. The result is sent back in JSON-LD format with the 
result set specified by the select clause.</nowiki></p>
-<p>{
-  "@subject" : [
-    {
-      "@subject" : "_bnode1",
-      "PERSON"   : "http://upb.de/persons/gengels";
-    },
-    {
-      "@subject" : "_bnode2",
-      "PERSON"   : "http://upb.de/persons/ssauer";
+    "@context" : {
+      "iks" : "http://iks-project.eu/ont/";
     },
-    {
-      "@subject" : "_bnode3",
-      "PERSON"   : "http://upb.de/persons/bnagel";
-    },
-    {
-      "@subject" : "_bnode4",
-      "PERSON"   : "http://upb.de/persons/fchrist";
-    }
-  ]
- }</p>
-<p><nowiki>If there is only one entry in the result set, this would be 
returned as follows.</nowiki></p>
-<p>{
-   "PERSON"   : "http://upb.de/persons/fchrist";
- }
- |-
- |valign="top"| Status: || Example 1 is implemented and should work in latest 
[http://incubator.apache.org/stanbol/ Apache Stanbol] versions.
- |-
- |valign="top"| Example 2: || GET /factstore/query?q=<br>
-with the following data as the request parameter "q"
- {
-  "@context" : {
-    "iks" : "http://iks-project.eu/ont/";
-  },
-  "select" : [
-    "person.name", "person.email"
-  ],
-  "from" : "iks:employeeOf",
-  "where" : [
-    {
-      "=" : {
-        "organization" : { "@iri" : "http://upb.de"; }
-      }
-    }
-  ]
- }</p>
-<p><nowiki>returns a list with names and e-mail addresses of all persons 
participating in the fact of type http://iks-project.eu/ont/employeeOf where 
the organization is http://upb.de. The result is sent back in JSON-LD format 
with the result set specified by the select clause.</nowiki></p>
-<p>{
-  "resultset": [
-    { "person.name" : "Gregor Engels",
-      "person.email": "[email protected]"  },
-    { "person.name" : "Stefan Sauer",
-      "person.email": "[email protected]"   },
-    { "person.name" : "Benjamin Nagel",
-      "person.email": "[email protected]"   },
-    { "person.name" : "Fabian Christ",
-      "person.email": "[email protected]"  }
-  ]
- }
- |-
- |Status || Implemention in progress.
- |}</p>
-<p>==== Query for Combinations of Facts ====
-{|
- |Description:||Allows clients to query for combinations of facts.
- |-
- |Path:||/factstore/query?q=
- |- 
- |Method:||GET with data type application/json returns application/json
- |-
- |Data:||The query is specified by a JSON-LD object in request parameter "q" 
of the request. The query defines a "select" to specify the desired type of 
result to be returned in the result set. Instead of using a "from" part this 
type of query supports joins over facts using the "join" field. The "join" 
field specifies which facts are joined by specifying the elements of the facts 
that are evaluated to be equal during the join. The "where" clause specifies 
constraints over the join to be fulfilled.<br>
-Note: For the moment constraints only support the equals "=" relation. There 
may be more relations like "&gt;" in future versions of this specification. If 
there is more than one constraint all constraints are concatenated by "AND".
- |-
- |valign="top"|Example:||GET /factstore/query?q=<br>
-with the following request data in request parameter "q"</p>
-<p>{
-  "@context" : {
-    "iks" : "http://iks-project.eu/ont/";
-  },
-  "select": [
-    "iks:friendOf.friend.name"
-  ],
-  "join" : {
-    "iks:employeeOf.person" : "iks:friendOf.person"
-  },
-  "where" : [
-    {
-      "=" : {
-        "iks:employeeOf.organization" : {
-          "@iri" : "http://upb.de";
+    "select" : [ "person" ],
+    "from"   : "iks:employeeOf",
+    "where"  : [
+      {
+        "="  : {
+          "organization" : { "@iri" : "http://uni-paderborn.de"; }
         }
       }
-    },
-    {
-      "=" : {
-        "iks:friendOf.friend.city" : "Paderborn"
-      }
-    }
-  ]
- }
-<nowiki>
-will return a list of names of all the friends living in Paderborn of the 
employees of the University of Paderborn. The result in JSON-LD format would 
look like the following.</nowiki></p>
-<p>{
-  "@context" : {
-    "iks" : "http://iks-project.eu/ont/";
-  },
-  "resultset": [
-    { "iks:friendOf.friend.name" : "Schmidt"   },
-    { "iks:friendOf.friend.name" : "Meier"     },
-    { "iks:friendOf.friend.name" : "Schneider" },
-    { "iks:friendOf.friend.name" : "Schuster"  }
-  ]
- }</p>
-<p>|}</p>
+    ]
+  }</p>
+<p>returns the list of all persons participating in the fact of type 
http://iks-project.eu/ont/employeeOf where the organization is 
http://uni-paderborn.de. The result is sent back in JSON-LD format with the 
result set specified by the select clause.</p>
+<div class="codehilite"><pre><span class="p">{</span>
+  <span class="s">&quot;@subject&quot;</span> <span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span>
+      <span class="s">&quot;@subject&quot;</span> <span class="p">:</span> 
<span class="s">&quot;_bnode1&quot;</span><span class="p">,</span>
+      <span class="s">&quot;PERSON&quot;</span>   <span class="p">:</span> 
<span class="s">&quot;http://upb.de/persons/gengels&quot;</span>
+    <span class="p">},</span>
+    <span class="p">{</span>
+      <span class="s">&quot;@subject&quot;</span> <span class="p">:</span> 
<span class="s">&quot;_bnode2&quot;</span><span class="p">,</span>
+      <span class="s">&quot;PERSON&quot;</span>   <span class="p">:</span> 
<span class="s">&quot;http://upb.de/persons/ssauer&quot;</span>
+    <span class="p">},</span>
+    <span class="p">{</span>
+      <span class="s">&quot;@subject&quot;</span> <span class="p">:</span> 
<span class="s">&quot;_bnode3&quot;</span><span class="p">,</span>
+      <span class="s">&quot;PERSON&quot;</span>   <span class="p">:</span> 
<span class="s">&quot;http://upb.de/persons/bnagel&quot;</span>
+    <span class="p">},</span>
+    <span class="p">{</span>
+      <span class="s">&quot;@subject&quot;</span> <span class="p">:</span> 
<span class="s">&quot;_bnode4&quot;</span><span class="p">,</span>
+      <span class="s">&quot;PERSON&quot;</span>   <span class="p">:</span> 
<span class="s">&quot;http://upb.de/persons/fchrist&quot;</span>
+    <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>If there is only one entry in the result set, this would be returned as 
follows.</p>
+<div class="codehilite"><pre><span class="p">{</span>
+  <span class="s">&quot;PERSON&quot;</span>   <span class="p">:</span> <span 
class="s">&quot;http://upb.de/persons/fchrist&quot;</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Status: <strong>Example 1 is implemented</strong>.</p>
+<p>Example 2: GET /factstore/query?q= with the following data as the request 
parameter "q"</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;iks&quot;</span> <span class="p">:</span> <span 
class="s">&quot;http://iks-project.eu/ont/&quot;</span>
+  <span class="p">},</span>
+  <span class="s">&quot;select&quot;</span> <span class="p">:</span> <span 
class="p">[</span>
+    <span class="s">&quot;person.name&quot;</span><span class="p">,</span> 
<span class="s">&quot;person.email&quot;</span>
+  <span class="p">],</span>
+  <span class="s">&quot;from&quot;</span> <span class="p">:</span> <span 
class="s">&quot;iks:employeeOf&quot;</span><span class="p">,</span>
+  <span class="s">&quot;where&quot;</span> <span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span>
+      <span class="s">&quot;=&quot;</span> <span class="p">:</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://upb.de&quot;</span> <span class="p">}</span>
+      <span class="p">}</span>
+    <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>returns a list with names and e-mail addresses of all persons participating 
in the fact of type http://iks-project.eu/ont/employeeOf where the organization 
is http://upb.de. The result is sent back in JSON-LD format with the result set 
specified by the select clause.</p>
+<div class="codehilite"><pre><span class="p">{</span>
+  <span class="s">&quot;resultset&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span> <span class="s">&quot;person.name&quot;</span> 
<span class="p">:</span> <span class="s">&quot;Gregor Engels&quot;</span><span 
class="p">,</span>
+      <span class="s">&quot;person.email&quot;</span><span class="p">:</span> 
<span class="s">&quot;[email protected]&quot;</span>  <span class="p">},</span>
+    <span class="p">{</span> <span class="s">&quot;person.name&quot;</span> 
<span class="p">:</span> <span class="s">&quot;Stefan Sauer&quot;</span><span 
class="p">,</span>
+      <span class="s">&quot;person.email&quot;</span><span class="p">:</span> 
<span class="s">&quot;[email protected]&quot;</span>   <span class="p">},</span>
+    <span class="p">{</span> <span class="s">&quot;person.name&quot;</span> 
<span class="p">:</span> <span class="s">&quot;Benjamin Nagel&quot;</span><span 
class="p">,</span>
+      <span class="s">&quot;person.email&quot;</span><span class="p">:</span> 
<span class="s">&quot;[email protected]&quot;</span>   <span class="p">},</span>
+    <span class="p">{</span> <span class="s">&quot;person.name&quot;</span> 
<span class="p">:</span> <span class="s">&quot;Fabian Christ&quot;</span><span 
class="p">,</span>
+      <span class="s">&quot;person.email&quot;</span><span class="p">:</span> 
<span class="s">&quot;[email protected]&quot;</span>  <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Status: <strong>NOT Implemented, yet.</strong></p>
+<h3 id="query_for_combinations_of_facts">Query for Combinations of Facts</h3>
+<p>Allows clients to query for combinations of facts.</p>
+<p>Path: /factstore/query?q=</p>
+<p>Method: GET with data type application/json returns application/json</p>
+<p>Data: The query is specified by a JSON-LD object in request parameter "q" 
of the request. The query defines a "select" to specify the desired type of 
result to be returned in the result set. Instead of using a "from" part this 
type of query supports joins over facts using the "join" field. The "join" 
field specifies which facts are joined by specifying the elements of the facts 
that are evaluated to be equal during the join. The "where" clause specifies 
constraints over the join to be fulfilled.</p>
+<p><em>Note</em>: For the moment constraints only support the equals "=" 
relation. There may be more relations like "&gt;" in future versions of this 
specification. If there is more than one constraint all constraints are 
concatenated by "AND".</p>
+<p>Example: GET /factstore/query?q= with the following request data in request 
parameter "q"</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;iks&quot;</span> <span class="p">:</span> <span 
class="s">&quot;http://iks-project.eu/ont/&quot;</span>
+  <span class="p">},</span>
+  <span class="s">&quot;select&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+    <span class="s">&quot;iks:friendOf.friend.name&quot;</span>
+  <span class="p">],</span>
+  <span class="s">&quot;join&quot;</span> <span class="p">:</span> <span 
class="p">{</span>
+    <span class="s">&quot;iks:employeeOf.person&quot;</span> <span 
class="p">:</span> <span class="s">&quot;iks:friendOf.person&quot;</span>
+  <span class="p">},</span>
+  <span class="s">&quot;where&quot;</span> <span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span>
+      <span class="s">&quot;=&quot;</span> <span class="p">:</span> <span 
class="p">{</span>
+        <span class="s">&quot;iks:employeeOf.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://upb.de&quot;</span>
+        <span class="p">}</span>
+      <span class="p">}</span>
+    <span class="p">},</span>
+    <span class="p">{</span>
+      <span class="s">&quot;=&quot;</span> <span class="p">:</span> <span 
class="p">{</span>
+        <span class="s">&quot;iks:friendOf.friend.city&quot;</span> <span 
class="p">:</span> <span class="s">&quot;Paderborn&quot;</span>
+      <span class="p">}</span>
+    <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>will return a list of names of all the friends living in Paderborn of the 
employees of the University of Paderborn. The result in JSON-LD format would 
look like the following.</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;iks&quot;</span> <span class="p">:</span> <span 
class="s">&quot;http://iks-project.eu/ont/&quot;</span>
+  <span class="p">},</span>
+  <span class="s">&quot;resultset&quot;</span><span class="p">:</span> <span 
class="p">[</span>
+    <span class="p">{</span> <span 
class="s">&quot;iks:friendOf.friend.name&quot;</span> <span class="p">:</span> 
<span class="s">&quot;Schmidt&quot;</span>   <span class="p">},</span>
+    <span class="p">{</span> <span 
class="s">&quot;iks:friendOf.friend.name&quot;</span> <span class="p">:</span> 
<span class="s">&quot;Meier&quot;</span>     <span class="p">},</span>
+    <span class="p">{</span> <span 
class="s">&quot;iks:friendOf.friend.name&quot;</span> <span class="p">:</span> 
<span class="s">&quot;Schneider&quot;</span> <span class="p">},</span>
+    <span class="p">{</span> <span 
class="s">&quot;iks:friendOf.friend.name&quot;</span> <span class="p">:</span> 
<span class="s">&quot;Schuster&quot;</span>  <span class="p">}</span>
+  <span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
   </div>
   
   <div id="footer">


Reply via email to