|
From: <jm...@us...> - 2010-03-18 10:13:49
|
Revision: 1330
http://eulergui.svn.sourceforge.net/eulergui/?rev=1330&view=rev
Author: jmvanel
Date: 2010-03-18 10:13:42 +0000 (Thu, 18 Mar 2010)
Log Message:
-----------
add examples to show the use of log:includes and @keywords (from N3 specification)
Added Paths:
-----------
trunk/eulergui/examples/log_includes.n3
trunk/eulergui/examples/log_includes2.n3
Added: trunk/eulergui/examples/log_includes.n3
===================================================================
--- trunk/eulergui/examples/log_includes.n3 (rev 0)
+++ trunk/eulergui/examples/log_includes.n3 2010-03-18 10:13:42 UTC (rev 1330)
@@ -0,0 +1,18 @@
+@prefix log: <http://www.w3.org/2000/10/swap/log#>.
+@prefix : <http://jos.org#>.
+@keywords.
+
+# this example shows the use of @keywords to avoid writing : before every term.
+
+Bob lives Boston.
+Bob wrote { Boston weather sunny }.
+Alice lives Adelaide.
+Alice wrote { Boston weather cold }.
+
+@forAll x, y, z, w.
+{ x wrote y.
+ y log:includes {z weather w}.
+ x lives z
+} log:implies {
+ z weather w
+} .
Added: trunk/eulergui/examples/log_includes2.n3
===================================================================
--- trunk/eulergui/examples/log_includes2.n3 (rev 0)
+++ trunk/eulergui/examples/log_includes2.n3 2010-03-18 10:13:42 UTC (rev 1330)
@@ -0,0 +1,23 @@
+@prefix log: <http://www.w3.org/2000/10/swap/log#>.
+@prefix : <http://jos.org#>.
+@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> .
+
+# cf http://www.w3.org/DesignIssues/N3Logic
+# This means: "We believe statements about the weather at a place only from people who live there."
+# Works only with Euler.
+
+:Bob :lives :Boston.
+:Bob :wrote {:Boston :weather :sunny}.
+
+:Alice :lives :Adelaide.
+:Alice :wrote {:Boston :weather :cold}.
+
+
+{ ?x :wrote ?y.
+ ?y log:includes {?z :weather ?w}.
+ ?x :lives ?z
+} log:implies {
+ ?z :weather ?w
+} .
+
+# expected ==> :Boston :weather :sunny .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|